[Plugin Update] Ruby Console Pro with SketchTalk in Motion++

[Plugin Update] Ruby Console Pro with SketchTalk in Motion++

Postby MartinRinehart » Wed May 26, 2010 2:26 pm

Edit: 6/7/2010 New file. Minor bug fixes. Added file: heavily annotated demonstration script.

Edit: Now (6/1/10, 9:15AM) includes very early version of this gizmo:

video_player.jpg


Edit: Even newer file! Get your movie director duds on and control the camera! See post #11 below for instructions.

Edit: New file! Now moves, rotates and scales.

Pioneering code. To pioneer you must be strong and fearless. Absolutely nothing is guaranteed. Edit: No reports yet of any fried computers.

This plugin lets you add motion to your models without any of the complications you used to meet. You can move one or more component instances at once, each doing one or more separate motions at times you specify.

In this sample script I open a background model, then import my biplane. It is imported to the origin. The first move (no start/stop times specified) slides it to the side instantly. The other moves specify start and stop seconds. It rolls forward and back, then takes off and flies away. Then I import "blueplane" and it does roughly the same. Note that "blueplane" does nothing between seconds 6 and 10. It waits for biplane to catch up.

Code: Select all
n
open '/models/airshow/background.skp'

bp = i '/models/airshow/biplane'
none

m bp, [0,250,0]
m bp, [100,0,0],0,5
m bp, [-100,0,0],5,10
m bp, [100,0,100],10,15
m bp, [1000,0,0], 15,20

bp2 = i '/models/airshow/blueplane'
none

m bp2, [-100,0,0], 0,3
m bp2, [100,0,0],3,6
m bp2, [100 ,0,100],10,15
m bp2, [1000,0,0], 15, 20

go


These are the non-obvious bits:
n - Ctrl+A, Del (File/New without the "Save changes..." dialog)
none - clear all selections (use "none" often)
go - begins executing the specified movements

During motion you can orbit and zoom. (If you're quick you can open a component for editing while it moves. If you see smoke coming from your computer, maybe that's not a good idea.)

The code above works on my computer because I've got, for example, a biplane in /models/airshow/biplane.skp. You can try the following starter script that creates its own components. Copy here, paste into your Ruby Console Pro and click "Exec". Who says there's no magic in the world?

Code: Select all
n
box o, [20,20,0], 10
box1 = g 'box1'
m box1, [20,20,30], 2, 20
m box1, [-20,-20,-30], 20, 30
none

box o, [-20,-20,0], 10
box2 = g 'box2'
m box2, [-20,-20,30], 4, 20
m box2, [40,40,-20], 25, 30
none

box o, [-20,20,0], 10
box3 = g 'box3'
m box3, [-20,20,30], 8, 20
m box3, [40,-20,-10], 23, 27
none

box o, [20,-20,0], 10
box4 = g 'box4'
m box4, [20,-20,30], 12, 20
m box4, [-20,40,0], 20, 23

all

go


Edit: There are additional scripts in later posts. They keep getting better!

Extract the file into your Plugins folder. It adds a "Ruby Console Pro" item under "Ruby Console" in your "Window" menu. Launch and click "Setup" and set the default file to some folder that makes sense on your machine. Now you're ready to get moving.

Edit: Mac? You're almost ready. In the Plugins/ruby_console_pro folder there are three HTML files. In each you have to slip in a "1" in front of "0px" so it becomes "padding: 10px;". There's a comment at the appropriate spot.

If you animate instances that are part of other instances, do let us know what happens. Bug Splat if you're lucky? Smoke if you're not?

F1 is set for SketchTalk help. You'll see that scale and rotate have little demo animations, but aren't yet integrated. I've got more to do. Edit: With any luck, scale and rotate happen this weekend! Edit 2: Two boxes rotating, 8:35 AM, Saturday! Edit 3: Box correctly scaled! Moved, rotated and scaled simultaneously, 11:05 AM. Edit 4: New demo script features four boxes moving, rotating and scaling and it's way more fun than just moving! On to package all this up and UL the file. 11:22 AM.

I've still got work to do. You need something similar for the camera. Edit: The camera eye moved over 3 seconds, 8:12 AM, Sunday morning. Moved by a vector, 8:34. Camera's field of view (zoom) is animatable, 10:12. Camera's target animatable, 10:59! Now to create a little doc and UL a new file. First, though a nifty demo script.
0
Last edited by MartinRinehart on Mon Jun 14, 2010 3:51 pm, edited 16 times in total.
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion

Postby CadFather » Wed May 26, 2010 3:08 pm

Thanks Martin, sounds like fun..
0
Quarr-IT - SketchUp Training from the Master.. http://quarr-it.com/
User avatar
CadFather 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion

Postby MartinRinehart » Thu May 27, 2010 5:12 pm

CadFather wrote:Thanks Martin, sounds like fun..


Animation can be fun. Did you see my movie? (running time: 3 minutes)

Animation has serious uses, too.
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion

Postby MartinRinehart » Fri May 28, 2010 7:40 pm

Zero bugs? No Mac issues?
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion

Postby driven » Fri May 28, 2010 8:20 pm

MartinRinehart wrote:Zero bugs? No Mac issues?

hi Martin,

great work, again, the test animation runs, no flames, yet, I'll have a proper look when I get some time

on the console [and the previous] I had to add padding to the body of the html to see the buttons, also not sure if Function keys work at all, but I may have them turned off for something else...

style type='text/css'
body {
background: #f0ecd8;
height: 100%;
overflow: hidden;

padding:10px

I did all three, or else you get a crop line on the mac...
I also changed the WD's to show_modal as I prefer that to hunting behind the drawing...

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion

Postby MartinRinehart » Sat May 29, 2010 1:46 pm

driven wrote:I also changed the WD's to show_modal as I prefer that to hunting behind the drawing...


Damn the differences. On PC, they are on top by default. For me the Ruby Console, now the RCP, was always a vital modeling tool. Putting a banister on a stairway is a b* without it. I'd suggest an arrangement of a not-quite-maximized SketchUp beside peeking-out-from-behind RCP. (Big monitors are a Good Thing now that they're not prohibitively expensive.)

Got to check into your other stuff. Thanks much for the feedback.
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion

Postby MartinRinehart » Sat May 29, 2010 4:52 pm

11:50 AM, Saturday morning.

There's a new file attached to the original post. You definitely want it. It adds rotation and scale.

Put this in your RCP and Exec it with the new version:

Code: Select all
n
box o, [20,20,0], 10
box1 = g 'box1'
m box1, [20,20,30], 2, 20
s box1, [0,0,0], 2, 2, 2, 5, 20
q box1, [0,0,0], 'gb', 360, 5, 20
m box1, [-20,-20,-30], 20, 30
s box1, [0,0,0], 0.5, 0.5, 0.5, 20, 32
none

box o, [-20,-20,0], 10
box2 = g 'box2'
m box2, [-20,-20,30], 4, 20
q box2, [0,0,0], 'rb', 360, 5, 18
m box2, [40,40,-20], 25, 30
none

box o, [-20,20,0], 10
box3 = g 'box3'
m box3, [-20,20,30], 8, 20
m box3, [40,-20,-10], 23, 27
q box3, [0,0,0], 'rb', 360, 20, 23
none

box o, [20,-20,0], 10
box4 = g 'box4'
m box4, [20,-20,30], 12, 20
m box4, [-20,40,0], 20, 23
q box4, [0,0,0], 'gb', 360, 20, 25

all

go
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion

Postby MartinRinehart » Sat May 29, 2010 5:11 pm

OK, John. Got my rotate/scale done. Now back to multi-platform coding.

