_dodger opened this issue on May 19, 2003 ยท 3 posts
_dodger posted Mon, 19 May 2003 at 6:05 PM
Attached Link: PoserParser Perl extension
Okay, there are inevitably still bugs to work out in this, but PoserParser.pm (namespace subject to future change) is now available for beta. The module has now passed alpha tests to:An example CR2 output from the module is at http://www.dodger.org/ttt/poserParser/outputTest.cr2. This is a copy of my Elf Mage Vicki boots CR2 that has been read in and spit back out. I have not found any errors in it yet (but if you fond one, let me know). Some notes: The output of the module is, in some places, more syntactically precise than the output of Poser itself. For instance, you'll note that a figureResFile is only declared once. It only needs to be (this has been tested) declared once per figureResFile. It's also declared lower in the file than the Elf Mage Vicki boots original CR2 does this. This is because it recognises that the null geometries do not need it declared. Another thing to note is that boolean values are set to 1 for true and 0 for false. Poser does this for most boolean values, but occassional values (forceLimits and customMaterial, for instance) seem to oddly be set to other values (4 and 32, respectively, in these cases) for true. Setting such values to '1' works identically to the more unusual values Poser inserts, and so this module outputs more correctly typed values (of course, on re-saving, Poser will insert the weird numbers instead, again). This is in a beta 1 pre-release form because if you don't know some Perl, it's not going to help you a lot. By the time I release it as a full release v1.0+, it will contain convenience methods that only require the user to be able to script the barest amount of Perl to use it. However, it should be noted that you can do some pretty cool things right now if you do know Perl. For instance, you can instantiate two PoserParser objects, read in files from both of them, and then rearrange the contents of those files. It can also, at this point, be used for Poser object extraction (not geometry extraction). For instance, you can, at this point, read in a PZ3 file and then extracta single figure from it and save a CR2. The process, once scripted, will take about 1-3 seconds depending on the complexity of the file contents (mts and such). It can also be used for relatively simple channel management and other utility functions.