sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Detect if Scene is used in Animation?

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 4 Posters 186 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Chris FullmerC Offline
      Chris Fullmer
      last edited by

      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

      Lately you've been tan, suspicious for the winter.
      All my Plugins I've written

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        Look at the Page.behaviors, maybe.

        Hi

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by

          nevermind... 😄

          Hi

          1 Reply Last reply Reply Quote 0
          • Chris FullmerC Offline
            Chris Fullmer
            last edited by

            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

            Lately you've been tan, suspicious for the winter.
            All my Plugins I've written

            1 Reply Last reply Reply Quote 0
            • M Offline
              MartinRinehart
              last edited by

              @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!

              Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

              1 Reply Last reply Reply Quote 0
              • R Offline
                RickW
                last edited by

                @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
                

                RickW
                [www.smustard.com](http://www.smustard.com)

                1 Reply Last reply Reply Quote 0
                • Chris FullmerC Offline
                  Chris Fullmer
                  last edited by

                  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

                  Lately you've been tan, suspicious for the winter.
                  All my Plugins I've written

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement