AWS Thinkbox Discussion Forums

Command Line PRT creation

Is the command line creation of PRT partition creation documented someplace? I looked in the docs but didn’t see it. We use Rush fwiw but if we knew how to create them in the Terminal we could figure out the rush part. Thanks!

We’ve worked to make sure this works seamlessly in Deadline. However, if you’re using Rush then you will have to do a little scripting to make this work.

Basically, this is what you have to do:

  • Create a file in an accesable location called KrakatoaPartitionSubmitter.mel
  • Use this code in your new MEL file:
exportToPRT( all, your, partitioning, parameters, here );  //Note: this MEL function is provided by Krakatoa
  • Launch mayabatch and have it auto-run your KrakatoaPartitionSubmitter.mel

Since there are a very large number of parameters to this function, I won’t describe them all in the forum post. However, we have documented how to use the function. All the documentation in the KMY2PRT_Saver.mel script (line 1250) that is included in the Krakatoa install. I can also help you out if you need help getting it working.

thanks Conrad. Is exportToPRT documented in the docs? I’m not seeing it

Oh, duh. You already told me.

Conrad-
just double checking, but the MEL file is the only documentation, correct? There is NOT a separate doc file, right?

Yeah, the MEL file contains the only docs for it. Also, it you run the PRT Saver locally and look in the script window, there will be a debug print of exactly what call was made to exportPRT. So that might come in handy.

The function is a little bit complicated since there are so many parameters. I am happy to help out, or even give you a sample script if you’d like.

A sample would be awesome!

Conrad-
if you have time for that sample that would be awesome. We’re sort of stymied since we can’t even successfully copy and past the output of the script editor and have it work. For instance on a simple test scene, we see this as output after using the GUI to make 10 partitions:

//EXPORT TO PRT BEGIN
exportToPRT(
{“nParticleShape1”,}, //$objectsToSave[]
“/Volumes/PROJECTS/2013/1351_Intel_CES/OPEN/production/_dev/maya/PRT//saver_v01/”, //$PRTFolder
“nParticles”, //$txt_filePrefix
10, //$partitionCount
1, //$partitionStart
10, //$partitionEnd
1, //$frameStart
24, //$frameEnd
1, //$incrementSeeds
0, //$randomizeChannels
1, //$randomizeChannelPosition
0.01, //$randomizeChannelPositionRadius
0, //$randomizeChannelVelocity
0.01, //$randomizeChannelVelocityRadius
{“velocity”,“float16[3]”,“opacity”,“float16”,“rgb”,“float16[3]”,“particleId”,“int64”,}, //$channelInfo[]
0, //$saveMode
0, //$renderCurrent
0, //$verbosityLevel
“prt” ) //$saveFileFormat

simply pasting that back into the MEL Script editor we get a syntax error:

Error: invalid syntax

//EXPORT TO PRT BEGIN
exportToPRT(
{“nParticleShape1”,}, //$objectsToSave[]
“/Volumes/PROJECTS/2013/1351_Intel_CES/OPEN/production/_dev/maya/PRT//saver_v01/”, //$PRTFolder
“nParticles”, //$txt_filePrefix
10, //$partitionCount
1, //$partitionStart
10, //$partitionEnd
1, //$frameStart
24, //$frameEnd
1, //$incrementSeeds
0, //$randomizeChannels
1, //$randomizeChannelPosition
0.01, //$randomizeChannelPositionRadius
0, //$randomizeChannelVelocity
0.01, //$randomizeChannelVelocityRadius
{“velocity”,“float16[3]”,“opacity”,“float16”,“rgb”,“float16[3]”,“particleId”,“int64”,}, //$channelInfo[]
0, //$saveMode
0, //$renderCurrent
0, //$verbosityLevel
“prt” ) //$saveFileFormat;
// Error: {“nParticleShape1”,}, //$objectsToSave[] //
// Error: Line 3.24: Syntax error //

Any ideas?

Oops. that first line shouldn’t be in the output. Bad paste :slight_smile: It actually looks like this:

