• Login
sketchucation logo sketchucation
  • Login
🤑 30% Off | Artisan 2 on sale until April 30th Buy Now

[Plugin] TT_Lib²

Scheduled Pinned Locked Moved Plugins
310 Posts 66 Posters 393.9k Views
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.
  • T Offline
    TIG Moderator
    last edited by Dec 14, 2013, 4:58 PM

    @TT - your Lib appears in the native Extensions panel and the SketchUcation Extensions Manager.
    But it fails to display details in the latter - I suspect because you've named it with a superscript 2 - because if I rename it with a normal 2 it works with details etc !
    So that is probably causing subtle issues - perhaps in js ?

    So I know how to probably fix the issue - I'm testing it shortly...

    Watch for v2.5.0 out soon...

    TIG

    1 Reply Last reply Reply Quote 0
    • T Offline
      tt_su
      last edited by Dec 14, 2013, 5:02 PM

      Ah, an multi-byte character issue then.

      1 Reply Last reply Reply Quote 0
      • T Offline
        TIG Moderator
        last edited by Dec 14, 2013, 5:03 PM

        I now have it working with the superscript 2...

        TIG

        1 Reply Last reply Reply Quote 0
        • T Offline
          tt_su
          last edited by Dec 15, 2013, 8:31 AM

          Thanks TIG!

          That superscript 2 has caught many off guard.

          http://tmfassociates.com/blog/wp-content/uploads/2011/03/monty-python-spanish-inquisition.jpg

          "Nobody expects Unicode multi-byte characters!"

          1 Reply Last reply Reply Quote 0
          • T Offline
            TIG Moderator
            last edited by Dec 15, 2013, 10:27 AM

            Oddly the superscript 3 in your 'Cleanup' name works just fine.
            It's only seems to be the superscript 2 !
            But then even 178.chr fails too...

            I already knew that names including a ' or starting with '#' messed up in the ruby/js/callbacks...

            I have also now found that names ending in a <space> also mess up !

            But they are all trapped now.

            TIG

            1 Reply Last reply Reply Quote 0
            • T Offline
              tt_su
              last edited by Dec 15, 2013, 11:55 AM

              huh! That's very odd, as I'm sure that superscript 3 is in unicode as well... :s

              1 Reply Last reply Reply Quote 0
              • T Offline
                TIG Moderator
                last edited by Dec 15, 2013, 12:19 PM

                Tell me about it...
                😒
                The characters in Extension names that mess with ruby/js/callbacks in webdialogs when passing js-side RS joined [RS = String.fromCharCode(30)] arrays, that are then then split at RS [RS = 30.chr] ruby-side, to give the individual names, are:

                [pre:1yxha6nn]<space> at the end of the name

                at the start of the name

                ' [single-quote] anywhere in the name
                ² anywhere in the name[/pre:1yxha6nn]

                It doesn't matter if that is Unicode or ASCII 178.chr 😕
                Other superscripts etc like ³ do not seem to cause issues at all...

                I have a series of traps to stop issues now - these will be in an upcoming release [aka 2.5.0]...

                TIG

                1 Reply Last reply Reply Quote 0
                • O Offline
                  Oxer
                  last edited by Dec 15, 2013, 12:43 PM

                  In the end, you have found the problem of TT_Lib² in Extension Manager 👍

                  "The result is the end what is important is the process" by Oxer
                  [http://www.oxervision.blogspot.com/(http://www.oxervision.blogspot.com/)]

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    TIG Moderator
                    last edited by Dec 15, 2013, 1:05 PM

                    @oxer said:

                    In the end, you have found the problem of TT_Lib² in Extension Manager 👍

                    You can still manipulate that Lib [for now] in the native Extensions panel.
                    I'd always leave it 'enabled' anyway...
                    A new version of the SketchUcation Toolset, including the updated Extensions Manager and lots of new goodies, is in alpha-testing now - sliding into beta-tesing soon - and then v2.5.0 will be released - probably early in the new year ?
                    🤓

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      TIG Moderator
                      last edited by Dec 15, 2013, 3:12 PM

                      Now the bad news...

                      After further testing... I confirm that my fix for a superscript 2 in the Extension's name doesn't work with TT_Lib² after all... It was a spurious result...

                      It must be something to do with the way the file calls itself - almost unique amongst Extensions !
                      Then I noticed that Fredo's Lib uses a fake Extenson...

                      #Compatibility with EWH begin ; SketchupExtension.new "toto", "toto.rb" ; rescue ; end

                      That is all, and that gets past the EWH check and does NOT register an Extension ?
                      Although through other means there is an entry fro LibFredo6 ?? ...

                      So the fix seems to be in TT's hands.

                      Simply remove the current 'extension making code' and add in a 'fake file' like as shown above, and it works... there's no 'fake extension' confusing users in the Preferences OR the SCF Extensions Manager...

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        tt_su
                        last edited by Dec 15, 2013, 8:27 PM

                        That's odd. How is PluginStore determining if a plugin is enabled/disabled?

                        By the way, are you doing string manipulations? Passing a Ruby multibyte string, encoded in UTF-8, should work fine as long as the HTML is marked up in UTF-8 as well. JS handles UTF-8 by default I think as well. So simply passing strings back and forth should not be a problem.

                        1 Reply Last reply Reply Quote 0
                        • T Offline
                          TIG Moderator
                          last edited by Dec 15, 2013, 8:39 PM

                          HTML is UTF-8 - there is no issue the superscript 2 was a dead end...

                          The Extensions Manager uses the obvious :

                          ` Sketchup.extensions.each{|ex|
                          next unless ex.respond_to?(:registered?) && ex.registered?
                          ...
                          if ex.loaded?
                          ...
                          else ### unloaded
                          ...
                          end

                          }`

                          etc

                          Fredo's Lib uses the spurious file ans has no issues.
                          Calling itself seems to break it.
                          I substituted the equivalent of Fredo's one liner in your 'loader, it doesn't register an extension BUT it does still let the Lib be used...

                          TIG

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            thomthom
                            last edited by Dec 18, 2013, 9:18 PM

                            Updated TT_Lib 2.9.5 will fix the issue.
                            Download from PluginStore or BitBucket:
                            http://sketchucation.com/resources/pluginstore?pln=TT_Lib
                            https://bitbucket.org/thomthom/tt-library-2/downloads

                            Submitted to moderation on Extension Warehouse.

                            This should address 3D Text Editor's issue with IE11 and hopefully appear correct to PluginStore.

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

                            1 Reply Last reply Reply Quote 0
                            • O Offline
                              Oxer
                              last edited by Dec 19, 2013, 3:00 AM

                              Thanks Thom for fix the problem!! 👍

                              "The result is the end what is important is the process" by Oxer
                              [http://www.oxervision.blogspot.com/(http://www.oxervision.blogspot.com/)]

                              1 Reply Last reply Reply Quote 0
                              • T Offline
                                TIG Moderator
                                last edited by Dec 20, 2013, 11:12 AM

                                The update does fix the 3d text font list problem...

                                BUT...

                                On PC and MAC I now get this issue whenever SketchUp starts
                                @unknownuser said:

                                Error Loading File C:/Program Files/SketchUp/SketchUp 2013/Plugins/TT_Lib2/core.rb
                                uninitialized constant TT::System
                                Error Loading File TT_Lib2.rb
                                uninitialized constant TT::System
                                One step forward one back.

                                Also you have not fixed the issue of a 'mock Extension' like your Lib calling its own file, which breaks the listing in the SketchUcation 'Extensions Manager' dialog, where it always appears disabled, even though it is enabled.
                                As I explained before... Fredo gets around it by loading a non-existent 'toto.rb' file in a begin...rescue, and NOT registering it at all, which means an spurious Extension is not listed - so it should not appear in the Extensions list ?
                                You have now stopped it calling itself, BUT now load [and register] 'core.rb', which exists in the Lib's folder, but that now creates errors too... why not put it in a 'begin...rescue' block and refer it to a file you DON'T have in your TT_Lib2 folder - like 'foobar.rb' - and do NOT register it, then no Extension is made and no one is confused at all...
                                This edited code works for me

                                ### EXTENSION ### ------------------------------------------------------------
                                  
                                  unless file_loaded?( __FILE__ )
                                    # This library is still loaded by plugins because they require
                                    # 'TT_Lib2/core.rb' directly. 
                                	# Disabling the library via the extension manager 
                                	# will have no effect on the dependant extensions.
                                    #
                                    # The purpose of this file is solely to make it compatible with the
                                    # Extension Warehouse policies.
                                    file_loaded( __FILE__ )
                                	begin
                                		ex = SketchupExtension.new( PLUGIN_NAME, 'TT_Lib2/foobar.rb' )
                                		#ex.description = 'Library of shared functions used by other extensions.'
                                		#ex.version     = PLUGIN_VERSION
                                		#ex.copyright   = 'Thomas Thomassen © 2010-2013'
                                		#ex.creator     = 'Thomas Thomassen (thomas@thomthom.net)'
                                		#Sketchup.register_extension( ex, true )
                                	rescue
                                	end
                                  end
                                

                                the Lib is loaded by other tools, it is NOT made into an Extension, so there is NO confusion at all... 😕

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • T Offline
                                  tt_su
                                  last edited by Dec 20, 2013, 11:14 AM

                                  @tig said:

                                  Also you have not fixed the issue of a 'mock Extension' like your Lib calling its own file, which breaks the listing in the SketchUcation 'Extensions Manager' dialog, where it always appears disabled, even though it is enabled.

                                  Huh? I changed to to load core.rb ...

                                  I didn't want to use a dummy file as I wouldn't trust that to not display an error.

                                  1 Reply Last reply Reply Quote 0
                                  • T Offline
                                    thomthom
                                    last edited by Dec 20, 2013, 11:22 AM

                                    @tig said:

                                    You have now stopped it calling itself, BUT now load [and register] 'core.rb', which exists in the Lib's folder, but that now creates errors too... why not put it in a 'begin...rescue' block and refer it to a file you DON'T have in your TT_Lib2 folder - like 'foobar.rb' - and do NOT register it, then no Extension is made and no one is confused at all...

                                    The real fix here is to figure out where the error is coming from. I don't want to patch the symptom, I want to fix the cause.

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

                                    1 Reply Last reply Reply Quote 0
                                    • T Offline
                                      thomthom
                                      last edited by Dec 20, 2013, 11:25 AM

                                      I'm not able to reproduce the TT::System loading error...

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

                                      1 Reply Last reply Reply Quote 0
                                      • T Offline
                                        TIG Moderator
                                        last edited by Dec 20, 2013, 4:47 PM

                                        I get it on PC & MAC v2013...
                                        😕
                                        Unless I re-jig you code to use the nonexistent foobar.rb and NOT register the extension anyway...
                                        Then it's all OK.
                                        😒

                                        TIG

                                        1 Reply Last reply Reply Quote 0
                                        • T Offline
                                          tt_su
                                          last edited by Dec 20, 2013, 7:35 PM

                                          Does it happen with a clean Plugins folder?

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 11
                                          • 12
                                          • 13
                                          • 14
                                          • 15
                                          • 16
                                          • 13 / 16
                                          13 / 16
                                          • First post
                                            246/310
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement