11 November 2013 | |
![]() |
|
feelin' frisky?
G G
FRISKY.FM
Osaka,
Japan
|
Get texturemap name to output file
So im working on a script that scans all objects(geometry) in the scene, checks their materials and checks which materials uses a texturemap and that name should be exported in a .txt file list.
Here is what im using:
I want to have both the names of the diffuse and opacity map. However I get an error filename is indefined (I assume this is because some objects dont have textures) So when I add a try catch. it exports to a .txt file but the filenames are written as undefined. Where am I going wrong? |
11 November 2013 | |
![]() |
|
Expert
portfolio
Stig Atle Steffensen
Project Engineer
National Oilwell Varco
kristiansand,
Norway
|
![]() Hi, you need to add more checks before you try to read the data out.
Here's how I would do it (many ways to solve it, this is just one way of doing it).
__________________
http://stigatle.no |
11 November 2013 | |
![]() |
|
feelin' frisky?
G G
FRISKY.FM
Osaka,
Japan
|
Thanks stigatle, that script is working perfectly.
BTW There is no shorter way to grab both data at the same time? For example now its using same code for both the diffuse and opacity map. so if I want to browse through more slots (spec, gloss etc) the code will be very long. With similar pieces. And last question, anyone know how to get the layername per object? i tried the layermanagergetlayer.name code but returns with an error. |
11 November 2013 | |
![]() |
|
Expert
portfolio
Stig Atle Steffensen
Project Engineer
National Oilwell Varco
kristiansand,
Norway
|
I had a similar question a while back,
we solved it in this thread: http://forums.cgsociety.org/showthr...p?f=98&t=962272 Give that thread a read, and if you get stuck then just let us know here. __________________
http://stigatle.no |
11 November 2013 | |
![]() |
|
Expert
|
Thread automatically closed
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. |
Thread Closed share thread |
«
Previous Thread
|
Next Thread
»
|
|
|