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:
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.
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?
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.
Heavily annotated script. DL to any convenient folder.
Extract to Plugins. Bug fixes through 6/14.