Reduce texture sizes easily with this script.

123457»

Comments

  • hphoenix said:
     

    @Esemwy 's script used the temp folder.  Mine doesn't use it at all (resized textures go into the original runtime/textures/whateverpath for the original texture, except for connect-based stuff, which uses the selected path in the main dialog.)  So I'm not sure which one you are using now, mine or his.  There's two separate resizing things done in this thread.

     

    I will re-read. I may have missed something because the script I used did not provide any choices on where to save those new files.  And yes "sometimes" but not always the script I got first and DS did delete those files. I had to resort to making copies prior to clearing scene to save them so being able to have them placed in their correct location would be awsome!

  • wscottartwscottart Posts: 429

    This is an awesome tool. I've bookmarked this thread to try and not lose track of it.

  • sapatsapat Posts: 1,735

    which is the latest copy of the script?  I downloaded a verions of it, but it was a while back and it's had updates since then.

    Thx.

  • EsemwyEsemwy Posts: 577

    Most people seem to be using @hphoenix version. The latest is here on the previous page. Mine is at the top of the thread. It hasn’t changed in a while.

  • sapatsapat Posts: 1,735

    Yours is the one I had originally, so will dl that one again.  I'll dl the other one as well, but will give yours a go first, thx.

  • EsemwyEsemwy Posts: 577
    edited January 2019

    Let me know if anything is broken. I haven't done anything to it in a while, so bit-rot may have set in.

    Post edited by Esemwy on
  • sapatsapat Posts: 1,735
    Esemwy said:

    Let me know if anything is broken. I haven't done anything to it in a while, so bit-rot may have set in.

    Will do, and thx for all you have done.

  • avmorganavmorgan Posts: 201

    These scripts are able to do almost everything I'd look for in this kind of utility. There's one thing in particular I'd want to add if I could do the scripting... other people might too, so I thought I'd mention it. When I upgraded to a better system (old laptop to new laptop), I had to settle for 1/4 of the HD space. I have my runtime backed up on an external HD with room to spare, but it is growing too large for my C drive. I was tempted to convert my primary runtime/textures directory to a reduced size but there was no real convenient way to switch to my backup runtime/textures (on my E drive) at will. I would love it if the TextureMapSizeSwitcher had the option to look for the textures (that is the default names but in the alternate runtime). I think, by preference, I'd want to start out with lower res textures during setup and then switch out to higher res textures where needed at final save and render. 

    Would that be difficult to implement?

  • hphoenixhphoenix Posts: 1,335
    avmorgan said:

    These scripts are able to do almost everything I'd look for in this kind of utility. There's one thing in particular I'd want to add if I could do the scripting... other people might too, so I thought I'd mention it. When I upgraded to a better system (old laptop to new laptop), I had to settle for 1/4 of the HD space. I have my runtime backed up on an external HD with room to spare, but it is growing too large for my C drive. I was tempted to convert my primary runtime/textures directory to a reduced size but there was no real convenient way to switch to my backup runtime/textures (on my E drive) at will. I would love it if the TextureMapSizeSwitcher had the option to look for the textures (that is the default names but in the alternate runtime). I think, by preference, I'd want to start out with lower res textures during setup and then switch out to higher res textures where needed at final save and render. 

    Would that be difficult to implement?

    Adding an extra path to search in isn't really that difficult, though it really depends on exactly how you are defining a 'separate runtime'.   If it's a duplicate of the exsting runtime structure (with just different content) then it's just another base directory to add (along with a UI to manage it).  If it's just a directory full of textures, that gets a little more complicated.

    One of the primary design considerations I made (in contrast to @Esemwy's, which is equally valid) was to put the resized textures into the same folder as the originals.  This kept all the textures in their original paths, so changing them manually was still very simple.  The only exception to this was Connect-installed content, as its subdirectories are protected.  Adding this feature would make the location non-deterministic....meaning that if the new path got changed around one could easily lose track of what to use as the new base path, and then you are back to square one.

    It's not a bad idea, I'm just not sure how well it would work.  I'll give it some thought.

  • avmorganavmorgan Posts: 201

    Given the amount of "drift" my runtime has seen over the course of three computer upgrades (since I started with DS), I totally get where you're coming from. I think I had to merge three base directories (spread over partitions) into one, this last upgrade, so I can't really call my backup a mirror, folder-structure-wise. Heh. Of course, it'd be worth it to me to pick up a new external (at least 10TB's worth) and build up a "clean" backup, and then make a full restore of my main install; at least, if the size switcher could access the full-scale backup textures. Ideally, my backup should use the same folder structure up to the drive letter, regardless of any difference in file content. I'll let you think about it for a while, 'cuz the more I think about it right now, the worse my headache gets. 

    For now, I can just swap the files manually as needed. Thanks for your response!

  • icemage1993icemage1993 Posts: 68
    edited March 2019

    This script is freaking awesome, thank you hphoenix!

    Btw, can i manually set where all the resized textures saved? Or atleast made the script save those file to temp folder like the original script by Esemwy, because as of now the script save the resized textures to the original textures location and that make uninstall stuff with DIM complicated!

    Post edited by icemage1993 on
  • hphoenixhphoenix Posts: 1,335

    This script is freaking awesome, thank you hphoenix!

    Btw, can i manually set where all the resized textures saved? Or atleast made the script save those file to temp folder like the original script by Esemwy, because as of now the script save the resized textures to the original textures location and that make uninstall stuff with DIM complicated!

    Unfortunately, in order to find (and switch between) the textures, they need to be in a uniform place.  As in, to switch back to the original texture, they need to be in the same directory.  This also makes manually switching the textures easier (as the file browser should pop-up pointing at the same location).  The only exception to this is for Connect installed content.

     

  • hphoenix said:

    This script is freaking awesome, thank you hphoenix!

    Btw, can i manually set where all the resized textures saved? Or atleast made the script save those file to temp folder like the original script by Esemwy, because as of now the script save the resized textures to the original textures location and that make uninstall stuff with DIM complicated!

    Unfortunately, in order to find (and switch between) the textures, they need to be in a uniform place.  As in, to switch back to the original texture, they need to be in the same directory.  This also makes manually switching the textures easier (as the file browser should pop-up pointing at the same location).  The only exception to this is for Connect installed content.

     

    I see, thanks for the answer!

     

  • sean2_7606d08833sean2_7606d08833 Posts: 40
    edited March 2019
    hphoenix said:

    Unfortunately, in order to find (and switch between) the textures, they need to be in a uniform place.  As in, to switch back to the original texture, they need to be in the same directory.  This also makes manually switching the textures easier (as the file browser should pop-up pointing at the same location).  The only exception to this is for Connect installed content.

    (1)

    Aren't all the filenames relative to the content base? Or am I forgetting something?

    If so, it seems like if you just added the option to always save to a specific content directory (not just for Connect), then people who want this behavior can create a "temporary" content directory, save all the modified files there, but it can still switch back automatically, since it's just the "same directory" but in a different base? They do lose the "file browser pops up in the right place", but maybe that's an acceptable trade-off for them.

    (2)

    I'm on a fork of this I made back when I reported the 4.9 version comparison failure, because there's one other thing I really need that yours doesn't do. 99.9% of the time I'm not authoring textures, so my textures never change. That means when I run resizer, if the texture already exists, replacing the output would have no effect. So for performance reasons I just always want to skip. But this isn't an option--the global setting lets you choose between "always overwrite" and "always ask", whereas I want a third option, "always skip".

    If you care about why, the point is that it lets you not have to keep track of what you've resized. Click everything thing in the scene and run resizer on it all. More commonly I do this to resize all the clothing on a character whose skin is already resized.

    On the same quality-of-life axis is always skipping the prompt when you try to switch a texture that's already been switched. E.g. if I set the character skin to 1/4 and then load new clothing, it's convenient to just select the character and resize and get no messages.

    If adding more options to the config screen is too unpleasant, you could add these to the dialogs that pop up, i.e. add a new option of "skip all". You could also go the route of a checkbox "use this response for all remaining textures" that applies to whatever response you choose for the yes/no box, rather than adding "yes to all" or "no to all". This way the extra choices aren't visible to people who never hit the dialogs; the cognitive load is only paid once something "goes wrong". (In my mind, though, this isn't "wrong" at all and I'd prefer the global option, but I just wanted to point out the option.)

    I can't give you my code because I didn't write any of this, I just hardcoded my fork to *always* skip those dialogs, but given that I use it this way I imagine there are others who might use it this way as well. Plus I'd like to get off the fork so I can get the Connect fixes, just in case I ever use Connect. (Although I also have scripts hardcoded to size 1/2, 1/4, and 1/8 without opening the dialog which I guess I'd have to re-do.)


    (3)

    Did you ever look at the 'temp' problem I mentioned here? I don't remember now what content was causing this to test it out now, but I assume the issue is that some content is automagically generating textures (maybe doing layer stuff?) when it's loaded. IIRC my fork just looks for "/temp/" in the filename or something like that. I can look it up and tell you my exact fix if you want.

    (4)

    I made a totally unrelated script which makes copies of all the current textures on an object and rebinds the surfaces to use them, so you can one-click prepare for editing the textures of anything. Is there an existing way to do this that I missed, and if not is this something other people need, i.e. should I post it?

    (I bring it up here because I basically just took the code for Resizer and Switcher and ran them back-to-back, but with a different naming convention and not actually resizing. Of course the credits for Resize/Switcher are still in there since it's 90% the same code. Also because the "always copy them to a specific base directory" idea would be totally useful for segregating the original content from any modified content--at least personally I already have a separate content directory for this myself, e.g. in case I need to reinstall everything with DIM on a new drive, all my modifications are in a separate directory tree.)

    Post edited by sean2_7606d08833 on
  • I got a question, regarding image quality.

    If i were to reduce to extra small texture sizes in, say, a Dreamland Models city block, and retain the best quality possible, would I have to aim the camera closer to the target in order to achieve positive results?

    I know Scene Optimizer allows this to happen, but I am hoping this freebie script will be just as good or better.

  • Hi, loving the idea, but having read through, i noticed there was a problem going from 4.9 to 4.10. Is there a chance you'll change things from 4.10 to the new 4.11pro? As for the moment I'll hang off downloading & installing. Thanks in advance

  • LoonyLoony Posts: 1,801

    I just got this Script as tipp... so uhm, will the script warn me before it runs? because I am somtimes kinda dement... so I will forgot to save the scene before... I am soo afraid, that I destroy my setupt, when I overwrite it :(

    and do I have to select EVERY item or will it reduce ALL?

     

  • Wow, thanks for this amazing script! works like a charm!

  • Ralf1958Ralf1958 Posts: 688
    hphoenix said:

    (Okay, got fixes for the DS Version check failures, but the forums aren't wanting to let me upload the main file in the original posts.  So I'm reposting it here, zipped:)

    It still has the issue with PNG w/Alpha resizing issues, as those are pretty much inherent in the internal resizer, and there are even problems with ImageMagick.  But it does what it can.

    Presenting:  TextureMapResizer and TextureMapSizeSwitcher!

    Thank you very much! Great scripts!

  • TirickTirick Posts: 225

    This script is fantastic; it is a staple now in a lot of my scenes, especially when trying to cram as many assets into a shot as my GPU will bear.

  • GETSXGETSX Posts: 39
    Tirick said:

    This script is fantastic; it is a staple now in a lot of my scenes, especially when trying to cram as many assets into a shot as my GPU will bear.

    Trick, I don't argue, we use this script every day
    оО? Any problems? Why are you answering our address?

  • hphoenix said:

    Okay.  It's done....I think.

    I've added a lot of options in the dialogs popped up....wiring it all up to work with the rest of the script took a while.

    It still has the issue with PNG w/Alpha resizing issues, as those are pretty much inherent in the internal resizer, and there are even problems with ImageMagick.  But it does what it can.

    Presenting:  TextureMapResizer and TextureMapSizeSwitcher!

    Thanks this script is amazing.

    The only issue I have is that the face texture does not save in the asset folder due to makeup being applied, and the torso is the same as there is a tattoo in the torso, these files save in the temp folder and are then lost. These two textures are stored in the temp folder when DS merges the L.I.E and the texture, on Using the TextureMapSizeSwitcher it looks in the folder that the texture is in but can't find one as the temp folder has been cleared between reloads.

    Is there any way to resolve this issue?

  • 1. Identify the temp files generated by the lie in your temp folder (d1.png - d???.png) by looking them up in the surface tab

    2. move them to a mixed asset directory ( MyLibrary->runtime->textures->otherpeoplesstuff )

    3. rename them somthing intellegent (Rose2_Face and Lie_Eyeliner_01.png)

    4. go back to surface tab and set your new images over the temps

    5. Now run the script.

  • jag11jag11 Posts: 885

    Couldn't reduce DTHDR-RuinsB-500.hdr with esemwy's script.

    Also tested i with HDRs and EXRs. 

  • This script doesn't rescale .tga right? I tried and it doesn't look like it does, i might be doing something wrong tho.

  • Phenomenal!

    Life saver!

    Bless you, friend!

Sign In or Register to comment.