sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    .rbs files not loading at all.

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 934 Views 3 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.
    • M Offline
      mocathe1st
      last edited by

      Hi all,

      I'm currently trying to encrypt my sketchup plugin using the scrambler program, which I got through Google. I can encrypt files in the plugins folder with no problems and the resulting .rbs file work. The problem is, though, that most of the ruby code for my plugin is within a subfolder in the plugins directoy e.g "plugins/classes" and I have a main ruby file in the plugins folder that calls (requires) the files in the subfolder. When I encrypt the code in the subfolder the plugin will not work. I do not even get messages saying that files cannot be found, it just doesn't work. If I only encrypt the main ruby file in the plugins directory and leave the rest then it works fine.... 😢

      I was just wondering if I'm missing something in using Scrambler.exe and if someone could put me on the right track. I've spent most of the afternoon looking on the net for a solution, but documentation for this seems to be kind of scarce. I've tried this in both the Pro and free versions of Sketchup and get the same results in both.

      Any help would be appreciated,
      Thanks.

      1 Reply Last reply Reply Quote 0
      • T Offline
        todd burch
        last edited by

        Try this:

        Sketchup.load("myscript.rbs")
        Then do the require.

        Todd

        1 Reply Last reply Reply Quote 0
        • T Offline
          todd burch
          last edited by

          I guessed wrong. There is a Sketchup.require. Use it.

          Todd

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

            😄
            I've finally got it working.
            I was using the normal Ruby require and including the .rb file extension but, what is actually required is the Sketchup require and not including any file extension e.g:

            Sketchup::require 'directory/filename'

            instead of:
            require 'directory/filename.rb'

            With the correct require the scrambled version of the plugin works perfectly with both free and Pro Sketchup. I spent ages trying to figure out why the Scrambler wasn't working. Hopefully this post will save some time for anyone else using it. Google really should release some better docs though....

            1 Reply Last reply Reply Quote 0
            • A Offline
              azuby
              last edited by

              Don't know, whether the "old" standard Ruby "require" is really needed for all scripts. If you do not need it at all, WHAT is Sketchup.require doing? Does it use the "old" "require"? If not you can think about replacing it dynamically:

              module Kernel
                def require *args
                  Sketchup.require *args
                end
              end
              

              (not tested, maybe the asterisks are on wrong place)
              After that you can use the "old" require and get the behaviour of the Sketchup "require"

              azuby

              *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

              Bad English? PM me, correct me. :smile:**

              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