The interact tool allows animations to be triggered.
Can one name these interactions and trigger them from ruby script, say by a timer at certain times,
or based on external events ?
Scripting is possible with scenes with the Pages/Page objects, so looking for something similar.
Because it is a proprietary internal SketchUp extension, and they chose not to expose and publish any interfaces to it’s features,… other than via the dynamic attributes.
The poster does not say much, so I’d just be guessing.
Have you looked at the abstract Animation class from the SketchUp API ?
module Author::SomePlugin
class CustomAnimation
MENUTEXT = "Run Custom Animation"
attr_reader(:timeout)
def initialize( timeout_sec = 20.0 )
@timeout = timeout_sec
@timeout_timer = UI.start_timer(@timeout,false) {
Sketchup.active_model.active_view.animation = nil
}
end
def nextFrame(view)
# move groups around with move! method
# return true to proceed to next frame
# return false to end the animation
end
end # class CustomAnimation
# This adds an item to the Camera menu to activate a custom animation.
UI.menu("Camera").add_item(CustomAnimation::MENUTEXT) {
UI.start_timer(0.0,false) {
Sketchup.active_model.active_view.animation = CustomAnimation.new(30.0)
}
}
end # Author::SomePlugin