driven wrote:
style type='text/css'
body {
background: #f0ecd8;
height: 100%;
overflow: hidden;

padding:10px


On a PC, that gives you this:

add_padding.jpg


It's supposed to look like this:

no_padding.jpg


I can write a little JavaScript that goes something like this:

Code: Select all
// not real code!

if ( platform === 'Mac' ) {
    body.style.padding = '10px'
}


What about the output and setup windows? Do they need help, too?
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion

Postby driven » Sat May 29, 2010 8:05 pm

Martin,

I basically get the exact opposite to your images without the padding, so I add it to all three html's...

and the new script,

SU is hardly working at all when running this (8% of cpu) and it doesn't even slow down if I turn on transparency, shadows and fog...

It's run time comes in at 31.4sec on the mac, how does that compare?

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion

Postby MartinRinehart » Sun May 30, 2010 1:49 pm

driven wrote:It's run time comes in at 31.4sec on the mac, how does that compare?


There's a Conductor singleton at the center of the animation.

Every second the conductor looks at his watch. He speeds up or slows down based on what he sees. That means fast and slow machines will all run at the same speed. This animation is scripted for 30 sec. so 31.4 means the conductor is doing a pretty good job.

That 8% number is happy-making! (Edit: I got 0 to 6%.) Boxes are low-poly. 8% means you have room for animating much bigger things. An old-fashioned steam engine, anyone?
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion

Postby MartinRinehart » Sun May 30, 2010 6:13 pm

New SketchTalk for controlling and animating the camera!

There are six new methods, each with two forms but they are very regular. (Before you can use this you have to go buy a folding chair with the word "Director" stenciled in very large letters on the back.)

Now, the things you need to know about the new functions. First, they all start with "c" for camera.

Second, they continue with "e" for camera eye, "f" for camera field of view or "t" for camera target. Now you know four things: start with "c" and then specify "e" for eye, "f" for field of view or "t" for target.

The fifth thing you need to know is that they each have an optional third letter "m" for movement. The cem() and ctm() functions move eye and target by a vector from their current location. The cfm() function adds the specified number of degrees to the current field of view. (Higher degrees==zoom out.)

You set the eye with ce(), just once. From then on use cem(). Similarly, you set the field of view once with cf(). From then on you change it with cfm().

The sixth, and last, thing you need to know is that they are like the move, scale and rotate methods. You provide a single value if you just want the thing to happen immediately. You append start and stop second specifications if you want it to be animated. (My personal most common mistake: forget to put 'go' in the script and wonder why nothing happens.)

The first value for ce() is a Geom::Point3d object. That is too much trouble to type, however. Just use a [r,g,b] array. Ditto for ct(). Ditto for the Geom::Vector3d you want for cem() and ctm().

Here's a sample. Yes, its way over the top, but it's still a sample.

Code: Select all
n
ct [0,0,0]

cf   35
cfm  35,  2, 14
cfm -35, 14, 30

ce  [  100,  100,  0]
cem [    0,    0, 50],  0,  2 #  100,  100
cem [    0, -100, 0 ],  2,  5 #  100,    0
cem [    0, -100, 0 ],  5,  8 #  100, -100
cem [ -100,    0, 0 ],  8, 11 #    0, -100
cem [ -100,    0, 0 ], 11, 14 # -100, -100
cem [    0,  100, 0 ], 14, 17 # -100,    0
cem [    0,  100, 0 ], 17, 20 # -100,  100
cem [  100,    0, 0 ], 20, 23 #    0,  100
cem [  100,    0, 0 ], 23, 30 #  100,  100

box o, [20,20,0], 10
box1 = g 'box1'
m box1, [20,20,30], 2, 20
s box1, [0,0,0], 2, 2, 2, 5, 20
q box1, [0,0,0], 'gb', 360, 5, 20
m box1, [-20,-20,-30], 20, 30
s box1, [0,0,0], 0.5, 0.5, 0.5, 20, 32
none

box o, [-20,-20,0], 10
box2 = g 'box2'
m box2, [-20,-20,30], 4, 20
q box2, [0,0,0], 'rb', 360, 5, 18
m box2, [40,40,-20], 25, 30
none

box o, [-20,20,0], 10
box3 = g 'box3'
m box3, [-20,20,30], 8, 20
m box3, [40,-20,-10], 23, 27
q box3, [0,0,0], 'rb', 360, 20, 23
none

box o, [20,-20,0], 10
box4 = g 'box4'
m box4, [20,-20,30], 12, 20
m box4, [-20,40,0], 20, 23
q box4, [0,0,0], 'gb', 360, 20, 25

all

go


We start with a 35 degree (default if you haven't changed it) field of view. We zoom out to 70, then back in to 35.

The eye takes a clockwise tour around the origin in a big square, from 100,100 to -100,-100. If you think this is easy, try it without copying my code.

Good luck!
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion

Postby driven » Sun May 30, 2010 9:11 pm

EDIT: this is what happens when you DON"T swap out the NEW version at top of page, it's all working now


n # nil
ct [0,0,0] # #<NoMethodError: undefined method `ct' for Ruby_Console_Pro:Module>

cf 35 # #<NoMethodError: undefined method `cf' for Ruby_Console_Pro:Module>
cfm 35, 2, 14 # #<NoMethodError: undefined method `cfm' for Ruby_Console_Pro:Module>
cfm -35, 14, 30 # #<NoMethodError: undefined method `cfm' for Ruby_Console_Pro:Module>

ce [ 100, 100, 0] # #<NoMethodError: undefined method `ce' for Ruby_Console_Pro:Module>
cem [ 0, 0, 50], 0, 2 # 100, 100 # #<NoMethodError: undefined method `cem' for Ruby_Console_Pro:Module>
cem [ 0, -100, 0 ], 2, 5 # 100, 0 # #<NoMethodError: undefined method `cem' for Ruby_Console_Pro:Module>
cem [ 0, -100, 0 ], 5, 8 # 100, -100 # #<NoMethodError: undefined method `cem' for Ruby_Console_Pro:Module>
cem [ -100, 0, 0 ], 8, 11 # 0, -100 # #<NoMethodError: undefined method `cem' for Ruby_Console_Pro:Module>
cem [ -100, 0, 0 ], 11, 14 # -100, -100 # #<NoMethodError: undefined method `cem' for Ruby_Console_Pro:Module>
cem [ 0, 100, 0 ], 14, 17 # -100, 0 # #<NoMethodError: undefined method `cem' for Ruby_Console_Pro:Module>
cem [ 0, 100, 0 ], 17, 20 # -100, 100 # #<NoMethodError: undefined method `cem' for Ruby_Console_Pro:Module>
cem [ 100, 0, 0 ], 20, 23 # 0, 100 # #<NoMethodError: undefined method `cem' for Ruby_Console_Pro:Module>
cem [ 100, 0, 0 ], 23, 30 # 100, 100 # #<NoMethodError: undefined method `cem' for Ruby_Console_Pro:Module>


I'll look closer later, but for now... yesterday's bit ran, but no new camera moves, do I need to require SketchTalk?

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion++

Postby driven » Sun May 30, 2010 10:04 pm

Hi Martin,

I did a quick[ish] hi-poly test 1.5 million edges and it slowed down to 01:27.8 min and was pulling 92-96% on single core of CPU, but ran quite smoothly after the component switch settled down. It certainly looks cool animating grassy blocks...
grasianim.jpg


I know should do it in code, but it's just quick trick to test hi-poly performance

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion++

Postby mptak » Mon May 31, 2010 1:30 am

I so love what you are doing!!!!! How do we get this into the hands of kids so they concurrently learn both their math and animation...Perhaps so they can control undersea vehicles and tophats under the ocean!
0

mptak 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion++

Postby MartinRinehart » Mon May 31, 2010 4:28 pm

driven wrote:I did a quick[ish] hi-poly test 1.5 million edges and it slowed down to 01:27.8 min


Take it easy! Your conductor's probably becoming neurotic because he can't get the job done.

Seriously, its good to find the limits. We could actually model the lawn, showing it grow. Would have to do something more clever than modeling each blade separately.

mptak wrote:I so love what you are doing!!!!! How do we get this into the hands of kids ...


Hmmm. Good thought. First, though, a little controller thingie and we've got a really nice walk-through capability for the architects.
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion++

Postby MartinRinehart » Tue Jun 01, 2010 2:23 pm

Video Player now included in very early stage. It pauses and resumes play.

It seems to argue with the timing software. I'll look into that tomorrow. I think what's needed now is a tutorial for creating walkthroughs.
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion++

Postby driven » Tue Jun 01, 2010 2:42 pm

MartinRinehart wrote:Video Player now included in very early stage. It pauses and resumes play.

It seems to argue with the timing software. I'll look into that tomorrow. I think what's needed now is a tutorial for creating walkthroughs.


pause and resume work, no < << ; >> > [but you didn't say there was..]

the padding 'trick' doesn't work, had to redo as simply padding: 10px

great work, keep it coming

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion++

Postby MartinRinehart » Tue Jun 01, 2010 9:55 pm

driven wrote:
MartinRinehart wrote:Video Player now included in very early stage. It pauses and resumes play.

pause and resume work, no < << ; >> > [but you didn't say there was..]
john


Start/End should be cake. Back, For'd? Hmmm. Timing tho is more worrisome. Did three tests, none of them using pause/resume: 22, 32 and 40 sec. (All should have been 32.)

Does Video Player look OK on Mac? Had to play tricks to get it to look right in MSIE.
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion++

Postby driven » Tue Jun 01, 2010 10:20 pm

MartinRinehart wrote: Did three tests, none of them using pause/resume: 22, 32 and 40 sec. (All should have been 32.)


the current, 'select all' file is running at 13.5 sec from pressing play until end without using pause, what are you timing?
EDIT: Sometimes, I get 35>37 sec if I re-run 'without' (me) deleting the existing 4 boxes (from a previous run) other times the same thing still runs fast... It is the camera move file, but the non cam version runs at 13.5ish as well

Does Video Player look OK on Mac? Had to play tricks to get it to look right in MSIE.

Where is the WD container generated/sized? I was going to see if I could restrict it to the button block size or add some Mac only features as an experiment, but I can't find where you hid it...

playerMac.jpg
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion++

Postby MartinRinehart » Wed Jun 02, 2010 12:10 pm

Timing: 3 tests ranging from 31+ to just under 33 for a 32 second model. (Stupid me: was setting start time at go. Now setting it, correctly, when you click to start.)

driven wrote:Where is the WD container generated/sized?


In the Conductor initialize() method, sketch_talk_motion_classes.rb, line 217. Then position fiddled in video_player.html in the <body> tag. This is what I want:

video_player.jpg
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion++

Postby driven » Fri Jun 04, 2010 4:25 pm

MartinRinehart wrote:This is what I want:


although this probably isn't what you want, I've been using it to try making a MSIE/Safari controller just using text (no images)

I think it looks quite good, but when trying to load from RCPro in PC SU, I kept getting bugsplats, which I put down to me and windows or the ruby,,,

however, when I returned to OSX SU and tried to load from RCPro it also crashed...

after a restart I loaded it with Ruby Console Editor (which I partly wrote it in) and it works fine.

I then went back to PC SU and ran it from Ruby Console...

There are other PC issues with the file , but it does load from Ruby Console and not RCPro...

might be good for bug testing... if you want to have a look, I'll PM the file...

MovieToolMac_test.jpg
MovieToolMac_PCtest.jpg

EDIT: Similar but different, not as nice in IE, now to try PC/SU again....ahhhhh
TextShadows_IE&Safari.jpg


john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion++

Postby MartinRinehart » Mon Jun 07, 2010 11:04 am

Cool!

<body scroll=no> MSIE only and should never be used (unless you are locked into MSIE, as we are).

{overflow: hidden;} This is another one you almost never want to use, but, in the case at hand ...
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin] Ruby Console Pro with SketchTalk in Motion++

Postby driven » Mon Jun 07, 2010 3:40 pm

MovTol2Safari.jpg
MartinRinehart wrote:Cool!

<body scroll=no> MSIE only and should never be used (unless you are locked into MSIE, as we are).

{overflow: hidden;} This is another one you almost never want to use, but, in the case at hand ...

Hi Martin, I finally got it to work, still not functioning, just the WD bit using shadowed/glow fonts, which you can change colours around in code (not done yet), i.e on action, on hover, etc... I'll PM the file...


MovTol2MSIE.jpg
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [Plugin Update] Ruby Console Pro with SketchTalk in Moti

Postby MartinRinehart » Mon Jun 14, 2010 3:52 pm

UL'd minor bug fix version, 6/14.
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin Update] Ruby Console Pro with SketchTalk in Moti

Postby Pout » Fri Jun 25, 2010 3:06 pm

Hello Martin,

This seems to be very interesting but somehow i don't really understand what it is for.
I suppose en environment in which you can easily code animations in Sketchup?

Thx for helping me out here

(btw the airshow is great)
0

Pout 
 

Re: [Plugin Update] Ruby Console Pro with SketchTalk in Moti

Postby jessejames » Sat Jul 17, 2010 9:48 pm

MartinRinehart wrote:Ruby Console Pro


Magnificent Martin! simply Magnificent!

This console is exactly what i have been lamenting about since i first used SketchUp! Had SketchUp included a GUI kit i would of created something like this myself! However i bow to you!

Any who, i had a few questions/suggestions for improvement...

1. Can you combine the input and output windows into one window. Preferably with the output window at the bottom. I have no idea if things like "sizable panes" are available for user customization of the sizes? However even with no customization it would be a nice alternative to have both in one window.

2. I noticed pressing tab does not insert a tab char into the text area, it just does the usual "tabbing" of focus though the widgets. Can this be overridden to insert a tab? I don't care about losing the "tabbing" ability!

PS: oh and i did also have a problem with the buttons being cut off at the top (like a previous poster had mentioned). However I played around with the padding values and was able to rectify it. I am using Vista+SU7+Chrome. So just an FYI.

Thanks again Martin!
0
Always sleep with a loaded gun under your pillow!

jessejames 
 

Re: [Plugin Update] Ruby Console Pro with SketchTalk in Moti

Postby jaysax » Thu Aug 26, 2010 5:20 pm

For the still-ruby-challenged, can you give me any tips on a couple of things?

1) what about using q to do rotations in an arbitrary direction not defined by the planes? I am assuming that's implied in the way you wrote your doc page, but a real life example of how would be really nice. Say I want to rotate a group a few degrees around an axis that runs from, say, [0,0,0] to [1, 1, 0] (or along an axis that runs from some definable part of the group to a given point).

I am used to thinking in terms of hinges in SketchyPhysics for this sort of thing, as background for the next question.

2) I've got an existing model with several groups that need to move around in a related, but not quite identical, way.

a) Could just set them all in place and give them all the same (relative) move commands, but is there a way to simply 'connect' two or more of them in some way but allow for some axes of independent movement? My specific need is the truck (one group, but with sub groups for wheels) with a tether (another group) connected to a payload box (another group) and from there to envelope with harness and line (last group for this illustration). The truck drives, the wheels spin and rotate on an axis where you'd expect them to, the tether follows behind, flexing somewhat in angle because the payload box and envelope have inertia and will dip a bit and tilt a little at start of movement. Things settle out during smooth driving.

b) existing groups/entities - is there a reasonable way to identify them as the model is opened? Perhaps I give them all names and there's a fairly easy way to look them up in some sort of ruby hash of entities in the model?

Jay
0

jaysax 
 

Re: [Plugin Update] Ruby Console Pro with SketchTalk in Moti

Postby MartinRinehart » Tue Aug 31, 2010 11:35 am

jessejames wrote:
MartinRinehart wrote:Ruby Console Pro



1. Can you combine the input and output windows into one window.

2. I noticed pressing tab does not insert a tab char into the text area, it just does the usual "tabbing" of focus though the widgets. Can this be overridden to insert a tab?


Missed this post. Sorry.

1. Yes, but don't want to. Arrange them how you like. They come up as you left them, next time.

