09-01-2018, 04:56 PM
Quote that started it all:
So i did that and all the textures were inverted (hue). I could convert every NORMAL map correctly, by modulating the hue by 166.6% twice, but the other textures are all everywhere. One texture is correct when modulated 200%, one is like 110%, others are all wonky and everything. Is there a way to get the original color encoding and just simply convert to PNG with it? the DDSes are the right colors.
this model has been dormant on my hard drive for months.
I use Windows btw. Attatched are my current files after modulating them all who knows what. All 3 of these were modulated the same amount. Like 166.6% twice or something. help
(04-08-2018, 11:42 PM)Friedslick6 Wrote: Presuming you're running on Windows:File extensions can be fixed in post by find-and-replace on the exported plaintext model
- Install a copy of ImageMagick.
- Save the following to a batch file (.BAT extension) in the directory containing the .DDS textures:
@CD /D %~dp0%@magick mogrify -format png *.dds@DEL *.dds
- Run the batch file and wait for it to convert the .DDS textures into .PNG.
- To optionally optimise each texture (reducing file size), download PNGOUT to the directory.
- Save the following to another batch file in the directory containing the new .PNG textures::
@CD /D %~dp0%@FOR /R %%A IN (*.png) DO PNGOUT "%%A" "%%A" /y
- Run the batch file and wait for it to optimise the .PNG textures.
Changing the extensions inside of Blender can be done automatically with the assistance of this Python script I found, credit to Photox.
Copy the following into the "scripting" layout's code window within Blender, then press the "Run" button below it:
Code:import bpy
# the main looping code snippet is modified from
# https://blender.stackexchange.com/questions/80773/how-to-get-the-name-of-image-of-image-texture-with-python
print('----------------------------------------')
print('Starting the replacer script....')
texture_list = []
count_replaced_files = 0
find_chars = 'dds'
replace_chars = 'png'
for obj in bpy.context.scene.objects:
for s in obj.material_slots:
if s.material and s.material.use_nodes:
for n in s.material.node_tree.nodes:
if n.type == 'TEX_IMAGE':
texture_list += [n.image]
#print(obj.name,'uses',n.image.name,'saved at',n.image.filepath)
if find_chars in n.image.name:
count_replaced_files += 1
old_name = n.image.name
new_name = n.image.name
new_name = new_name.replace(find_chars,replace_chars)
n.image.name = new_name
info_string = old_name + ' has been replaced with ' + new_name
print(info_string)
print(str(count_replaced_files))
print('File were replaced')
print('Finished')
print('----------------------------------------')
#print(texture_list)
So i did that and all the textures were inverted (hue). I could convert every NORMAL map correctly, by modulating the hue by 166.6% twice, but the other textures are all everywhere. One texture is correct when modulated 200%, one is like 110%, others are all wonky and everything. Is there a way to get the original color encoding and just simply convert to PNG with it? the DDSes are the right colors.
this model has been dormant on my hard drive for months.
I use Windows btw. Attatched are my current files after modulating them all who knows what. All 3 of these were modulated the same amount. Like 166.6% twice or something. help