Dynamic Component fun
-
As a bit of fun I wrote a Ruby importer of Quake levels into SketchUp. The importer marks up the ComponentInstances with DynamicComponent animations so the doors and platforms all work within LightUp. Perhaps I should check whether Quake buildings meet today's work lighting Regs..
[flash=800,600:3nte3by9]http://www.youtube.com/v/Un0LheJYeEY[/flash:3nte3by9]
LightUp has an automation feature that runs Ruby functions you've attached to your model from various Events during Tourtool. They're stored in an attribute dictionary (called :lightup) on the Model and Components of your SketchUp model - there are quite a few callbacks that are supported.
Try this:
- Load a model
- At Ruby console type:
Sketchup.active_model.set_attribute(:lightup, 'onstart', 'puts("Starting at #{Time.new}")')
and/or
Sketchup.active_model.set_attribute(:lightup, 'onstop', 'puts("Taadaa!")')
- Start Tourtool and see the messages printed on the Ruby console.
Using these functions, you could build a sophisticated experience that linked together interactions.
Other hooks are:
onreset: called for a new model
onupdate: called at 15Hz
oncreate: called for Component
onpick: clicked on Component -
Thats very cool.
-
Totally Amazing!
Advertisement