Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

How to get list of .ass file inside of .ass file in maya

How to get list of .ass file inside of .ass file in maya

Anonymous
Not applicable
1,667 Views
1 Reply
Message 1 of 2

How to get list of .ass file inside of .ass file in maya

Anonymous
Not applicable
file_ = cmds.file(query=1, list=1,withoutCopyNumber=1)

This command gives me list of all reference file and texture file.

 

assFiles = list(set([cmds.getAttr(n + '.dso') for n in cmds.ls(type='aiStandIn')]))

This command gives me list of .ass files which are standins in maya file

All .ass files which are standins in maya file also contains .ass file.

I want to list all that file using python in maya.

Can anyone tell me how to do it ?  

0 Likes
1,668 Views
1 Reply
Reply (1)
Message 2 of 2

diego.garces.skydance
Community Visitor
Community Visitor

You have two options to do that

  1. Ass files are ASCII text files, so you can parse them directly and extract the information by yourself. You can use regular expressions if you are comfortable using them
  2. Parse the .ass files using the arnold API to load the .ass file and then query the information with the API functions. AIASSLoad loads a .ass file in memory. You find the nodes using an iterator (AiUniverseGetNodeIterator) and you can get information using AiNodeGetStr to get the standin file it points to.

Option 1 is faster. Option 2 is probably easier to set up running.

 

Cheers

0 Likes