sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] Texture Resizer (1.5.6) — updated 15.05.2013

    Scheduled Pinned Locked Moved Plugins
    104 Posts 35 Posters 96.9k Views 35 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.
    • thomthomT Offline
      thomthom
      last edited by

      Just tried this - wanted to ensure texture where no larger than a given size.

      I set percentage to 100% as I wanted to keep textures smaller at their original size - then I enabled Limit texture size.

      ResizeError.png

      I got this error:
      Error #<NoMethodError:undefined methodempty?' for nil:NilClass.>`

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

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        Strange that there isn't any backtrace...

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

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

          I found the bug and fixed it. The backtraces became lost because of a rescue Exception.

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            Thanks for that. 😄

            Though ... I broke it again... 😕

            
            Error #<NoMethodError;undefined method `entities' for #<Sketchup;;ComponentInstance;0x773ec0c>.>
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;253;in `initialize'
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;258;in `call'
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;258;in `initialize'
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;258;in `each'
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;258;in `initialize'
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;211;in `new'
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;211;in `process'
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;188;in `options_dialog'
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;197;in `call'
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;197;in `show_modal'
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;197;in `options_dialog'
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;114;in `run'
            C;/Program Files (x86)/Google/Google SketchUp 8/Plugins/ae_TextureResizer/TextureResizer.rb;61
            
            

            It appear you're trying to use ComponentInstance.entities which doesn't exist in the API - all though a few plugins add this method to the ruby classes.

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

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              Changed line 253 to:
              definition.entities.each{|e| block.call(e, s*scale)}

              Working! 😄

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

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                Here's the list of material in a model where I needed to size down the textures:

                Before:

                
                === TEXTURE MATERIALS BY SIZE ===
                Material4
                  Size; 4000x4000 pixels
                  Size; 45.78 MB estimated uncompressed RGB
                  Size; 61.04 MB estimated uncompressed RGBA
                  File; Material4_extractedTex6580.jpg
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                Material13
                  Size; 4000x4000 pixels
                  Size; 45.78 MB estimated uncompressed RGB
                  Size; 61.04 MB estimated uncompressed RGBA
                  File; Material13_extractedTex8210.jpg
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                Material3
                  Size; 2255x1782 pixels
                  Size; 11.50 MB estimated uncompressed RGB
                  Size; 15.33 MB estimated uncompressed RGBA
                  File; Material3_extractedTex1993.jpg
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                Material14
                  Size; 2255x1782 pixels
                  Size; 11.50 MB estimated uncompressed RGB
                  Size; 15.33 MB estimated uncompressed RGBA
                  File; Material14_extractedTex3247.jpg
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                Material1
                  Size; 2048x1536 pixels
                  Size; 9.00 MB estimated uncompressed RGB
                  Size; 12.00 MB estimated uncompressed RGBA
                  File; Material1_extractedTex5040.jpg
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                black3
                  Size; 2814x850 pixels
                  Size; 6.84 MB estimated uncompressed RGB
                  Size; 9.12 MB estimated uncompressed RGBA
                  File; glass.psd
                  Path; E;\LIBRARY\DIGITAL LIBRARY\MORQ LIBRARY TEXTURES\Emiliano
                black1
                  Size; 2814x850 pixels
                  Size; 6.84 MB estimated uncompressed RGB
                  Size; 9.12 MB estimated uncompressed RGBA
                  File; glass.psd
                  Path; E;\LIBRARY\DIGITAL LIBRARY\MORQ LIBRARY TEXTURES\Emiliano
                treverk1
                  Size; 1500x1500 pixels
                  Size; 6.44 MB estimated uncompressed RGB
                  Size; 8.58 MB estimated uncompressed RGBA
                  File; treverk1_extractedTex7432.jpg
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                treverk2
                  Size; 1500x1500 pixels
                  Size; 6.44 MB estimated uncompressed RGB
                  Size; 8.58 MB estimated uncompressed RGBA
                  File; treverk2_extractedTex1239.jpg
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                Material15
                  Size; 1416x1416 pixels
                  Size; 5.74 MB estimated uncompressed RGB
                  Size; 7.65 MB estimated uncompressed RGBA
                  File; Material15_extractedTex9798.png
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                Material8
                  Size; 1417x1408 pixels
                  Size; 5.71 MB estimated uncompressed RGB
                  Size; 7.61 MB estimated uncompressed RGBA
                  File; Material8_extractedTex7662.tif
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                Material16
                  Size; 1417x1408 pixels
                  Size; 5.71 MB estimated uncompressed RGB
                  Size; 7.61 MB estimated uncompressed RGBA
                  File; Material16_extractedTex62.tif
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                Material5
                  Size; 1000x975 pixels
                  Size; 2.79 MB estimated uncompressed RGB
                  Size; 3.72 MB estimated uncompressed RGBA
                  File; Material5_extractedTex2763.jpg
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                Material30
                  Size; 1000x975 pixels
                  Size; 2.79 MB estimated uncompressed RGB
                  Size; 3.72 MB estimated uncompressed RGBA
                  File; Material30_extractedTex5676.jpg
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                ---
                
                

                Then I ran the script, got some messages:

                
                black1; could not write file C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480/glass.psd
                black3; could not write file C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480/glass.psd
                
                

                I assume PDS files are not supported?

                After:

                
                === TEXTURE MATERIALS BY SIZE ===
                black3
                  Size; 2814x850 pixels
                  Size; 6.84 MB estimated uncompressed RGB
                  Size; 9.12 MB estimated uncompressed RGBA
                  File; glass.psd
                  Path; E;\LIBRARY\DIGITAL LIBRARY\MORQ LIBRARY TEXTURES\Emiliano
                black1
                  Size; 2814x850 pixels
                  Size; 6.84 MB estimated uncompressed RGB
                  Size; 9.12 MB estimated uncompressed RGBA
                  File; glass.psd
                  Path; E;\LIBRARY\DIGITAL LIBRARY\MORQ LIBRARY TEXTURES\Emiliano
                Material15
                  Size; 1416x1416 pixels
                  Size; 5.74 MB estimated uncompressed RGB
                  Size; 7.65 MB estimated uncompressed RGBA
                  File; Material15_extractedTex9798.png
                  Path; C;/Users/ktn/AppData/Local/Temp/VfSTextureCache
                treverk1
                  Size; 512x512 pixels
                  Size; 768.00 KB estimated uncompressed RGB
                  Size; 1.00 MB estimated uncompressed RGBA
                  File; treverk1_extractedTex7432.jpg
                  Path; C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480
                Material4
                  Size; 512x512 pixels
                  Size; 768.00 KB estimated uncompressed RGB
                  Size; 1.00 MB estimated uncompressed RGBA
                  File; Material4_extractedTex6580.jpg
                  Path; C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480
                treverk2
                  Size; 512x512 pixels
                  Size; 768.00 KB estimated uncompressed RGB
                  Size; 1.00 MB estimated uncompressed RGBA
                  File; treverk2_extractedTex1239.jpg
                  Path; C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480
                Material13
                  Size; 512x512 pixels
                  Size; 768.00 KB estimated uncompressed RGB
                  Size; 1.00 MB estimated uncompressed RGBA
                  File; Material13_extractedTex8210.jpg
                  Path; C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480
                Material16
                  Size; 512x508 pixels
                  Size; 762.00 KB estimated uncompressed RGB
                  Size; 1016.00 KB estimated uncompressed RGBA
                  File; Material16_extractedTex62.tif
                  Path; C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480
                Material8
                  Size; 512x508 pixels
                  Size; 762.00 KB estimated uncompressed RGB
                  Size; 1016.00 KB estimated uncompressed RGBA
                  File; Material8_extractedTex7662.tif
                  Path; C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480
                Material5
                  Size; 512x499 pixels
                  Size; 748.50 KB estimated uncompressed RGB
                  Size; 998.00 KB estimated uncompressed RGBA
                  File; Material5_extractedTex2763.jpg
                  Path; C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480
                Material30
                  Size; 512x499 pixels
                  Size; 748.50 KB estimated uncompressed RGB
                  Size; 998.00 KB estimated uncompressed RGBA
                  File; Material30_extractedTex5676.jpg
                  Path; C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480
                Material3
                  Size; 512x404 pixels
                  Size; 606.00 KB estimated uncompressed RGB
                  Size; 808.00 KB estimated uncompressed RGBA
                  File; Material3_extractedTex1993.jpg
                  Path; C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480
                Material14
                  Size; 512x404 pixels
                  Size; 606.00 KB estimated uncompressed RGB
                  Size; 808.00 KB estimated uncompressed RGBA
                  File; Material14_extractedTex3247.jpg
                  Path; C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480
                Material1
                  Size; 512x384 pixels
                  Size; 576.00 KB estimated uncompressed RGB
                  Size; 768.00 KB estimated uncompressed RGBA
                  File; Material1_extractedTex5040.jpg
                  Path; C;/Users/thm.ARC/AppData/Local/Temp/skp_textureresizer61480
                ---
                
                

                Notice Material15 which is a PNG still is larger than 512px. Why is that? There was no messages about this file.

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

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

                  It seems SketchUp's texture writer does not write psd files. In that case, I'll probably force a default extension.

                  I have no idea what could cause to skip Material15. Is it reproducible? Can you send me a file with that material and its geometry (and group nesting...).

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    It's 8MB (after removing the two PSD textures)
                    PM me your email address and I'll send it to you.

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

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

                      I think I have fixed it now.

                      Also the texture writer can export PSDs (I have no idea why these failed), but it can't convert psd into other formats by setting a different file extension.

                      1 Reply Last reply Reply Quote 0
                      • thomthomT Offline
                        thomthom
                        last edited by

                        @aerilius said:

                        but it can't convert psd into other formats by setting a different file extension.

                        Does the texture resizer change the format?

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

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

                          Here not.
                          But the underlaying ImageMagick.rb has the option to (temporarily) change lossy formats into lossless bmp. I use that in another plugin, mainly because bmps process much faster.

                          1 Reply Last reply Reply Quote 0
                          • OxerO Offline
                            Oxer
                            last edited by

                            Hi,
                            I have installed the last version of the plugin (1.4.3 for Mac OSX) and when i run SU it appears a Console Error:
                            Console Error.png

                            I work on OSX 10.8.2, SU 8 Pro

                            "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
                            • A Offline
                              Aerilius
                              last edited by

                              I fixed it (1.4.4). Sorry, it was a merging mistake.

                              1 Reply Last reply Reply Quote 0
                              • OxerO Offline
                                Oxer
                                last edited by

                                I have installed the 1.4.4 version for Mac OSX and when I call to the plugin the boxes input are empty, I select Percentage, I introduce 50%, after I push Apply button then it appears this Error in Console Ruby:
                                Error Ruby Console.png
                                I have translated the plugin to spanish language but the plugin window's is in English.
                                Spanish Language for Texture Resizer

                                Mac OSX 10.8.2, SU Pro 8

                                "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
                                • A Offline
                                  Aerilius
                                  last edited by

                                  Hi,
                                  I think I have now found the issue. Can you try to download it again?
                                  And many thanks for the translation!!!

                                  [I thought I had posted this reply yesterday, I don't know how it got lost.]

                                  1 Reply Last reply Reply Quote 0
                                  • OxerO Offline
                                    Oxer
                                    last edited by

                                    I have reinstalled the 1.4.4 version and the plugin runs fine (the translation works ok), but when i push Apply button it appears the icon Processing... and in the Ruby console this message:
                                    Error Ruby Console.png
                                    I have seen a skp_textureresizer94750 folder in this path /private/var/folders/2y/lg9fyd494rddw7s_xr5zz2yr0000gn/T/skp_textureresizer94750 but only It contains one image.
                                    I hope you can help me, if you need more info, tell me it.
                                    Mac OSX 10.8.2, Sketchup 8 Pro

                                    Happy New Year!! 😄

                                    New Spanish Language file.
                                    TextureResizer_ES.strings.zip

                                    "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
                                    • A Offline
                                      Aerilius
                                      last edited by

                                      I published the new version 1.4.5

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

                                        Small update (1.4.7):

                                        • added icon
                                        1 Reply Last reply Reply Quote 0
                                        • OxerO Offline
                                          Oxer
                                          last edited by

                                          I can't see the icon in Mac OSX 10.8.2, the plugin (1.4.7) works fine only the icon problem. Non Ruby console Error.

                                          "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
                                          • A Offline
                                            Aerilius
                                            last edited by

                                            Menus don't have icons. The plugin doesn't include a (one button) toolbar, but an icon is the pre-condition for any future toolbars 😉

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 4 / 6
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement