Excluding scenes from animation
-
I am looking for a method to exclude pages from my animation similar to how the "Include in animation" checkbox works from within Sketchup's scene editor. I am generating multiple scenes that cannot be included in my final render, and find the extra step of checking each of those mixed in scenes to exclude them quite tedious. I am having trouble finding an example of how to achieve this in the API documentation. I noticed the parenthesis around scene names in animations and thought perhaps that was the indicator of an excluded scene, and it would be simply...
model = Sketchup.active_model view = model.active_view pages = model.pages #(define operation here e.g. view.camera.perspective = false etc.) status = pages.add "(excluded scene)"However elegant this would seem, unfortunately it does not work. So I am guessing there is some other method to exclude scenes from the animation.
I had found a thread from Dan Rathbun somewhere dating a couple years back discussing a need for this, but I can't seem to find what the outcome was. If anyone knows, please advise.
-
A page's
page.nameand itspage.labelare NOT the same IF a scene tab is set to be excluded from a scene-animation - because then parentheses are added round the name when forming the label string.http://ruby.sketchup.com/Sketchup/Page.html#name-instance_method
http://ruby.sketchup.com/Sketchup/Page.html#label-instance_methodThis is a simple way of ensuring that only 'included' scene-tabs' pages get processed...
animated_pages = Sketchup.active_model.pages.find_all{|page| page.name == page.label } -
Tig, is there a way to access the "Include in animation" and "Play" from a script?
-
@sdmitch said:
Tig, is there a way to access the "Include in animation" and "Play" from a script?
My snippet does this - making 'animated_pages' subset ??
Since a page'spage.nameis the same as itspage.labelwhen it is included in an animation....
I don't think you can actually change the 'label' in the API ?
As far as I know you can't run the animation tool via the API, but of course your can simply step through the collected pages [scene tabs] in turn - using the 'animated_pages' subset, which I already explained how to assemble.
The transitions etc between pages is pre/re-set under various option settings ?
The page.delay time transition_time etc etc... -
@tig said:
The transitions etc between pages is pre/re-set under various option settings ?
The page.delay time transition_time etc etc...If i select a scene in a model, the transition time is applied but, if I select that same scene from a script, there is no transition and no delay unless I use sleep(). Entering the same script statement in the Ruby Console works just like selecting the scene in the model. The closest I have come is setting the view camera to the page.camera and refreshing the view but this bypasses the transition.
-
Okay, I just learned a lot. So I gather that in order for a page to be excluded from the animation it would need parenthesis to wrap the label string, but when you create a page from the ruby API by default the name IS the label string so that explains why my idea did not work and also why when I uncheck Include in animation the tab name now has 2 sets of parenthesis. If it is true that we can not change the label from the API, then there really is no way I can achieve the function I need as far as I can tell.
I guess that is why Dan had put in this request back in the day:
https://forums.sketchup.com/t/ruby-sketchup-page-use-in-animation-use-in-animation/11020Thank you for your script and insights Tig. It was helpful to me. I do have a better understanding what is going on now.
-
I just found this...
Handling "Include in animation" flag in Scenes
I am wondering if there is a way to handle the “Include in animation” flag from the API. I can’t see any related method in Sketchup::Page, so I guess it is not possible at all. Any hint? It would be useful to define whe…
SketchUp Community (forums.sketchup.com)
I guess this is as close as I am going to get to the status of Dan's request.
-
@skastafari said:
I just found this...
Handling "Include in animation" flag in Scenes
I am wondering if there is a way to handle the “Include in animation” flag from the API. I can’t see any related method in Sketchup::Page, so I guess it is not possible at all. Any hint? It would be useful to define whe…
SketchUp Community (forums.sketchup.com)
I guess this is as close as I am going to get to the status of Dan's request.
Using the page.name==page.label would certainly work. I'm still trying to solve the transition problem. I found this in the API but I have yet to get it to be recognized. Perhaps it has been removed or never implemented.
-
@sdmitch said:
I'm still trying to solve the transition problem.
When you manually change scenes (and the model does not have specific transition and/or delay properties assigned to individual page objects,) then the model's global animation transition and delay settings are used.
Global settings are via:
Window > Model Info > AnimationGlobal transition and delay is accessible via the model's options provider objects.
model = Sketchup.active_model manager = model.options popts = Sketchup.active_model.options["PageOptions"] popts.each {|o| puts o } #=> ShowTransition #=> TransitionTime sopts = Sketchup.active_model.options["SlideshowOptions"] sopts.each {|o| puts o } #=> LoopSlideshow #=> SlideTime
A per scene page settings interface is not yet implemented, but I think I myself and others have requested it as a PRO feature request. (I believe it should be a Pro only feature myself.)
You can easily write a script to set per page transition and delay.
I also think some of the better animation extensions have UI interface to set per scene transition and delay. (I think Smustard's does.)
-
@sdmitch said:
I found this (
view#camera=) in the API but I have yet to get it to be recognized.See:
(SketchUp Developer forum): Setter #view.camera= Testing with Second Transition Time Argument@sdmitch said:
Perhaps it has been removed or never implemented.
The API docs are a bit confusing.
The
view#camera=method is an overloaded method, which can be used two ways:-
with a single
Sketchup::Cameraobject argument -
with a single
Arrayargument of:[ Sketchup::Camera, Float ]
(The Float being the transition time.)
If you attempt to pass two arguments, of
Sketchup::CameraandFloat, the API ignores the second (time) argument and you get behavior #1. (Ie, a silent failure from what you'd expect.) -
-
@skastafari said:
I am looking for a method to exclude pages from my animation similar to how the "Include in animation" checkbox works from within Sketchup's scene editor.
...
I had found a thread from Dan Rathbun somewhere dating a couple years back discussing a need for this, but I can't seem to find what the outcome was. If anyone knows, please advise.FYI,... Finally, ... the API has been updated for version 2018 and higher ...
... both a query method and a setter method have been added to the
Sketchup::Pageclass.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement