Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#1 Old 21st Oct 2011 at 4:38 PM Last edited by cmomoney : 19th Jan 2013 at 2:13 PM.
Default Blender 3D 2.65 'Save Image as DDS' Addon
Well, Blender loads DDS images, but it doesn't save DDS images. Why? Good question, but one I can't answer. Since TS3 uses DDS, it's quite annoying to have to save as PNG or TGA, then convert to DDS in another program.

So, I wrote this addon to enable Blender to save DDS images using Nvidia's DDS tool. Its derived from an addon written by suatcagdas at BlenderTR.com. It allows you to save images generated by Blender, and TGA, PNG, and DDS opened in Blender as DDS images in DTX1(no alpha) or DTX5(with alpha).

Installation
1. Download. Start Blender and go to File->User Preferences(or press CTRL+ALT+U).
3. Click the "Add-Ons" button at the top of the User Preferences window.
4. Click the "Install from file" button at the bottom.
5. Navigate to the file and select it. Click "Install Add-On". 'Export image as DDS' is added to the the list.
6. Click the check box on the right in the list. You should now have the option to 'Save as DDS' in the UV/Image editor in the Image menu.

Use
With an image active in the UV/Imaged editor, just go to Image->Save as DDS. In the file browser, on the bottom left are the Save DDS option. Choose the format you want, name the file(no extension), and click the 'Save DDS' button.


changelog:

updated:1.19.13
-updated for Blender2.65a
-change to zip file for easier installation. Nvidia folder is automagically placed where it should go.
-removed Clear alpha option

updated:12.22.11
*2.61 version only
-fixed bug DXT5 not saving alpha data
-included Nvidia folder in .rar

updated:12.20.11
-added new version for Blender 2.61 API change

updated:10.25.11-ver0.2
-fixed failure to overwrite existing images after editing
-(2.6 version) removed extra DDS Type option due to API change

updated:11.1.11-ver0.2
-added 'Clear Alpha' function
Attached files:
File Type: zip  save_image_as_dds.zip (400.4 KB, 1182 downloads) - View custom content

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Advertisement
Sockpuppet
#2 Old 21st Oct 2011 at 5:20 PM Last edited by BloomsBase : 21st Oct 2011 at 5:37 PM.
I tried to bake a image and save it as DDS but got the message it could not find the nvidia tools the moment i tried to save.
Placed the folder in the Blender directory but i dont have to enable?

When trying to add the plugin i clicked the file twice(i redid the selection of the io_dds.py) wich gave me the 2 dds options in the image menu i think.(see screenshot)
So i thought i might had added it twice by accident.
But in the addons menu(preferences) there was however one line import/export. export images as DDS and when i deselected the checkboc i ended up with a not highlighted save.dds(screenshot)
But it gets even worse when i enabled and disabled it again, i get 3 not highlighted save as dds
So everytime i enable and disable it i get a extra option in the image view


Other then that the browsing and selection worked fine till the nvidia error.
Hope this was helpfull
Screenshots
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#3 Old 21st Oct 2011 at 6:59 PM
It not adding it twice, it was just not removing itself from the menu when you disabled it. I have fixed that and uploaded.

As for not finding the nvidia folder, are you sure it's in the same folder as the blender.exe?

Thanks for testing, btw.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Forum Resident
#4 Old 21st Oct 2011 at 10:00 PM
Ooooh Cmo, you rock! I'll try this out as soon as possible :D


Facebook | Currently On Hiatus | Twitter
Current Works-In-Progress: 0
Future Car | 2012 EA Cars | Car Parts | Jet Plane | Telephone Table | Concept Car
Traditional Bed Set | Living Set | 82 Slate Roofs | 1/2-Tile Kitchen Set | Distant Terrains | Kids Bedroom
Sockpuppet
#5 Old 22nd Oct 2011 at 12:28 AM
oops, had it in 2.57 installed and was testing in 2.59......
Everything works ok now, thanks!
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#6 Old 23rd Oct 2011 at 2:04 AM
Quote: Originally posted by BloomsBase
oops, had it in 2.57 installed and was testing in 2.59......
Everything works ok now, thanks!

Glad it is working for you and thanks again for testing.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#7 Old 23rd Oct 2011 at 4:27 AM
Apparently, there were some small changes in the API in Blender 2. So if you're using Blender 2.6, you'll need the io_dds_26.rar instead.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
In the Arena
retired moderator
#8 Old 23rd Oct 2011 at 6:42 AM
io_dds_26.rar works fine in Blender 2.6, thanks cmo!
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#9 Old 23rd Oct 2011 at 6:46 AM
Quote: Originally posted by ellacharm3d
io_dds_26.rar works fine in Blender 2.6, thanks cmo!

No, thank you!

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Alchemist
#10 Old 23rd Oct 2011 at 12:22 PM
It works like a charm...and it's great using this with the EZ bake feature that the Blender tools have
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#11 Old 25th Oct 2011 at 5:00 PM
Updated:
-fixed failure to overwrite existing images after editing( thanks Morphead )
-(2.6 version) removed extra DDS Type option due to API change

If reinstalling, you will not need to move the nvidia folder.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#12 Old 1st Nov 2011 at 10:58 PM
Updated:
-Added 'Clear image's alpha' function to Image menu. It makes the alpha channel of the current image empty(for use with specular images, for example).

Again, if reinstalling, you will not need to move the nvidia folder.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Test Subject
#13 Old 3rd Nov 2011 at 6:04 PM
hmm... so I can't saving my DDS in image when it has 1024??
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#14 Old 3rd Nov 2011 at 6:50 PM
Are you asking if you can, or are you saying that you can't? You should be able to save any image created with the EZ bake(or any size divisible by 4, I think).

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Test Subject
#15 Old 3rd Nov 2011 at 6:54 PM
I'm asking can I save my image in 1024.. But anyway thanks :D
Field Researcher
#16 Old 20th Dec 2011 at 6:41 AM
I'm having a problem, I can't save my image.

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#17 Old 20th Dec 2011 at 6:00 PM
You're using 2.61, which apparently broke the script with an API change. I've posted an updated script for 2.61. You will have to remove the the old one in User Preferences->AddOns by clicking the 'Remove' button under the script. Then just install the new one.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Field Researcher
#18 Old 21st Dec 2011 at 2:40 AM Last edited by Majuchan : 21st Dec 2011 at 8:55 AM.
Thanks a lot! =3 It worked like a charm.
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#19 Old 22nd Dec 2011 at 3:59 PM
Updated 2.61 version only(see details in OP). Please redownload.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Test Subject
#20 Old 24th Jun 2012 at 5:45 AM
Default Does this work on 2.63?
Quote: Originally posted by cmomoney
Updated 2.61 version only(see details in OP). Please redownload.


I tried it on Blender 2.63 but it gave me the same error message post it above. Can you help me with that?

Thanks for your work.
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#21 Old 26th Jun 2012 at 4:39 AM
See post #17. 2.61 version works for 2.63.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
#22 Old 6th Jul 2012 at 7:20 AM
I'm sorry for this noob technical question, where's the exact place to put nvidia folder?
I got a confusion reading your tutorial saying: "C:\Program Files\Blender Foundation\Blender"

In my system, my blender.exe is in C:\Program Files (x86)\Blender 2.63\blender-2.63a-release-windows64

Blender Foundation is in C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender

I put nvidia folder inside folder blender-2.63a-release-windows64, same folder as blender.exe.

I even put nvidia folder inside C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender
and extracted .dll files, nvidia_dds.exe from nvidia folder into inside folder blender-2.63a-release-windows64, alongside with blender.exe

In blender, save as dds menu appeared but as I tried to save the image file to dds, still getting the same messages "Error: Nvidia Tools not found, please install." after several attempts delete and copy the nvidia folder to the Blender application folder, close and open Blender program.

Am I put this wrong?

? Thank you in advance.
Screenshots
Test Subject
#23 Old 30th Dec 2012 at 6:36 PM
Default how to use it in python script?
Hi, cmomoney,

this addon works good in blender2.64 in GUI mode.
but when I tried to use it in python script, blender reported the following error message.
could you help me on how to use it in python script?
Thanks a lot!

>>> bpy.ops.save.dds(filepath="tmp")
Error: Traceback (most recent call last):
File "C:\Users\rockyzhang\AppData\Roaming\Blender Foundation\Blender\2.64\scripts\addons\io_dds_261.py", line 53, in execute
self.exportfile()
File "C:\Users\rockyzhang\AppData\Roaming\Blender Foundation\Blender\2.64\scripts\addons\io_dds_261.py", line 83, in exportfile
img = bpy.context.space_data.image
AttributeError: 'SpaceConsole' object has no attribute 'image'

location:C:\Program Files\Blender Foundation\Blender264a\2.64\scripts\modules\bpy\ops.py:188



Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "C:\Program Files\Blender Foundation\Blender264a\2.64\scripts\modules\bpy\ops.py", line 188, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
File "C:\Users\rockyzhang\AppData\Roaming\Blender Foundation\Blender\2.64\scripts\addons\io_dds_261.py", line 53, in execute
self.exportfile()
File "C:\Users\rockyzhang\AppData\Roaming\Blender Foundation\Blender\2.64\scripts\addons\io_dds_261.py", line 83, in exportfile
img = bpy.context.space_data.image
AttributeError: 'SpaceConsole' object has no attribute 'image'

location:C:\Program Files\Blender Foundation\Blender264a\2.64\scripts\modules\bpy\ops.py:188
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#24 Old 30th Dec 2012 at 6:58 PM
You can't run it from the console, the context is wrong.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
Original Poster
#25 Old 19th Jan 2013 at 2:13 PM
updated for 2.65a

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Page 1 of 2
Back to top