AWS Thinkbox Discussion Forums

getting a list of partitions from the PRTLoader

I’m working on a system for reading a maya file with PRTLoaders in it, getting a list of the partition files in the loader for the purpose of re-partitioning those files when/if we restore this project from archive, and we don’t want to archive the PRT files. Easier to re-partition than write 18TB of PRT files to tape/disk/cloud/thumbdrives.

The problem I’m having is getting the list of partitions in the PRTLoader. I looked at the various attributes and none seemed to contain the list, so I then looked at the python class MayaKrakatoa, which is probably what I need, but then again, why spend hours poking at it when I can ask for help.

help!

Thank you,

-ctj

Hi Chris,

Taken nearly verbatim from the template script “AEPRTLoaderTemplate.mel”:

$attributeName="PRTLoader1.inInputFiles"; int $usedIndices[] = `getAttr -multiIndices $attributeName`; for ($index in $usedIndices) { $currAttr = $attributeName + "[" + $index + "]"; string $file = `getAttr ($currAttr + ".inPRTFile")`; int $inRender = `getAttr ($currAttr + ".inUseFileInRender")`; int $inViewport = `getAttr ($currAttr + ".inUseFileInViewport")`; int $singleFileOnly = `getAttr ($currAttr + ".inSingleFileOnly")`; print ("File:"+$file+" Render:"+ $inRender +" View:"+ $inViewport +" Single:"+$singleFileOnly + "\n"); }

Output:

File:C:/Temp/partitions/MagmaPartition/particles__part01of10_0000.prt Render:1 View:1 Single:0
File:C:/Temp/partitions/MagmaPartition/particles__part02of10_0000.prt Render:1 View:0 Single:0
File:C:/Temp/partitions/MagmaPartition/particles__part03of10_0000.prt Render:1 View:0 Single:0
File:C:/Temp/partitions/MagmaPartition/particles__part04of10_0000.prt Render:1 View:0 Single:0
File:C:/Temp/partitions/MagmaPartition/particles__part05of10_0000.prt Render:1 View:0 Single:0
File:C:/Temp/partitions/MagmaPartition/particles__part06of10_0000.prt Render:1 View:0 Single:0
File:C:/Temp/partitions/MagmaPartition/particles__part07of10_0000.prt Render:1 View:0 Single:0
File:C:/Temp/partitions/MagmaPartition/particles__part08of10_0000.prt Render:1 View:0 Single:0
File:C:/Temp/partitions/MagmaPartition/particles__part09of10_0000.prt Render:1 View:0 Single:0
File:C:/Temp/partitions/MagmaPartition/particles__part10of10_0000.prt Render:1 View:0 Single:0

Hope this helps!

Basically the attribute name is “.inInputFiles”, but it has sub-attributes “.inPRTFile” which is the file name, “.inUseFileInRender” and “.inUseFileInViewport” for the render and viewport flags, and “.inSingleFileOnly” for the single file only option. You probably need just the first one.

Much appreciated. I was coming to the same conclusion after looking over the maxScript docs for XMesh MX.

Thank you again,

-ctj

Privacy | Site terms | Cookie preferences