//EXPORT TO PRT BEGIN
exportToPRT(
{“nParticleShape1”,}, //$objectsToSave[]
“/Volumes/PROJECTS/2013/1351_Intel_CES/OPEN/production/_dev/maya/PRT//saver_v01/”, //$PRTFolder
“nParticles”, //$txt_filePrefix
10, //$partitionCount
1, //$partitionStart
10, //$partitionEnd
1, //$frameStart
24, //$frameEnd
1, //$incrementSeeds
0, //$randomizeChannels
1, //$randomizeChannelPosition
0.01, //$randomizeChannelPositionRadius
0, //$randomizeChannelVelocity
0.01, //$randomizeChannelVelocityRadius
{“velocity”,“float16[3]”,“opacity”,“float16”,“rgb”,“float16[3]”,“particleId”,“int64”,}, //$channelInfo[]
0, //$saveMode
0, //$renderCurrent
0, //$verbosityLevel
“prt” ) //$saveFileFormat;
// Error: {“nParticleShape1”,}, //$objectsToSave[] //
// Error: Line 3.24: Syntax error //

I think there are some MEL code typos in the example you pasted.
For instance, I think mel doesn’t like the extra comma before the closing curly in this line:

{“nParticleShape1”,}, //$objectsToSave[]

Try changing that line to instead read:

{“nParticleShape1”}, //$objectsToSave[]

This line seems to have the same problem:

{“velocity”,“float16[3]”,“opacity”,“float16”,“rgb”,“float16[3]”,“particleId”,“int64”,}, //$channelInfo[]

..that should probably be:

{“velocity”,“float16[3]”,“opacity”,“float16”,“rgb”,“float16[3]”,“particleId”,“int64”}, //$channelInfo[]

Also, I think you'd want to change this:

“prt” ) //$saveFileFormat;

    ..to instead read:

“prt” ); //$saveFileFormat

    ..so that the ';' closes the command after the closing paren.

 So with those mods applied, you'd end up with the following which I think should paste OK without syntax errors anyway:

exportToPRT( {"PRTFractal1","NParticleShape1"}, //$objectsToSave[] "/Volumes/PROJECTS/2013/1351_Intel_CES/OPEN/production/_dev/maya/PRT//saver_v01/", //$PRTFolder "nParticles", //$txt_filePrefix 10, //$partitionCount 1, //$partitionStart 10, //$partitionEnd 1, //$frameStart 24, //$frameEnd 1, //$incrementSeeds 0, //$randomizeChannels 1, //$randomizeChannelPosition 0.01, //$randomizeChannelPositionRadius 0, //$randomizeChannelVelocity 0.01, //$randomizeChannelVelocityRadius {"velocity","float16[3]","opacity","float16","rgb","float16[3]","particleId","int64"}, //$channelInfo[] 0, //$saveMode 0, //$renderCurrent 0, //$verbosityLevel "prt" ); //$saveFileFormat

I think you’re right, but the interesting thing is that I didn’t write that. I turned on “Echo all commands”, did a GUI PRT creation. Then just copied from the script editor and pasted it back in.

Oh I see. erco is correct, the debug output isn’t quite correct.

Please remove the trailing commas from the array parameters (For example “{1,2,},” change to “{1,2},”)

That is a printing mistake, I will fix it for the next release.

Attached is a zipped sample Maya scene, and sample MEL script.

  • The scene contains a default particle emitter.
  • The MEL script makes a call to exportPRT, and will create a sequence of 24 PRT files from the emitter.

To run from the command line, copy both the MB and MEL files to “C:\temp”. Then run this from the command line:

"c:\program files\autodesk\maya2014\bin\mayabatch.exe" -file c:\temp\prt_export_sample.mb -script c:\temp\launch_export.mel

To change the parameters of the export, or to change the input/output paths, modify the MEL script. This is works on my computer, but you may have to modify the example to get it working on yours. Let me know if this helps!
prt_export_from_command_line_example.zip (14.4 KB)

Privacy | Site terms | Cookie preferences