Unsure if this should go into Frost or Krakatoa forum, but I’m using a frost dialog for it so I’ll put it here.
I’m looking for a way to batch convert multiple individual non-sequential ‘single-frame’ PTS files into PRT. My scripting isn’t quite at a level where I’m comfortable trying to write the file on my own using the PRT Format specification, though perhaps I’ll eventually go that route to save a conversion step (right now I’m doing some manipulation of my original files in c# prior to saving out the PTS). If the “Frost - Convert Particle Files” dialog supported multiple selections I could probably get away with that, but I haven’t discovered a way to do that, apart from the slightly convoluted renaming my source files to pretend they’re a sequence and then loading them all individually single-frame later on.
I dug through the C:\Program Files (x86)\Thinkbox\FrostMX\Scripts\FrostUI.ms script and found the FrostUtils.ShowConvertToPRTFileDialog(), which would let me open that up and auto-populate it with each of my files, but as far as I can tell the user would still have to interact with the dialog to initiate the conversion. I thought about reading the PTS file manually through MaxScript and feeding it into KrakatoaParticleOStream, but I doubt I can get the same performance that ShowConvertToPRTFileDialog() does, as I was unsure where exactly(script versus compiled, etc) that function resides.
Do I have any other options?
Sidenote - While digging through all this I found some bad links:
Bottom of this page “User-Defined Partitioning MAXScript Functions” needs the “.html” removed after the slash.
In the overview section here the “KrakatoaParticleOStream MAXScript Value” should be to this URL, and the links also needs fixed in the “See Also” section at the bottom of the same page.
Please let us know if you encounter any problems with this function, or if it doesn’t do what you need. I notice it displays its errors in a message box, which I should probably change.
No, but I added this to our wish list. In the meantime, here are the functions related to PRT file conversion:
[size=150]Methods[/size] FrostUtils.ConvertParticleFileSequence inFile outFile firstFrame lastFrame
Convert a sequence of particle files to PRT format. You can use FrostUtils.GetFileSequence range to determine the firstFrame and lastFrame. Return true if the conversion succeeded, or false otherwise. FrostUtils.ConvertParticleFile inFile outFile
Convert a single particle file to PRT format. Return true if the conversion succeeded, or false otherwise. FrostUtils.ShowConvertToPRTFileDialog inFile
Show a dialog prompting the user to convert a particle file. The dialog fields are populated using the inFile filename. If the conversion completed successfully, return the output filename. Otherwise return an empty string. FrostUtils.GetFileSequenceRange filename
Return the frame range in the filename sequence as an array. Return undefined if there is no frame range.
No, but you can do this using Krakatoa. I think the free version works fine for this.
Load the BIN file using a Krakatoa PRT Loader.
Open the Krakatoa GUI (Krakatoa menu -> Set Krakatoa as Current Renderer / Open Krakatoa GUI).
In the Main Controls rollout, change the Render Target from “Render Scene Particles” to “Save Particles To File Sequence”.
In the Save Particles rollout:
[list=1][*]Specify a save path, and
Use the Particle Channels To Save To Disk controls to specify the channels you want to export.
[/:m]
[]Click the “Save Particles” button (in the Main Controls rollout).[/*:m][/list:o]
Were you looking for a way to do this in MAXScript?
Thanks, Yes I know its possible to do it in Krakatoa, but if Frost now has a prt converter it would be nice to have control over channels as well which is a huge storage saver.
Just for comparison, a 22mb realflow bin file (raw file that store all the channels) is saved to 12mb prt file including all channels. However if you only need the position channel (which in many cases that’s all you need) the prt is shrinked to 2mb.
It’s possible to do it within realflow 2012 as well and specify which channels to output, but they havn’t got around the proper alignment in prt conversion, tho if I do it I just use a quick script to mirror and fix the offest of the prt loader.