Welcome to
Mod The Sims
Online: 2314
News:
Have an account? Sign in:
pass:
If you don't have an account, why not sign up now? It's free!
Other sites: SimsWiki
Reply  Replies: 32 (Who?), Viewed: 29440 times.
Search this Thread
Old 21st Oct 2011, 4:38 PM DefaultBlender 3D 2.65 'Save Image as DDS' Addon #1
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


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
Download - please read all instructions before downloading any files!
File Type: zip save_image_as_dds.zip (400.4 KB, 881 downloads) - View custom content

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Last edited by cmomoney : 19th Jan 2013 at 2:13 PM.
Old 21st Oct 2011, 5:20 PM #2
BloomsBase
Sockpuppet

Join Date: Sep 2009
Posts: 4,400
Thanks: 2343 in 19 Posts
12 Achievements


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
Click image for larger version

Name:  dds.jpg
Views: 0
Size:  86.4 KB   Click image for larger version

Name:  dds2.jpg
Views: 0
Size:  103.2 KB   Click image for larger version

Name:  dds3.jpg
Views: 0
Size:  72.6 KB   Click image for larger version

Name:  dds4.jpg
Views: 0
Size:  93.5 KB  
Last edited by BloomsBase : 21st Oct 2011 at 5:37 PM.
Old 21st Oct 2011, 6:59 PM #3
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


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
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Old 21st Oct 2011, 10:00 PM #4
Morphead
Forum Resident

Join Date: Jul 2006
Posts: 781
Thanks: 43646 in 70 Posts
25 Achievements

View My Journal


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
Old 22nd Oct 2011, 12:28 AM #5
BloomsBase
Sockpuppet

Join Date: Sep 2009
Posts: 4,400
Thanks: 2343 in 19 Posts
12 Achievements


oops, had it in 2.57 installed and was testing in 2.59......
Everything works ok now, thanks!
Old 23rd Oct 2011, 2:04 AM #6
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


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
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Old 23rd Oct 2011, 4:27 AM #7
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


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
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Old 23rd Oct 2011, 6:42 AM #8
ellacharmed
In the Arena



Join Date: Nov 2007
Posts: 7,826
Thanks: 18890 in 34 Posts
20 Achievements

View My Journal


io_dds_26.rar works fine in Blender 2.6, thanks cmo!
Old 23rd Oct 2011, 6:46 AM #9
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


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
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Old 23rd Oct 2011, 12:22 PM #10
orangemittens
Alchemist

Join Date: Mar 2005
Posts: 2,934
Thanks: 15183 in 28 Posts
14 Achievements


It works like a charm...and it's great using this with the EZ bake feature that the Blender tools have
Old 25th Oct 2011, 5:00 PM #11
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


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
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Old 1st Nov 2011, 10:58 PM #12
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


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
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Old 3rd Nov 2011, 6:04 PM #13
pyszny16
Test Subject

Join Date: Jan 2010
Posts: 18


hmm... so I can't saving my DDS in image when it has 1024??
Old 3rd Nov 2011, 6:50 PM #14
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


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
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Old 3rd Nov 2011, 6:54 PM #15
pyszny16
Test Subject

Join Date: Jan 2010
Posts: 18


I'm asking can I save my image in 1024.. But anyway thanks :D
Old 20th Dec 2011, 6:41 AM #16
Majuchan
Field Researcher

Join Date: Oct 2010
Posts: 307
1 Achievements


I'm having a problem, I can't save my image.

Old 20th Dec 2011, 6:00 PM #17
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


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
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Old 21st Dec 2011, 2:40 AM #18
Majuchan
Field Researcher

Join Date: Oct 2010
Posts: 307
1 Achievements


Thanks a lot! =3 It worked like a charm.
Last edited by Majuchan : 21st Dec 2011 at 8:55 AM.
Old 22nd Dec 2011, 3:59 PM #19
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


Updated 2.61 version only(see details in OP). Please redownload.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Old 24th Jun 2012, 5:45 AM DefaultDoes this work on 2.63? #20
cymarel
Test Subject

Join Date: Jun 2012
Posts: 1


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.
Old 26th Jun 2012, 4:39 AM #21
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


See post #17. 2.61 version works for 2.63.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Old 6th Jul 2012, 7:20 AM #22
BloodyScholastic
Scholar

Join Date: Mar 2011
Posts: 1,062
Thanks: 54 in 2 Posts
19 Achievements

View My Journal


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
Click image for larger version

Name:  nvidia.jpg
Views: 0
Size:  105.5 KB  
Old 30th Dec 2012, 6:36 PM Defaulthow to use it in python script? #23
rockyzhang.chn
Test Subject

Join Date: Nov 2012
Posts: 1


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
Old 30th Dec 2012, 6:58 PM #24
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


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
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Old 19th Jan 2013, 2:13 PM #25
cmomoney
Original Poster

˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN

Join Date: Dec 2008
Posts: 1,825
Thanks: 103629 in 84 Posts
28 Achievements


updated for 2.65a

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Reply


Section jump:


Powered by MariaDB Some icons by http://dryicons.com.