Detect if Scene is used in Animation?
-
Is there a way to tell if a scene is used in th animation? I was digging around the page methods, but I couldn't see what I was looking for. Anyone know how to do it?
Chris
-
Look at the Page.behaviors, maybe.
-
nevermind...
-
So a general ruby question to add to this.
How do I get a find all methods available to an object? I saw lots of public_methods, singleton_methods, etc., but I am not sure which is really showing me the info I am interested in.
I just want to do something like:
my_page.sketchup_methods
and get it to return a list of methods available to that object, preferably weeding out as many non-SU methods as possible. I realize .sketchup_methods is not available, but is there something similar that does not return every method in ruby? I am hoping to find an undocumented include_in_animtion? method or something
Chris
-
@chris fullmer said:
Is there a way to tell if a scene is used in the animation?
All scenes are used, unless you implement Animation.nextFrame to stop someplace.
You could, I s'pose, set a scene's transition and delay times to zero. If you try it, let us know!
-
@martinrinehart said:
All scenes are used, unless you implement Animation.nextFrame to stop someplace.
Users can turn off whether a scene is used in a slideshow. I think that is what he was asking, but I could be mistaken... If I'm not, then:For checking a page for use in animation:
if page.name==page.label #used in animation
It's kinda hacky, but it works. The reason it works is that SU puts parentheses around a name for the tab label. If the label (with parens) doesn't match the name (without parens), it's not used. If they match, it IS used.
I previously requested a page.in_slideshow? method, but no dice yet (probably because of the available workaround), though it would be easy to code:
class Page def in_slideshow? return self.name==self.label end end
Then make it an externally loaded file contingent upon not having a native method:
require 'page-in-slideshow.rb' unless page.methods.include?('in_slideshow?')
or something like that, to handle a future native API method.
For checking available SU methods:
model.methods.sort-Object.methods page.methods.sort-Object.methods #etc
-
Aha! there it is, thanks Rick! I had noticed the .label method. I had checked the .name method to see if it would return the name in praenthesis (like .label apprently does), but obviously found nothing. Thanks for pointing that method out. Not a bad suggestion for the .skx I think.
Chris
Advertisement