sketchucation logo sketchucation
    • 登入
    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!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    Changes in 2015

    已排程 已置頂 已鎖定 已移動 Developers' Forum
    45 貼文 11 Posters 2.3k 瀏覽 11 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • S 離線
      slbaumgartner
      最後由 編輯

      @dan rathbun said:

      Bigger thumbnail = more loading time? (guessing)

      Seems unlikely to me unless it was programmed really badly. The thumbnail contains nothing that SketchUp needs for loading the file, so the loader should simply skip that part of the file with nearly zero impact on load time. Where a larger thumbnail would have an effect is on save or quit, when SU has to write the thumbnail. I think something else must be afoot, but at this point I have no clue what...

      Steve

      1 條回覆 最後回覆 回覆 引用 0
      • tt_suT 離線
        tt_su
        最後由 編輯

        @brighter3d said:

        Packing float value into two integers, and passing to double parameter function,
        seems no longer works in 64bit SU2015.

        passF = Win32API.new(mydll,"PassDouble",["L","L"],"V")

        packedF = [rubyFloat].pack("D").unpack("LL")
        passF.call(packedF[0],packedF[1])

        Any tips? 💭

        It's a bit vague - what exactly doesn't work of these calls? Do you see Ruby's packing methods returning different results?
        Is the DLL you are calling actually 64bit?
        Does the function you are calling actually use ints - or are you using some other type that might be different on 64bit OS?

        On a side note - the Win32API has been deprecated for a long time. It has many limitations and is easy to cause crashes with. The recommended now is using Fiddle.

        1 條回覆 最後回覆 回覆 引用 0
        • tt_suT 離線
          tt_su
          最後由 編輯

          @wbarnes05 said:

          I noticed the change regarding the Length class a few days ago in the API. What's weird is that the API states that the parent of Length is Object starting in SU 2015. That had me worried as it implies that mathematical operations will no longer work on an instance of Length. However everything continued to work ok in my plugin when running in SU 2015.

          I ran a few tests in 2015 and found the following:

          length = 4.to_l
          > 4"
          > length.is_a? Integer
          > false
          > length.is_a? Float
          > true
          > length.is_a? Length
          > true
          > length.class.superclass
          > Numeric
          > length.class.ancestors
          > [Length, Numeric, Comparable, Object, Kernel, BasicObject]
          

          It would appear then that the API is incorrect and should be changed to show that Numeric is the parent class.

          The API docs needs updating in general to make the hierarchy more clear. There are many inconsistencies. We have a big todo item to improve the whole developer site. Stay tuned.

          @wbarnes05 said:

          That had me worried as it implies that mathematical operations will no longer work on an instance of Length. However everything continued to work ok in my plugin when running in SU 2015.
          We had to pull some tricky shimming to prevent breaking stuff. I wasn't able to do a 100% compatibility, but I think we have a near 99% use case coverage. Main one is C Extensions doing low level type checks for Floats which used to work, but not any more.

          1 條回覆 最後回覆 回覆 引用 0
          • tt_suT 離線
            tt_su
            最後由 編輯

            @kaas said:

            @dan rathbun said:

            @kaas said:

            I just noticed in one of my plugins that loading a single small skp file (to use as a component definition) seems to take almost 1 second whereas the same code in SU 2014 loads the skp instantly.

            Bigger thumbnail = more loading time? (guessing)

            I can't imagine. The box.skp testfile I created was just a rectangle with an extrusion.

            Well, the simplicity of the model is one thing - but if out thumbnail generating code has become slower writing pixels then the model content doesn't matter...
            This is still on our todo list to investigate.

            1 條回覆 最後回覆 回覆 引用 0
            • K 離線
              kaas
              最後由 編輯

              @tt_su said:

              Well, the simplicity of the model is one thing - but if out thumbnail generating code has become slower writing pixels then the model content doesn't matter...
              This is still on our todo list to investigate.

              just to be sure...My concern is not about writing skp files but about loading them. I don't see why it should be thumbnail issue.

              1 條回覆 最後回覆 回覆 引用 0
              • D 離線
                driven
                最後由 編輯

                @kaas said:

                I just noticed in one of my plugins that loading a single small skp file (to use as a component definition) seems to take almost 1 second whereas the same code in SU 2014 loads the skp instantly.

                I ran a variation of your script in v13 and v15 on my mac...

                t = Time.now
                f = Sketchup.find_support_file('candle.skp', 'Components')
                d = Sketchup.active_model.definitions.load f
                puts (Time.now - t) 
                #  all in different sessions of SU
                # v13 => 0.146086 , 0.037117, 0.022029
                # v15 => 0.033036, 0.046043,  0.013811
                

                test skp, not complex...
                john

                learn from the mistakes of others, you may not live long enough to make them all yourself...

                1 條回覆 最後回覆 回覆 引用 0
                • Dan RathbunD 離線
                  Dan Rathbun
                  最後由 編輯

                  I was just guessing. The component browser DOES use the thumbnail if it is not set to display "List".

                  There used to be some time issues with thumbnails getting regenerated in the Component Browser.
                  Er.. or was that the Scene thumbnails ? It all blurs together.

                  I'm not here much anymore.

                  1 條回覆 最後回覆 回覆 引用 0
                  • B 離線
                    Brighter3D
                    最後由 編輯

                    @unknownuser said:

                    t's a bit vague - what exactly doesn't work of these calls? Do you see Ruby's packing methods returning different results?
                    Is the DLL you are calling actually 64bit?
                    Does the function you are calling actually use ints - or are you using some other type that might be different on 64bit OS?

                    Yes dll is 64bit, I was passing double value as a pair of two ints. On c++ side it was double parameter, and call was passF.call(packedF[0],packedF[1]) on ruby side.

                    @unknownuser said:

                    On a side note - the Win32API has been deprecated for a long time. It has many limitations and is easy to cause crashes with. The recommended now is using Fiddle.

                    That solves my problem, it does work now - thank you!
                    It is a pity that there is no fiddle on SU < 2014 (with old ruby),
                    and I need to use ancient Win32API.so method for backward compatibility.

                    1 條回覆 最後回覆 回覆 引用 0
                    • Dan RathbunD 離線
                      Dan Rathbun
                      最後由 編輯

                      You can use DL which replaced Win32API.

                      Link Preview Image
                      Releases · DanRathbun/sketchup-ruby186-stdlib-extension

                      Ruby 1.8.6 p287 Standard Library packaged as a SketchUp extension. - Releases · DanRathbun/sketchup-ruby186-stdlib-extension

                      favicon

                      GitHub (github.com)

                      I'm not here much anymore.

                      1 條回覆 最後回覆 回覆 引用 0
                      • B 離線
                        Brighter3D
                        最後由 編輯

                        @unknownuser said:

                        You can use DL which replaced Win32API.

                        I still try to support SU 6 and 7...

                        1 條回覆 最後回覆 回覆 引用 0
                        • Dan RathbunD 離線
                          Dan Rathbun
                          最後由 編輯

                          @brighter3d said:

                          I still try to support SU 6 and 7...

                          ❓

                          I don't.

                          Too many unfixed bugs, and they distro'd with Ruby 1.8.0 initial release, which is like 20 years old. (I wouldn't help anyone with 7 unless they'd replaced the Ruby DLL with a newer one, as I explained how to do in the "Ruby Resources" topic.)

                          Next year I'd say I will drop support for v8 and v2013, and be done with the old headaches that Ruby 1.8.x has, such as no unicode string support, etc.

                          I'm not here much anymore.

                          1 條回覆 最後回覆 回覆 引用 0
                          • B 離線
                            Brighter3D
                            最後由 編輯

                            Maybe you are right...
                            For people doing renderings 2015 is first professional version (thanks to 64bit and possibility to use whole memory).
                            From the other side v8 is last true free version (according to the license)...

                            Do you know any recent statistics on SU versions usage?

                            1 條回覆 最後回覆 回覆 引用 0
                            • Dan RathbunD 離線
                              Dan Rathbun
                              最後由 編輯

                              @brighter3d said:

                              Do you know any recent statistics on SU versions usage?

                              I've never heard Google or Trimble release any official numbers.

                              Some plugin authors have collected data on what versions are running their plugin(s) but it's not global.

                              Perhaps the SCF Plugin Store has data ?

                              I'm not here much anymore.

                              1 條回覆 最後回覆 回覆 引用 0
                              • thomthomT 離線
                                thomthom
                                最後由 編輯

                                @brighter3d said:

                                Do you know any recent statistics on SU versions usage?

                                SU6 and SU7 is very low. I wouldn't be too worried about trying to keep support for these versions in new releases. It's like trying to make a website for IE6 and 7 these days... 😉

                                There are some users still on SU8 - though it appear SU2013 users migrate faster. Not sure why that is. Maybe it's the Google => Trimble thing...

                                Personally I don't aim to support anything older than SU2014 any more - due to Ruby 2.0, standard lib and SU2014+ improvements. If my new releases will work on older it will be cause I didn't need to use the stdlib or any of the new SU2014+ features.

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

                                1 條回覆 最後回覆 回覆 引用 0
                                • K 離線
                                  kaas
                                  最後由 編輯

                                  @driven said:

                                  I ran a variation of your script in v13 and v15 on my mac...

                                  t = Time.now
                                  > f = Sketchup.find_support_file('candle.skp', 'Components')
                                  > d = Sketchup.active_model.definitions.load f
                                  > puts (Time.now - t) 
                                  > #  all in different sessions of SU
                                  > # v13 => 0.146086 , 0.037117, 0.022029
                                  > # v15 => 0.033036, 0.046043,  0.013811
                                  

                                  john

                                  Thanks for looking into it. I tried your code on win32 and it loads the skp instantly. Great...but, plugins aren't installed in a sub-directory of the SketchUp installation directory anymore. Isn't it bad practice to put resources for a plugin in SketchUps installation directory instead of together with the code in the plugin directory?

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • tt_suT 離線
                                    tt_su
                                    最後由 編輯

                                    DefinitionList.load Performance Tests:

                                    Test snippet:

                                    <span class="syntaxdefault">skp </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">find_support_file</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'Car Sedan.skp'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'Components/Components Sampler'</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">puts </span><span class="syntaxstring">"DefinitionList.load Timing Tests"<br /></span><span class="syntaxdefault">puts </span><span class="syntaxstring">"> SketchUp Version; #{Sketchup.version}"<br /></span><span class="syntaxdefault">total </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> 0.0<br />iterations </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> 10<br />iterations</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">times </span><span class="syntaxkeyword">{</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">|</span><span class="syntaxdefault">i</span><span class="syntaxkeyword">|<br /></span><span class="syntaxdefault">  GC</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">start<br />  start_time </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Time</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">now<br />  definition </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">definitions</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">load</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">skp</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  elapsed </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> Time</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">now </span><span class="syntaxkeyword">-</span><span class="syntaxdefault"> start_time<br />  total </span><span class="syntaxkeyword">+=</span><span class="syntaxdefault"> elapsed<br />  puts </span><span class="syntaxstring">"> #{elapsed}; #{elapsed}"<br /></span><span class="syntaxdefault">  Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">start_operation</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Remove Definition"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  definition</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">clear</span><span class="syntaxkeyword">!<br /></span><span class="syntaxdefault">  Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">commit_operation<br /></span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">puts </span><span class="syntaxstring">"> Average; #{total / iterations.to_f}"<br /></span><span class="syntaxcomment"># require File.join(ENV['HOME'] || ENV['HOMEPATH'], 'Desktop', 'definition_list_load_test.rb')<br />&nbsp;</span><span class="syntaxdefault"></span>
                                    
                                    DefinitionList.load Timing Tests
                                    > SketchUp Version; 15.0.9350
                                    > 0.023006; 0.023006
                                    > 0.037007; 0.037007
                                    > 0.036002; 0.036002
                                    > 0.034998; 0.034998
                                    > 0.035001; 0.035001
                                    > 0.035001; 0.035001
                                    > 0.036999; 0.036999
                                    > 0.035999; 0.035999
                                    > 0.035002; 0.035002
                                    > 0.035997; 0.035997
                                    > Average; 0.034501199999999996
                                    
                                    DefinitionList.load Timing Tests
                                    > SketchUp Version; 14.1.1282
                                    > 0.033001; 0.033001
                                    > 0.034001; 0.034001
                                    > 0.032002; 0.032002
                                    > 0.034003; 0.034003
                                    > 0.032001; 0.032001
                                    > 0.033003; 0.033003
                                    > 0.032002; 0.032002
                                    > 0.031001; 0.031001
                                    > 0.030007; 0.030007
                                    > 0.032006; 0.032006
                                    > Average; 0.032302700000000004
                                    
                                    DefinitionList.load Timing Tests
                                    > SketchUp Version; 13.0.4812
                                    > 0.038; 0.038
                                    > 0.033; 0.033
                                    > 0.033; 0.033
                                    > 0.03; 0.03
                                    > 0.03; 0.03
                                    > 0.03; 0.03
                                    > 0.03; 0.03
                                    > 0.03; 0.03
                                    > 0.03; 0.03
                                    > 0.03; 0.03
                                    > Average; 0.0314
                                    
                                    DefinitionList.load Timing Tests
                                    > SketchUp Version; 8.0.16846
                                    > 0.054; 0.054
                                    > 0.04; 0.04
                                    > 0.04; 0.04
                                    > 0.045; 0.045
                                    > 0.04; 0.04
                                    > 0.04; 0.04
                                    > 0.04; 0.04
                                    > 0.04; 0.04
                                    > 0.041; 0.041
                                    > 0.04; 0.04
                                    > Average; 0.042
                                    
                                    DefinitionList.load Timing Tests
                                    > SketchUp Version; 7.1.6860
                                    > 0.035; 0.035
                                    > 0.048; 0.048
                                    > 0.043; 0.043
                                    > 0.042; 0.042
                                    > 0.043; 0.043
                                    > 0.046; 0.046
                                    > 0.043; 0.043
                                    > 0.043; 0.043
                                    > 0.042; 0.042
                                    > 0.043; 0.043
                                    > Average; 0.0428
                                    

                                    I'm not seeing any performance regression - looks rather consistent on this end.. I'm not sure why you are seeing a difference on your system. ❓

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • jiminy-billy-bobJ 離線
                                      jiminy-billy-bob
                                      最後由 編輯

                                      @brighter3d said:

                                      Maybe you are right...
                                      For people doing renderings 2015 is first professional version (thanks to 64bit and possibility to use whole memory).
                                      From the other side v8 is last true free version (according to the license)...

                                      Do you know any recent statistics on SU versions usage?

                                      I have some data : http://thomashauchecorne.com/layers/analytics.php
                                      But it's only about Layers Panel users (around 500 unique daily users)

                                      25% off Skatter for SketchUcation Premium Members

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • K 離線
                                        kaas
                                        最後由 編輯

                                        @tt_su said:

                                        I'm not seeing any performance regression - looks rather consistent on this end.. I'm not sure why you are seeing a difference on your system. ❓

                                        Hi Thom, thanks for taking time to look at my code-problem.

                                        I don't see big differences as well if I load components from the SketchUp Components sub-folder (see my post, two posts above your post).

                                        Have you tried my original code (loading from root of C OR loading from the Sketchup plugins folder) and looked at the differences?

                                        I tested your code and here are the results:

                                        SketchUp Version: 15.0.9350
                                        0.06: 0.06
                                        0.04: 0.04
                                        0.05: 0.05
                                        0.04: 0.04
                                        0.040001: 0.040001
                                        0.04: 0.04
                                        0.05: 0.05
                                        0.04: 0.04
                                        0.04: 0.04
                                        0.04: 0.04
                                        Average: 0.0440001

                                        SketchUp Version: 14.1.1282
                                        0.02: 0.02
                                        0.02: 0.02
                                        0.02: 0.02
                                        0.02: 0.02
                                        0.02: 0.02
                                        0.02: 0.02
                                        0.02: 0.02
                                        0.02: 0.02
                                        0.02: 0.02
                                        0.02: 0.02
                                        Average: 0.019999999999999997

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • tt_suT 離線
                                          tt_su
                                          最後由 編輯

                                          I still don't see any difference. Do you have a sample model to share?

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • Dan RathbunD 離線
                                            Dan Rathbun
                                            最後由 編輯

                                            If a component has a classification assigned, the entire schema could be serialized into the skp file.

                                            Upon loading the schema is loaded into the active model, correct TT ?

                                            I'm not here much anymore.

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 3
                                            • 2 / 3
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement