sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Call for attention - context handlers and validation procs

    Scheduled Pinned Locked Moved Developers' Forum
    24 Posts 10 Posters 33.5k Views 10 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.
    • AdamBA Offline
      AdamB
      last edited by

      I'm half finished with a plugin called "Snitch" which collates the time each plugin's Observers take so we can start pointing fingers.

      Guidelines are fine, but witchhunts / naming and shaming has much better results. πŸ˜„

      Developer of LightUp Click for website

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        How do you manage to track other observers?
        Can it be translated into validation procs and context handlers?

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

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

          @adamb said:

          Guidelines are fine, but witchhunts / naming and shaming has much better results. πŸ˜„

          Woohoo!, let the games begin. I have a feeling I'm gonna score big!!!! (I hope its good to score big πŸ’š )

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

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            http://static.tvtropes.org/pmwiki/pub/images/torches_and_pitchforks.jpg

            Thomas Thomassen β€” SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              uh... both maybe πŸ˜„

              [flash=640,385:2c4nksvr]http://www.youtube.com/v/zrzMhU_4m-g?fs=1&hl=en_US[/flash:2c4nksvr]

              Thomas Thomassen β€” SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • honoluludesktopH Offline
                honoluludesktop
                last edited by

                Are the witches hunting, or are we hunting witches?-)

                Don't know what the following has to do with this topic, but it seemed like the thing to do:-)

                http://www.google.com/images?q=tbn;lnizWqr0oVMvhM;;www.wyldeart.com/Galleries/Expressionist/Edvard_Munch/Images/TheScream1Up.jpg&t=1&h=196&w=148&usg=__v8o0X36oacv_3bHuA0QFQ6a4ucw=

                1 Reply Last reply Reply Quote 0
                • honoluludesktopH Offline
                  honoluludesktop
                  last edited by

                  That's rich! The opening scene strikes a cord, it's me writing an app:-)

                  temp00.jpg

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    I made a little sniffer script that will log the scripts that creates context handlers. Lets one easier inspect which scripts are adding context handlers.

                    I found xLine to be processing the whole selection. I'll be looking further into what scripts have inefficient context handlers. At the moment it takes many seconds for me when I right click a large set of selected entities.

                    (Removed - See first post)

                    Type TT.list_context_handlers to get a list of attached context handlers in the Ruby Console.

                    Thomas Thomassen β€” SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • thomthomT Offline
                      thomthom
                      last edited by

                      I just updated the first post with the debug script - it now benchmarks the handlers, outputting the time they take to process to the Ruby Console.

                      Thomas Thomassen β€” SketchUp Monkey & Coding addict
                      List of my plugins and link to the CookieWare fund

                      1 Reply Last reply Reply Quote 0
                      • thomthomT Offline
                        thomthom
                        last edited by

                        Sample output for a selection of about 100K entities:

                        ### Context Handler ### 2D#loader.rb:181:inactivate' [...] 2D#.rb:44
                        0.0 seconds

                        Context Handler

                        bezier.rb:501 [...] bezier.rb:501
                        0.006 seconds

                        Context Handler

                        parametric.rb:320 [...] (eval):2696
                        0.0 seconds

                        Context Handler

                        (eval):103:in `load' [...] pb_loader.rb:9
                        0.0 seconds

                        Context Handler

                        tt_bitmap2mesh.rb:29 [...] tt_proxy_loader.rb:28
                        0.0 seconds

                        Context Handler

                        tt_image_opacity.rb:30 [...] tt_proxy_loader.rb:28
                        0.0 seconds

                        Context Handler

                        ui_manager.rb:261:in `build_ui' [...] tt_selection_toys.rb:240
                        0.004 seconds

                        Context Handler

                        xLine.rb:51 [...] xLine.rb:51
                        0.0 seconds

                        Context Handler

                        Lib6Plugin.rb:656:in `build_config_handlers' [...] ZLoader__FredoScale.rb:24
                        0.0 seconds

                        Context Handler

                        Lib6Plugin.rb:656:in `build_config_handlers' [...] ZLoader__OnSurface.rb:26
                        0.489 seconds

                        Context Handler

                        (eval):299:in `initialize' [...] dynamiccomponents.rb:38
                        0.0 seconds

                        Context Handler

                        webtextures_loader.rb:886 [...] webtextures.rb:22
                        0.0 seconds

                        Context Handler

                        bezierspline_main.rb:2413:in load_all_menus' [...] extensions.rb:36:in load'
                        5.657 seconds`

                        (Note I had modified xLine and Selection Toys prior to this test)

                        Thomas Thomassen β€” SketchUp Monkey & Coding addict
                        List of my plugins and link to the CookieWare fund

                        1 Reply Last reply Reply Quote 0
                        • fredo6F Offline
                          fredo6
                          last edited by

                          @thomthom said:

                          Sample output for a selection of about 100K entities:

                          Context Handler

                          bezierspline_main.rb:2413:in load_all_menus' [...] extensions.rb:36:in load'
                          5.657 seconds[/ruby]

                          I fixed the one for BezierSpline, with an upgrade.
                          see http://forums.sketchucation.com/viewtopic.php?f=323&t=13563&p=100509#p100509

                          Fredo

                          1 Reply Last reply Reply Quote 0
                          • thomthomT Offline
                            thomthom
                            last edited by

                            πŸ‘

                            Thomas Thomassen β€” SketchUp Monkey & Coding addict
                            List of my plugins and link to the CookieWare fund

                            1 Reply Last reply Reply Quote 0
                            • P Offline
                              Pout
                              last edited by

                              Reminds me of something simular I seem to have in big models when rightclicking a material.
                              The rightclick window just doesn't pop-up

                              1 Reply Last reply Reply Quote 0
                              • thomthomT Offline
                                thomthom
                                last edited by

                                @pout said:

                                Reminds me of something simular I seem to have in big models when rightclicking a material.
                                The rightclick window just doesn't pop-up

                                Yea - I've noticed that too. Very annoying. But that menu isn't accessible to ruby plugins. So I think that one is on Google's shoulders.

                                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                                List of my plugins and link to the CookieWare fund

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

                                  @unknownuser said:

                                  @thomthom said:

                                  Sample output for a selection of about 100K entities:

                                  Context Handler

                                  bezierspline_main.rb:2413:in load_all_menus' [...] extensions.rb:36:in load'
                                  5.657 seconds[/ruby]

                                  I fixed the one for BezierSpline, with an upgrade.
                                  see http://forums.sketchucation.com/viewtopic.php?f=323&t=13563&p=100509#p100509

                                  Fredo

                                  Bezierspline_main is still sort-of slow for me - it takes 8 seconds for the context menu to pop-up for 75,000 selected entities. (I admit to having a sub-standard pc.)

                                  Hi

                                  1 Reply Last reply Reply Quote 0
                                  • fredo6F Offline
                                    fredo6
                                    last edited by

                                    @jim said:

                                    Bezierspline_main is still sort-of slow for me - it takes 8 seconds for the context menu to pop-up for 75,000 selected entities. (I admit to having a sub-standard pc.)

                                    Jim,

                                    I made a change in the script.
                                    see main post on BezierSpline

                                    Is is better with this release

                                    Thanks

                                    Fredo

                                    1 Reply Last reply Reply Quote 0
                                    • thomthomT Offline
                                      thomthom
                                      last edited by

                                      πŸ‘

                                      Thomas Thomassen β€” SketchUp Monkey & Coding addict
                                      List of my plugins and link to the CookieWare fund

                                      1 Reply Last reply Reply Quote 0
                                      • mitcorbM Offline
                                        mitcorb
                                        last edited by

                                        Are you saying that each and every plugin is "polled" each time you wish to do something whether you "invoke" that/those plugins or not? If so, is that efficient? Keep in mind I don't know the terminology, and I certainly don't fully understand.

                                        I take the slow, deliberate approach in my aimless wandering.

                                        1 Reply Last reply Reply Quote 0
                                        • thomthomT Offline
                                          thomthom
                                          last edited by

                                          @mitcorb said:

                                          Are you saying that each and every plugin is "polled" each time you wish to do something whether you "invoke" that/those plugins or not? If so, is that efficient? Keep in mind I don't know the terminology, and I certainly don't fully understand.

                                          Not every plugin, but when a plugin want to add a context menu a function is run - and if the plugin tried to evaluate the whole selection or do any processor expensive calculations in this function it'll delay the context menu.

                                          Thomas Thomassen β€” SketchUp Monkey & Coding addict
                                          List of my plugins and link to the CookieWare fund

                                          1 Reply Last reply Reply Quote 0
                                          • mitcorbM Offline
                                            mitcorb
                                            last edited by

                                            Ok, that makes some sense, thanks. Evidently, the context menu is lower in priority?

                                            I take the slow, deliberate approach in my aimless wandering.

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

                                            Advertisement