sketchucation logo sketchucation
    • 登入
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    [Plugin] Very fast texture writer

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

      I'm having a few issues with this plugin when importing image libraries:

      1. The tiling settings for the images are coming in with the x and y scales reversed (the aspect ratio is reversed from the actual image).

      2. I would like to retain any "-" and "_" characters in the image name (when converted to the SKM name).

      Best,
      Jason.

      I create video tutorial series about several 2D & 3D graphics programs.

      1 條回覆 最後回覆 回覆 引用 0
      • TIGT 離線
        TIG Moderator
        最後由 編輯

        Around lines #90 and #129 it reads
        mat.texture.size = [twidth,theight]
        to swap the height/width values change it to read
        mat.texture.size = [theight, twidth]
        BUT the width SHOULD come first in the .size=[] method as it is originally coded... so I am perplexed... 😕

        Around line #59 it reads
        filename = filename.delete('^A-Za-z0-9')
        to keep the - and _ in file-names, change it to read...
        filename.gsub!(/[^A-Za-z0-9_-]/, '')
        This WILL work...

        TIG

        1 條回覆 最後回覆 回覆 引用 0
        • jason_marantoJ 離線
          jason_maranto
          最後由 編輯

          Thanks TIG, I did my own hacks to the Ruby to make it usable for right now, but your code is much nicer so I will change it out 😄

          For the record the changes I made were at lines 344 and 368 -- but I only barely know my way around a Ruby file 👊

          Best,
          Jason.

          I create video tutorial series about several 2D & 3D graphics programs.

          1 條回覆 最後回覆 回覆 引用 0
          • andybotA 離線
            andybot
            最後由 編輯

            This is a fantastic help. Thank you!

            http://charlottesvillearchitecturalrendering.com/

            1 條回覆 最後回覆 回覆 引用 0
            • unclebimU 離線
              unclebim
              最後由 編輯

              Is there any chance of running the plugin in SU 2014?

              1 條回覆 最後回覆 回覆 引用 0
              • TIGT 離線
                TIG Moderator
                最後由 編輯

                The original fast_tw.rb works in v2014, but is Ruby Console run.
                This attached version is the same as the one in the PluginStore's RBZ.
                fast_tw.rb
                The Depot's fast_tw_3.rb is menu driven and has several extra options.
                It is compatible with v2014.
                This has some issues, which my post a little earlier explained how to fix.
                This attached version has those issues fixed.
                I have incremented it to fast_tw_3a.rb
                fast_tw_3a.rb
                In an earlier post in this thread another version of the RB was attached [confusingly with the same version suffix].
                This is also menu driven and includes several additional options.
                BUT this one is full of coding issues and it is NOT compatible with v2014.
                This attached version has those issues fixed and is now v2014 compatible.
                I have renamed it fast_tw_4.rb for the avoidance of doubt.
                fast_tw_4.rb
                Because of the non-standard RB naming conventions you should ensure any older "fast_tw" RB files are removed...
                I have swapped the texture's height,width in the ..size=[], which [oddly] seems to work - if you have issues with that try editing the v3a/v4 RBs and find every ..size=[] and swap them back to be [width,height] ??

                TIG

                1 條回覆 最後回覆 回覆 引用 0
                • unclebimU 離線
                  unclebim
                  最後由 編輯

                  Thank you very much, TIG!

                  1 條回覆 最後回覆 回覆 引用 0
                  • A 離線
                    AcesHigh
                    最後由 編輯

                    Can I make an improvement request? It would be nice if you could choose if you want the texture exported with the MATERIAL name (as it happens now) or the original texture name, if available.

                    1 條回覆 最後回覆 回覆 引用 0
                    • S 離線
                      samyell77
                      最後由 編輯

                      Hi,
                      Great plugin - thanks! Always amazed by the fantastic plugins that you can find on sketchucation! Thank you...!
                      I like AcesHigh's point about material names - would be a handy feature but even without this plugin will come in very handy.
                      Sam

                      SU Pro 2016
                      Dell Precision M4800
                      PC Windows 10
                      Intel Core i7-4900MQ @ 2.80ghz
                      Nvidia Quadro K2100M
                      16gb RAM

                      1 條回覆 最後回覆 回覆 引用 0
                      • Lemoyne ArchitectL 離線
                        Lemoyne Architect
                        最後由 編輯

                        @aceshigh said:

                        Can I make an improvement request? It would be nice if you could choose if you want the texture exported with the MATERIAL name (as it happens now) or the original texture name, if available.

                        I’m trying to use fast_tw on OSX 10.9.5 and SU 2015 and I’m getting file names such as "fa3c172f4fc034eb6af0489c89b26612.jpg” for everything. From the comment above, am I understanding correctly that it SHOULD save the files with the MATERIAL name you’d see in SU?

                        I’ve tried using both fast_tw_3a.rb and fast_tw_4.rb with the same results.

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

                          did you the one in the PluginStore's that's a RBZ?

                          that error in the name looks like it's a Ruby Depot version...

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

                          1 條回覆 最後回覆 回覆 引用 0
                          • Lemoyne ArchitectL 離線
                            Lemoyne Architect
                            最後由 編輯

                            I tried 3a and 4 from TIG’s post:

                            @tig said:

                            The original fast_tw.rb works in v2014, but is Ruby Console run.
                            This attached version is the same as the one in the PluginStore's RBZ.
                            [attachment=2:3ie6v21l]<!-- ia2 -->fast_tw.rb<!-- ia2 -->[/attachment:3ie6v21l]
                            The Depot's fast_tw_3.rb is menu driven and has several extra options.
                            It is compatible with v2014.
                            This has some issues, which my post a little earlier explained how to fix.
                            This attached version has those issues fixed.
                            I have incremented it to fast_tw_3a.rb
                            [attachment=1:3ie6v21l]<!-- ia1 -->fast_tw_3a.rb<!-- ia1 -->[/attachment:3ie6v21l]
                            In an earlier post in this thread another version of the RB was attached [confusingly with the same version suffix].
                            This is also menu driven and includes several additional options.
                            BUT this one is full of coding issues and it is NOT compatible with v2014.
                            This attached version has those issues fixed and is now v2014 compatible.
                            I have renamed it fast_tw_4.rb for the avoidance of doubt.
                            [attachment=0:3ie6v21l]<!-- ia0 -->fast_tw_4.rb<!-- ia0 -->[/attachment:3ie6v21l]

                            1 條回覆 最後回覆 回覆 引用 0
                            • Lemoyne ArchitectL 離線
                              Lemoyne Architect
                              最後由 編輯

                              Note these lines from above:

                              @tig said:

                              The original fast_tw.rb works in v2014, but is Ruby Console run.
                              This attached version is the same as the one in the PluginStore's RBZ.

                              So the one in the PlugInStore is the first generation - and runs in the Ruby Console. The 3a and 4 versions are updates that run in menus.

                              But I still get the same results in any of them - that I get alphanumeric strings for file names instead of the material names that were in the SKP file.

                              1 條回覆 最後回覆 回覆 引用 0
                              • Lemoyne ArchitectL 離線
                                Lemoyne Architect
                                最後由 編輯

                                Ok, I finally went in and made a copy of one of the SKM files, renamed it to .ZIP, opened it, and looked at the files. The JPG file in there has the alphanumeric filename I’m encountering. Doing the same with some other materials gets a filename based on the material name.

                                So, in this case, the materials I’m trying to work with just have random alphanumeric filenames for the JPGs they originally created the materials from - so that is all that fast_tw is able to extract. It’s a fault of the materials I’m working with and nothing to do with fast_tw.

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

                                  @lemoyne architect said:

                                  ..The JPG file in there has the alphanumeric filename I’m encountering. the same with some other materials gets a filename based on the material name...

                                  glad you resolved it, but I'm now curious did the name show as that in the material browser?

                                  john

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

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • Lemoyne ArchitectL 離線
                                    Lemoyne Architect
                                    最後由 編輯

                                    No, that was what was confusing me. I had downloaded a model from the 3DWarehouse, but wanted to modify the materials being used. There were enough that I was looking for an easy way to strip them out rather than right clicking on each and every material and editing them individually - hence doing a search and finding fast_tw.

                                    Playing around with fast_tw and other materials, most of the time someone names the JPG the same name as the material they create. In this case the materials were things like “Material001, Material002, Material003…” while the JPGs were named “4IASae2uulg1, NX054xYNCb63, QtIJ9RU2U1Mj…”

                                    To me, it would seem that would make it very difficult to keep things organized during the creation of the materials, but some people seem to just make things more difficult than they need to be.

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

                                      ahhh... Material001/2, etc and or <auto_1/2> etc... are name given when SU finds an 'unknown' material in an import or from the eyedropper...

                                      that looks like it uses the materials unique id for the jpg name...

                                      I think fast_tw could be tweaked to re-name the jpg and mat at the same time...

                                      john

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

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • C 離線
                                        Craig2014
                                        最後由 編輯

                                        Hi

                                        Does this work in SU2016?

                                        I cant see it anywhere after install, although the ruby script "fast_tw +" works in extracting all but 4 out of maybe 15 materials in my sample model.

                                        Is there an icon for this or menu shortcut in SU16 or is it only usable by Ruby?

                                        Thanks

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • TIGT 離線
                                          TIG Moderator
                                          最後由 編輯

                                          It's not an extension.
                                          It's some code to run from the Ruby Console.
                                          It's pretty old...
                                          It will work in v2016.
                                          You can add the menu item or toolbar yourself...
                                          There are many simple plugins from which you can crib the method[s]...

                                          Depending what you want to do with your texture images, v2016 also now has this additional thumbnail writing method [max resolution 128px] - this also includes non-textured materials.

                                          model=Sketchup.active_model
                                          folder=UI.select_directory(
                                            title; "Select Folder for Thumbnails",
                                            directory; File.dirname(model.path)
                                          )
                                          if folder
                                            model.materials.each{|material|
                                              thumbnail = File.join(folder, "#{material.display_name}.png")
                                              material.write_thumbnail(thumbnail, 128)
                                            }
                                          end
                                          

                                          TIG

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

                                            @TIG, is there really a size limit on a PC...

                                            I write them out at 512px in one of my plugins for mac...

                                            john

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

                                            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