[Plugin] Texture Resizer (1.5.6) — updated 15.05.2013
-
@driven said:
@unknownuser said:
Also, having to select all the textures opens me to the distinct possibility that I'll miss some textures which could be too large. And it takes longer of course.
Is there any way to universally downsize all textures larger than 1024 to that size?
-Brodie
the Dialog Title is either "Resize textures in model" or "Resize textures in selection" depending on what is/isn't selected before opening the ruby.
It needs to be "Resize textures in model" to 'do' all at once, i.e. select nothing before opening the ruby.
I mostly use the 'goldilocks' feature 'to cap all' as it only pulls down to the setting.
the script is really well commented
but, you might try setting Percentage above 100%, with 'Limit Texture Size' max 1024px
john
Thanks, you're right. I guess My problem was with trying to test both things at once. I must have only tried 100% every time I had nothing selected so it wasn't doing anything. Thanks.
After a brief look at goldilocks it looked like it resampled according to where your view was at. Are you saying you can use it to cap all textures at, say, 1024px?
-Brodie
-
@aerilius said:
**> @unknownuser said:
Using it on a texture that was 3000x2000 though provided no change until I set the percentage from 100% to 95%. Not if I run the script again on that texture it will be reduced further. I suppose though that I could set the minimum size to 1024 in order to eliminate that but then I presume it would upsize a 500x500px image to 1024x1024 which isn't what I'd want.
**
I think I have an idea what the problem is. I had set an internal criterium that textures are skipped if their new size differs only 2% (to avoid unnecessary re-encoding and quality loss). Of course that should not happen in this case.I also had thought about unwanted upscaling: It should not upscale textures except if the user intentionally sets a percent > 100%.
I will check these criteria again and fix the above problem!It looks like if I have nothing selected and run the script at 95% with max res at 1024 and min res at 1024 it gets me pretty close to what I'm looking for. The only caveat is that for a non-square image is samples it such that the smaller dimension is 1024.
I can't think of how to do what I want in a truly intuitive way and maintain all the other features you have here. Perhaps you could consider writing a similar script which trims down the features and only asks you for a Max Resolution for all the textures in the model. I'd use that almost as often as purge or cleanup. Might be something to consider if you think others would use that as well. Just a thought. Regardless, I'm really glad you wrote this script. It's amazingly fast and hugely useful!
-Brodie
-
@unknownuser said:
After a brief look at goldilocks it looked like it resampled according to where your view was at. Are you saying you can use it to cap all textures at, say, 1024px?
Goldilocks is view based but the image dimension it reports aren't.
so if you check what it's reporting, before and after using this, you can see what is being effected by which settings.
e.g.
run goldilocks.rb >> find the highest dimension.
run TextureResizer.rb >> set Percentage @ 100% + set Max Size to something lower than what you saw >> apply
run goldilocks.rb >> it shows what has been capped...I just found it useful to see what was happening.
[for most my stuff, I use the actual Goldilocks Method in TextureResizer as well, but you don't need to.]
john
-
@driven said:
I did have one projected texture that needed re-positioning.
I fixed the problem with the Velux windows: The script did not correctly calculate wrong texture resolution on projected textures and scaled the texture to a too small size.
@unknownuser said:
Perhaps you could consider writing a similar script which trims down the features and only asks you for a Max Resolution for all the textures in the model.
I fixed the problem that it skips textures when only limit is set and percentage 100%. I think it's not necessary to create a separate version, instead I added that it remembers your settings from one session to the next. I hope that makes it more comfortable!
-
hi
on a test file that was working, I'm now getting2868575561_07cdee7361_z1#1: could not write file /var/folders/lN/..removed../-Tmp-/skp_tr95419/2868575561_07cdee7361_z1
?
the file name is showing as the material name in Goldilocks, but that worked earlier with the other script.
If I rename it now TR runs fine.and the -TMP- directories are accumulating [testing 'as is' without my patch]
keep on keeping on
john -
Thank you so much Aerilius, for the plugin "image resizer".
Sylvie (Cathy Tritschler's pupil) -
I apologize for asking such a silly question, it's pretty obvious what this plugin does but I would like to ask anyway. My pictures that I have texture my model with in sketchup for Google Earth is making my file size too large to be accepted in Google earth. Very frustrating and i am running out of ideas,i had came across this plugin, is this something that would work for me not quite sure how it works? so do I finish my model first then download the plugin? I am new to these plugins and also new to geo modeling, any help would be appreciated John
-
Hi,
As Gully already said this plugin works be decreasing the size of texture images (or quality). It can not relieve you from the task of efficent modeling, ie. only bringing images into SketchUp that you actually need.
You can download it whenever you want. You should run it after you finished the model (you can keep an original version and use the plugin to make a lightweight degraded version). -
Hello Aerialius , im a sketchup user and i have finish my model and have tried to upload my model into the sketchup preview , and am sorry to say that ( KMZ too large. In order to include them in Google Earth, we convert uploaded SketchUp files like yours to another format: KMZ. The KMZ file size that we generated from your SketchUp file is too large. We recommend simplifying your model, splitting it into two or more models or reducing the resolution of your image textures. When you're done, try re-uploading )i had even unlocked the google terrain to lower the file size to 8,808 with the same affects, so im ready to use the plugin not familiar on how to use these , would you mind helping me, do i download the ImageMagick.zip first or is this the texture resizer? how do i get it into sketchup? sorry im just new to this John
-
lookin for help i have downloaded the ImageMagick and the resizer into my su plugin folder and im not sure what im to expect is there a supposed to be a icon? i have win 7 not quite sure if i did this properly can some help me? thanks john
-
hi
In the 'Sketchup Menu' you should have 'Plugins' with a drop down item 'Texture Resizer'.
If it can't find 'ImageMagics' it will ask you for the 'path' once you clicked on it.
then follow the instructions in the first post...
john
-
thank you for your reply i guess i did something wrong, the texture resizer isn't there in the plugin drop down
-
yes i was able to load the resizer and tried to use it on my model, it wiped away the textures replace them with white faces , it was set by default at 50%, did this twice and tried to use the limit texture size with same results. is there something that im missing? thanks john
-
I thought that I try the plugin to optimize some models that ware sent to me but I ran into a problem. When trying to run "Apply" I get the following error:
Error #<NameError:uninitialized constant AE::Bounds.>
I'm using SketchUp 8.0.3117 with Texture Resizer 1.4.0 and ImageMagick 6.8.0.
Any clues to what the problem might be?
-
Oh, thanks, I didn't notice that when testing. It should be AE::TextureResizer::Bounds.
I fixed it in version 1.4.1. -
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.
I got this error:
Error #<NoMethodError:undefined method
empty?' for nil:NilClass.>` -
Strange that there isn't any backtrace...
-
I found the bug and fixed it. The backtraces became lost because of a rescue Exception.
-
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. -
Changed line 253 to:
definition.entities.each{|e| block.call(e, s*scale)}
Working!
Advertisement