sketchucation logo sketchucation
    • Login
    1. Home
    2. WhyDi
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 7
    • Posts 61
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Scrambler issue

      You know what? today we have made a decision founded on

      • Either our way of writing ruby script doesn't please SketchUp Scrambler
      • Or the scrambler is not suitable for us.

      Binary choice as any developer knows in its life and I'm inclined to think that the first one is likely to prove. My team doesn't like that but it's now the only way to go out this dead end. This may turn out as most of us have a strong MS background with c# or VB.net as I do. For who knows a bit about VB I like that 'redim preserve' and always works with OptionExplict and OptionStrict and OptionInfer. The compiler doesn't tolerate anything but nearly no error at runtime and intelliSense makes the remaining. This could lead to bad habits with ruby script - I never feel easy with its syntax and its way to auto-type variables as instance.

      But let's get back to the point. So some times ago a script developer asked us to integrate our group. I've just called him. He comes tomorrow with a clear purpose. His mission is to rewrite one of our file its own way. If his way succeeds - meaning the file can go through the scrambler and works - he integrates.
      Outcomes tomorrow

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Scrambler issue

      Unfortunately they all and each crash.
      under development we use 8 files encompassing roughly 50 classes, 500 functions, 7500 lines and 300k ruby only code out of of comment.
      Each of these scrambled file loaded separately - meaning the others loaded as .rb - ends up with the BugSplat
      After gathering them I got the same outcome
      No doubt there is something wrong somewhere but what and where ?
      I don't have time to read what a 'puts' can yield! running the scrambled script pauses about one second then close SU8 and finally shows the bug splat window. Nothing else than that. I'm never at hand to do anything!
      What may I do? nothing!
      the file with shortest (longest)line is 120. no html string into .rbs they are in the main module.rb

      here is one of these numerous lines we have. delivered as is!

      
      if (@keep_prj_skp_file_last != Mdl;;prj_skp_file_last) or
        (@keep_olt_user_filter != str_flt_cmp) or
        (@keep_olt_user_filter_layer != Mdl;;olt_user_filter_layer) or
        (@keep_fps_make != Mdl;;fps_make) or
        (@keep_anim_wait != Mdl;;anim_wait) or
        (@keep_dialog_collapse_at_runtime != @dialog_collapse_at_runtime) or
        (@keep_do_mode != Mdl;;do_mode) or
        (@keep_anim_restore_shot != Mdl;;anim_restore_shot) or
        (@keep_anim_save_shot != Mdl;;anim_save_shot) or
        (@keep_anim_save_model != Mdl;;anim_save_model) or
        (@keep_anim_restore_cam != Mdl;;anim_restore_cam) or
        (@keep_anim_save_cam != Mdl;;anim_save_cam) or
        (@keep_anim_restore_lay != Mdl;;anim_restore_lay)
          return true
      end
      
      

      What's wrong in such code?
      Remember that all works perfectly without scrambling, even the gathered file with LineFeed or Semicolon at each end of line. All that works.
      Is it worth to decrease line length under 256 chars? I have my doubts in such context

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Scrambler issue

      Hi all
      I also learnt here http://sketchucation.com/forums/viewtopic.php?t=39094 that FILE and LINE do not work with 2014 previous versions but none of these keywords in the script.

      Sketchup 8.0.16846 installed on another PC and test on both.
      Max line length is 1276 and reduced to 1000 gives BugSplat at start time. 750 then 500 the same and finally 250 with no change. BugSplat as ever. I give up decreasing! It doesn't make any sense.

      So I've reached the dead end!

      After hours and hours of labour to preserve backward compatibility down to SU8 and just before releasing our extension the baby blows out! we are now unable to reach our purpose. I will send the bug plast but the answer will come to late if any.

      From one hand the scrambler does not allow for 8 and 2013 version.
      On the other hand using C doesn't look enough secure. Although I need to know more on C extension I think it's very probably all about dlls which means call from the main script and some bad eval() has to appear at some point in the ruby script. This also means that anyone can 'puts' the return of the dll call into the sketchup console easily. No more sense than above!

      It's clear that without some ongoing miracle : Really the dead end.

      I almost forgot to thank you for your time
      Best Regards

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Scrambler issue

      Hi driven
      70 chars per line are very small but I'm making my best for reducing more an more. Fortunately we are speaking about Sketchup Scrambler not ruby. Using your way I think a might be able to decrease the numbers of characters per line down to 250 even 125 but no more.
      Result in some hours...
      Have a good day

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Scrambler issue

      I found information about line length here
      https://groups.google.com/forum/#!topic/sketchupruby/EV5KDgh6C0M
      where ChuckVali in the last post wrote :

      @unknownuser said:

      ...I noticed something else about the scrambler. If there are more than around 1000 characters in any line the resulting .rbs file can't be read by SU. Not a problem though: I just use shorter lines and concat them...

      the longest line in our script is over 1500 chars and I won't be able to cut these lines under 503 chars due to if statement with and and and and and so forth.
      Are 512 chars OK?

      in the same thread I read something that I don't clearly understand. Jim wrote :

      @unknownuser said:

      ...This may be related to a bug when scrambling Ruby files. If you are
      loading the .rbs from a SketchupExtension, the loaded files may be put
      under the SketchupExtension namespace. Maybe there are conflicting
      names if these other plugins are also loading scrambled files using
      SketchupExtension...

      Is it what we have just done ? I believe but who knows

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Scrambler issue

      I edited my previous post with result after reading your code. It works!

      Sketchup::require needs to appear before any module.

      I go ahead testing line length...

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Scrambler issue

      Your version is near mine. Does it come from Trimble or Google? Google I think.
      I use Sketchup::require, not Sketchup.require
      I haven't submitted the crash yet and don't think I do. It looks so strange!

      Edit...
      from your code i modified this way the main file

      
      require 'sketchup.rb'
      Sketchup;;require "C;/Users/uName/SketchUp/Ruby/testSC"
      module Cie_qwerty
      	module Ext_azerty
      		puts "------------------------------------------start"
      		print_test()
      		puts "------------------------------------------ready"
      
      	end
      end
      
      

      This time it works!
      Sketchup::require or Sketchup.require doesn't matter
      keepgoing tests...

      Here are the files not modified


      test.zip

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Scrambler issue

      No crash your way and no error shown. the script stops and nothing. The bug splat window appears when I run the full script of our extension.

      I modified the code but get the same result. what sub version of SU8 do you run?

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Scrambler issue

      Hi thomthom,
      I agree with you but really meet hard time with that scrambler. have a look. The following code crashes on SU8 8.0.14346 but works well on 2016.
      mainFile.rb

      
      require 'sketchup.rb'
      module Cie_qwerty
      	module Ext_azerty
      				
      		#load "C;/Users/uName/SketchUp/Ruby/test.rb"
      		Sketchup;;load "C;/Users/uName/SketchUp/Ruby/testSC"
      		
      		puts "------------------------------------------start"
      		print_test()
      		puts "------------------------------------------ready"
      
      	end
      end
      
      

      test.rb

      
      require 'sketchup'
      module Cie_qwerty
      	module Ext_azerty
      	
      		def self.print_test()
      			puts "print test"
      		end
      		
      	end
      end
      
      

      then wScrambler.exe test.rb
      then rename test.rbs testSC.rbs
      Sketchup::load or Sketchup::require doesn't matter
      testSC.rbs or testSC doesn't matter

      FIRST... load "C:/Users/NeW/SketchUp/Ruby/test.rb"
      load SU8 : run correctly
      load SU2016 : run correctly

      SECOND... Sketchup::load "C:/Users/NeW/SketchUp/Ruby/testSC"
      Unload then reload SU8: crash
      Unload then reload SU2016 : works well

      Ruby console results

      SU8 one single line and crash. nothing more

      
      ------------------------------------------start
      
      

      SU2016 all right

      
      ------------------------------------------start
      print test
      ------------------------------------------ready
      
      

      So what is wrong in my code?

      have a good day

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Scrambler issue

      You're right I'm talking about numbers of long lines, not a single line of five hundred thousand of chars. But why not? might be a way more to prevent code from being easily read.
      Scramble or encrypt the script is not the issue and I fully understand your recommendation. I may end up with shortening lines length but would have liked to know more about the process you describe. My understanding is c++ reads and unscramble my data file then sends the result -which is a ruby script- straightforward to Sketchup. Am I right?
      If so where can I find information about such process ? may you help me to go through?

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Scrambler issue

      Reading your post I feel better as I know there are alternatives even time consuming
      In fact there are so many long lines of code in our script which weights nearly 500k with comments I should add. We knew about some RBS scrambler limits but were far from what you have just told to me.
      On the other hand code obfuscation is not an option but a need.
      We take care to develop under Sketchup8 an test 2013, 14, 15, 16 make or pro version. From where we are now we can't go back. I am fully aware this could easily snowball but want to give a trial to any solution.
      Anyway I don't see any other way right now

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Scrambler issue

      Hi thomthom,
      Bad news! RBS scrambler won't serve our purpose because of line max limit.
      I have now to find out a solution 'by myself' to obfuscate our ruby script but really don't know where to start.

      any help appreciated

      have a good day

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • Scrambler issue

      Good Morning,
      We are meeting hard time with the scrambler. Ruby script works well and scrambled on recent Sketchup version as well but crashes or runs bug splat window on older version. We spent much and much time to preserve backward compatibility and now are unable to deliver good code on Sketchup old version due to that scrambler.

      Does anyone hold old version of the scrambler and send us?

      Best Regards

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Layer Transparency ?

      thanks for the reply but bad news!
      anyone knows any make up for that, even hard?
      i easily deal with ruby
      have a good day

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • Layer Transparency ?

      Hi!
      Is there any way to fade or shade or adjust layers transparency ?
      Something like

      for i 0.0 to 1.0
      my_layer.transparency = i

      Any help appreciated

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: I Need My VisMap!

      Hello MartinRinehart,
      I take the opportunity of your thread to thank you for the Edges to Rubies you link in your signature. I found out your tutorial some month ago and pages 15 and 16 made me on the track of animation. Just what I needed to jump into and now I am developing my own code I have just named a class the same of your 'Transformable' in your honour. It's quit different from your but the name makes me remember your excellent tutorial. A thousand of thanks once more.
      Have a good day

      Sorry for the sidetrack. Second time today!

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Mac users? I would like to know...

      You're right about the sidetrack but it's just a small piece of distraction in a flow of coding! and we are not so far from Sketchup as you may see on that website I made for fun. I am a woodworker hobbyist and never get money from woodworking as I spent all my spare time making small furniture for myself - not enough free time for the others!
      Besides the ruby code I am writing these days is a continuation of the pictures on the website that I would like to animate. May it turn to any plugin ? wait and see...
      Have a good late afternoon

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Mac users? I would like to know...

      As regard OS we are often background dependent. In the eighties I knew MacIntosh with its mouse for the first time but things led me to MSdos through an Amstrad that was the only computer with drawing abilities at that computing age of dinosaurs. So I knew all MS systems since MSdos 2.0 , 3, 4, 5, 6 up to 6.22 then Windows3, 95 and following which were a shame until XP. But I kept MS loyal mostly because of the ability to deal straightforwardly with the core of their OS. I knew Interrupt with assembly language and so forth. Never felt good with C all versions. I don't know why. What an interesting time! but we did so few in so much time!
      As a developer I was not really free to migrate from Ms to Mac as I have ever known one Mac user for about a (and even several) hundred of Ms users in professional world. May be one of these days I will give a trial to Osx. Who knows?

      Viewing your profile I learned you use Sketchup in woodworking. Hobby or professional ?

      @+

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Mac users? I would like to know...

      Hi Slbaumgartner,

      Right now I have no time to spend learning about virtual machine and Mac OS developing. Never mind! I would rather go for that potential plugin and an extra windows based exe. Anyway there will still be time to switch along the project evolution and there are too many unanswered questions about the project itself.

      Tell me. Why did you migrate from Windows to Mac. Fun or need ?

      Have a good day

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • RE: Mac users? I would like to know...

      Hi Slbaumgartner,

      Tanks for the information. You get right in the core of my issue with your three examples. I spent some time reading features about them and quickly found out VMWareFusion allows for the use of windows application the same you use Mac application, with copy/paste, drag/drop and so forth between both systems. So this means you can run Sketchup and any windows exe at the same time. Good news! even the last seems free of charge. I hope it holds the same abilities.

      It look like these examples are easy to install and use. Am I right?
      Does a majority of mac users with Sketchup run such virtual machine or just some of them ?

      Have a good day

      posted in Developers' Forum
      WhyDiW
      WhyDi
    • 1 / 1