2. Textareas are lame. Wish we had better. Many times I've enthusiastically started on a serious editor/ide, only to run into some insurmountable textarea roadblock.
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin Update] Ruby Console Pro with SketchTalk in Moti

Postby MartinRinehart » Tue Aug 31, 2010 11:44 am

jaysax wrote:For the still-ruby-challenged,...


Start with Chapter 11 and continue through Chapter 17. You'll become Ruby-literate. It's not hard.

jaysax wrote:1) what about using q to do rotations in an arbitrary direction not defined by the planes?


All my rotate stuff allows you to specify a plane ('rg', 'rb' or 'gb') or an axis. See my Leaning Tower of Pisa in the doc.

jaysax wrote:2) I've got an existing model with several groups that need to move around in a related, but not quite identical, way.


That's where ruby literacy has to come in. Alternatively, some brilliant insight that shows me how to create a generic solution to things that move in a related but non-identical way. Brilliant insights are always welcome.

Martin
0
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

MartinRinehart 
 

Re: [Plugin Update] Ruby Console Pro with SketchTalk in Moti

Postby jaysax » Wed Sep 01, 2010 3:13 pm

MartinRinehart wrote:
That's where ruby literacy has to come in. Alternatively, some brilliant insight that shows me how to create a generic solution to things that move in a related but non-identical way. Brilliant insights are always welcome.

Martin



Well, the relation is the question (that is, precisely how is the movement related).

I'm thinking that even something as simple as any group/component being able to indicate its interest in any other single group/component. That 'interest' means that any commands to move/translate the other group/component (along the axes of movement or rotation) would simply be applied to both, and then any commands to the original group/component would also be followed but for that group/component only.

Then again, you could just duplicate the translation orders I suppose.

The SketchyPhysics solution of having joints works for me. How about some adaptation of that? Each joint locks one or more of the translation modes (rgb/xyz roll pitch yaw) in terms relative between the two groups/components (I believe that is how to put it properly, but do amend terms as needed).
0

jaysax 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: No registered users and 8 guests

Visit our sponsors: