HELP setting up a SU code editor
-
@driven said:
It could also mean, that if I want to distribute a RadRails Ruby9 experimental plugin that I've concocted on my bespoke setup, I can forewarn others who might want to use it, or supply the extra bits as an instal package[/b]
Are you trying to write SU plugins with Ruby on Rail?
(I'm feeling I'm not entirely on track with this thread any more...) -
@thomthom said:
Are you trying to write SU plugins with Ruby on Rails?
It's only one of John's ideas he's playing with. No harm in playing. Specifically I think he's thinking of it as perhaps a WebDialog/WebApplet platform.
If such a 'plugin' ran from a remote website or network server, I can see that it may have merit.
I have reservations however if Rails were to be used as a local WebDialog platform, as it's a server technology, and each client would need to have a full Ruby install along with RubyGems and Rails. That raises install headaches on the PC side. (Personally, I am nervous having servers run on my client machine, with an always on, broadband internet connection.)
I'd be interested to see if we could get eruby running under SUruby as a WebDialog helper.
-
@thomthom said:
Are you trying to write SU plugins with Ruby on Rail?
Maybe, if i have to,
I'm looking at 'Rails' more as a source of cross-platform 'ruby' tools that may be re-purposed into a 'cross-platform' Sketchup Plugins Tools that cope with 'all' you might find/use not just the 'ruby' (and also for the db, doc handling abilities.)As Dan points out, why re-invent the wheel. If it can be de-'railed' which 'may' just involve setting the preferences right, then it's a fast route to having a bespoke SU editor.
If you look at this lifted text and re-reference as if aimed at Sketchup, I think you'll agree it would be nice...
%(#008080)[About BitNamiWhat is BitNami?
The aim of BitNami is to simplify the deployment of web applications, such as wikis or blogs, in order to make them more accessible. There are a lot of high quality open source software packages that arenβt used as much as they could be because getting them up and running can be a complex process. We want to change that!
What are BitNami Stacks?
A BitNami Stack is an integrated software bundle that includes a web application and all of its required components (web server, database, language runtime), so it is ready to run out of the box. The Stacks can be deployed as traditional Native Installers, Virtual Machine Images or Cloud Images. Native installers are single file executables that you download to your machine. When double-clicked, they walk you through each step of the automated installation process. They are available for Windows, Mac OS X, Linux and Solaris. BitNami Virtual Machine Images are pre-configured and include a minimal installation of Linux and a BitNami Stack. They are available for VMWare and the latest version of VirtualBox. BitNami Cloud Images allow you to run a BitNami Stack in a cloud computing environment on a pay-as-you-go basis, and programmatically start and stop them. BitNami Cloud Images are currently available for Amazon EC2, with planned support for additional cloud environments.
Regardless of whether you choose a Native Installer, Virtual Machine Image or Cloud Image, you will be able to have your BitNami-packaged application of choice up and running in just minutes, with no manual configuration required.]
@thomthom said:(I'm feeling I'm not entirely on track with this thread any more...)
Me as well, we need to get back on rail(s)
john
-
@dan rathbun said:
If such a 'plugin' ran from a remote website or network server, I can see that it may have merit.
I have reservations however if Rails were to be used as a local WebDialog platform,[Although not using Rails] isn't this what Google do when you install the 'Gears' plugin for o3d Dev or Apple with the iPhone or iPad Dev kits?
@Thomas... The other, diversion on this thread is me trying to clarify the 'Baseline' and while it is touched on in other threads, those seem to be wanting to know for different reasons. i.e end user script management, etc...
I want to run a SetUpSketchUpTest.rb that proves what does and doesn't work, on any given setup, as opposed to second guessing and/or collating historic, disparate threads here and elsewhere.
If packaged as a simple one off 'Platform Tolerant' installation on volunteers machines the information could be fed into an editors library and let you know, as you type, if potential problems are there....
-
Ok - I'm getting more back on track now.
-
@driven said:
@dan rathbun said:
Nor does: class Sketchup::Geodesic [show on PC]
only if you don't have Geodesic.rb instaled BEFORE loading suapi.rb@dan rathbun said:
I cant find (mix-in) module Smoothable (is this a plugin?)
also, only if you don't have Geodesic.rb instaled BEFORE loading suapi.rb
Again, is Geodesic a Google plugin, or a third-party plugin?@driven said:
@dan rathbun said:
None of the DC classes or modules are on your list.
I don't have Pro installed
It doesn't matter, the DC classes are needed even on Free to interact with Dynamic Components. On the PC, if you turn OFF the DC extension, most of the Attribute Dictionary class methods no longer work.
The reason they are not enumerated / cataloged by su_api.rb is, that the script specifically ONLY targets modules Sketchup, UI and Geom. (I don't know this was by design, or honest omission.)@driven said:
@dan rathbun said:
The following classes, don't have prototypes defined (BUT SHOULD!):
UI::InputPoint [*no-proto]REVISED**
UI::Menu [*no-proto]REVISED
UI::PickHelper [no-proto]REVISED
UI::Tool [no-proto]
why??? Not sure what you mean here, but it may come to me if they suddenly turn up
REVISED:
InputPoint is defined as:Sketchup::InputPoint
Menu is defined as:Sketchup::Menu
PickHelper is defined as:Sketchup::PickHelper
(..and they ARE on your list.)
The confusion comes because the API doc lists them under "UI Classes".
The Tool class is weird. There is no prototype for coders to subclass, and this is often confusing for newbies. Sketchup treats an object as a tool, when the object is passed as the arg to Model.select_tool.@driven said:
@dan rathbun said:
*Sketchup::FrameChangeObserver [no-proto]
Is this a Pro thing?
No, it's general. The sample in the Sketchup Blog shows how to use it with Dynamic Components (but it likely can be used for other things.)
The weird thing is, it doesn't really matter what this class is named, when you attach an instance of this observer class, Sketchup only cares that it have a callback method named 'frameChange'.
But not having a 'prototype' of the class (for coders to subclass,) will mean that it will never show up in the API docs. Also, the Blog example, adds in a PC bug workaround. If this workaround was written into a proto-class then any custom subclass would inherit the 'fix'.
The example is named 'scenes.rb' you can download a nice formatted copy at:
http://www.smustard.com/forum/viewtopic.php?f=9&t=25#p47
and the Blogpost can be read here:
http://sketchupapi.blogspot.com/2009/07/dynamic-components-that-react-to-scene.html@driven said:
@dan rathbun said:
And then the standard extensions:
LanguageHandler ( should be moved to -> UI::LanguageHandler )
SketchupExtension (should be moved to -> Sketchup::Extension )
possibly Mac thing, but are you see the pattern emerging?
This occurs because su_api.rb specifically does not look for these classes, so they don't get enumerated / cataloged.@driven said:
I know there other factors, but we can test against installed version of Ruby as well as other...
Just a reminder that Win32/PC platform does not come with Ruby installed. There are users who would not understand how to install (or more so maintain,) a full Ruby installation. I'm thinking about a scenario where a PC (perhaps even a Mac,) can have a 'normal' full Ruby install in the normal place; AND a second full install under the Sketchup directory that is 'tweaked' specifically for use with Sketchup (and in the future hopefully Layout.)
That way the normal install can stay normal, and be used for things like Rails, without affecting SU. The opposite would be true as well. I've already manually copied a full 1.8.6 install into my SU folder. (This way I can have a 1.9.1 install in the root of my system, that is separate, as Sketchup can't handle v1.9.x at this time.) -
@driven said:
Basically, it seems suapi.rb could be the basis for a de-bugger..
Why re-invent? Ruby has a debugger. It's part of the standard library. It makes more sense to get it working with SU embedded Ruby.
-
@driven said:
so what does this mean?
It means I made a boo-boo (slappin' 'self up side the head!)
It's defined? SKSocket
-
%(#FF0000)[defined SKSocket?
Error: #<NoMethodError: (eval):894: undefined method `SKSocket?' for main:Object>
(eval):894]%(#008000)[defined? SJSocket
nil
SKSocket.methods(false).sort.join("\n")
add_socket_listener
connect
disconnect
write]so what does this mean?
-
@driven said:
SKSocket doesn't show up under XP....
I can see it on my PC. At the console type:
` defined? SKSocketconstant
If it were not defined the %(#BF0000)[defined?] keyword would return %(#BF0000)[nil].
SKSocket.methods(false).sort.join("\n")outputs:
add_socket_listener
connect
disconnect
write`EDIT: fixed typo: 'defined? SKSocket' was 'defined SKSocket?'
-
Dan, trial and error got me there, anyway...
thanks for the detailed explanation above, I had figured most of that out and was turning things 'on' and adding to the su_api.rb when I got distracted by being able to upload to 3D Warehouse from XP I'm trying to run a port scan to see how it differs between SUXP and SUMac upload path, I suspect a clash, but SU crashes if I come out of it to turn on my scanner, do you happen to know the PC routing to 3D Warehouse from SU? -
So in the end is it possible to hook up a debugger to SU? Pecan seemed to get something working, but his project seemed unstable on many systems. So iis possible, or not really. This painful thread is 5 pages long and its gone off on to so many tangents, I just can't take the suspense any more. Debugger possible?
-
So I thought I should post a link to Pecan's previous work. so I started digging around only to find that nearly all traces of it have been removed from the forum at his request I think. I think it worked on his system but caused so many problems for other people that he did not want to troublshoot it anymore.
But I did find a link to the wiki where he was updating everything. This might be itneresting to some of you guys. It seems to me like maybe you are talking about some of the same stuff that he was was trying to do to.
See if that is helpful in any way.
-
@chris fullmer said:
See if that is helpful in any way.
Chris, that's incredibly helpful, I have tried all those search terms in various combinations and never come across this before... thanks for pointing it out.
and yes a SU 'ruby' de-bugger is possible it's just not easy and cross platform, a little trickier still... and a multi language SU debug is a real 'bugger'
john
-
@dan rathbun said:
Again, is Geodesic a Google plugin, or a third-party plugin?
Sorry Dan I do keep forgetting to add this
` #--
*** This code is copyright 2004 by Gavin Kistner
*** It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt
*** Reuse or modification is free provided you abide by the terms of that license.
*** (Including the first two lines above in your source code usually satisfies the conditions.)
#++
Author:: Gavin Kistner (mailto:!@phrogz.net)
Copyright:: Copyright (c)2004 Gavin Kistner
License:: See http://Phrogz.net/JS/_ReuseLicense.txt for details
Version:: 1.3, 2004-Oct-3
Full Code:: link:../Geodesic_SketchUp.rb
This file allows the user to add geodesic models to SketchUp (http://www.sketchup.com).
See the Sketchup::Geodesic.create method for more information on creating and adding a geodesic dome/sphere.
====Version History
20040916 v1.0 Initial release; relies on Geodesic.rb
20040920 v1.1 Rewrite to use only SketchUp classes
20040920 v1.1.1 Fixed it to actually load
20040920 v1.2.1 Added icosahedron option. Spruce up documentation.
20041003 v1.3 Added primitive picker to the dialog interface. (Thanks TBD!)
The Sketchup::Geodesic class cannot be instantiated; it is a wrapper for the Sketchup::Geodesic.create method. See that method for more details.
class Sketchup::Geodesic`
-
@unknownuser said:
definitely separate, SU only uses one processor so you really want to be on the other...
[quote="Dan Rathbun":1k2r0bq3][
Hmmm.. things are getting better when things become cross-plaform.I agree, although separate OS builds of common components and libraries isn't a big issue, especially if use RubyStacks or similar to output your SU versions.
Don't suppose you have ever watched the You Tube videos on 'MacFuse'?the last 10 minutes + Q&A of the long one are interesting, [it all is if you use mac....] http://code.google.com/p/macfuse/
-
@chris fullmer said:
So I thought I should post a link to Pecan's previous work. (SuRDebug)
See if that is helpful in any way.Oh yes.. I had actually downloaded this last December, but have yet to install and try it out.
As John says it's Win32 only at present, but it's based on the Wx GUIkit, which is supposed to be cross-platform. The editor is based on SciTE Scintilla, and is a bit out of date (SciTE is up over ver 2 now.)
The thing I didn't 'like' about it (from first blush,) was that Sketchup is run as a subprocess of the editor. I'd prefer they run in separate processes, connect by I/O pipes. But in practice it may prove not to be a big deal.Scintilla is also supposed to be cross-platform (the SciTE 1.73 source code ...) STOP ..hold the presses!
I just checked the ver 2.01 source code of Scintilla, and it now comes with the MacOSX/Cocoa source code [the macosx dir was empty in ver 1.73, and the cocoa dir and it's framework subfolders is new.] And yes there are xcode project files. (EDIT: This is interesting, the Mac/OSX port of Scintilla was written and contributed by Adobe Systems! They needed to make the changes to support their ExtendScript Toolkit. The new code and xcode project files from Adobe were added into Scintilla ver 1.74, which is why my v1.73 folders were empty.) sourceforge linkI believe SciTE only has distros for Win32 and Linux/GTK+ available so far. (EDIT: The SciTE ver 2.03 page says it's been built and runs on: Windows XP, Fedora 8 and Ubuntu 7.10 with GTK+ 2.12.)
Hmmm.. things are getting better when things become cross-platform.
(EDIT: So I am thinking that SciTE, Notepad++ and SuRDebug, all based on Scintilla; could be ported to OSX.) -
@driven said:
@dan rathbun said:
I'd prefer they run in separate processes, connect by I/O pipes. But in practice it may prove not to be a big deal.
definitely separate, SU only uses one processor so you really want to be on the other...
not processors, John.. processes
(At Ruby console, type Process.pid and you get the process id number.) -
@dan rathbun said:
:lol: not processors, John.. processes
It was late by the time I shot that off :oops:
More of a Freudian, typo-slip really... then complete ignoranceshould read as... definitely separate, And as SU only uses one processor core, I really want a separate process to be on the other... but, I'm not even sure this terminology is any clearer?
So, I suppose what I'm trying to describe is a Separate App [bit like DashCode] that references/runs SU [on demand] when requested and also, has it's own separate openGL preview window for any other bits and bobs.... does this make sense?
-
you know that SketchUp Bridge allows running ruby code from another process in the SU process.
for openGL preview you can have a window inside SU for previews (tested by myself) but depends on what you want to preview in the first place.
Advertisement