Forum Coordinators: RedPhantom
Poser - OFFICIAL F.A.Q (Last Updated: 2025 Jan 24 4:20 pm)
As a note, as of now (this posting) the above link is updated and the getObjects, listObjects, getActors, listActors and GetStringRes methods now work. getObjects and getActors return either a list of blessed references to the subparts asked for or a blessed hashref to the same, depending on whether it's called in list or scalar mode. The hashref is keyed by the object ID (ie, lToe:2, gun_1, or whatever). The list isn't keyed, but the ID can be retrieved by the _id property of each object returned. The listObjects and listActors methods simply return a list of IDs or, in scalar mode, an integer which means the number that being called in list mode would have returned. The distinction between 'object' and 'actor' here is a simple one of what is returned. objects returns all actors, props, cameras, lights, waves, magnets, bases, and spherezones. Actors returns only actors. Other specific methods will be built for the others but I'm going to refine how I do this to avoid near-duplicate methods bloating the code (these initial ones are just to test the algorithm, though the result will use the same syntax or allow an expanded one). GetStringRes works exactly as any Poser hacker would expect it to. Thanks be to RBTWhiz. Note that this module is coded in English, so the results of GetStringRes are in English, too. Not havnig a lot of reason to mess around with multilingual Perl, I don't know a lot about the use of the Locate pragma or how to code methods to be Locale-compliant.
dodger, Maybe you could explain in simple terms to an idiot like me exactly what I can use this for. Bear in mind, I don't even know what 'parse' means. Also, if I have to get Perl, is it some mega installation that's no use for anything else? I installed JRE to get Composer running and it f*%ked up my browser java and took up 40 megs of space. I ended up binning it, and Composer. mac
WTH? I had one of my long-winded responses to this and it just disappeared! Okay, in simple terms, Batch processing. You can sue Perl to do all sorts of things you'd normally manually do in a text editor, but you can batch them and do them in a few seconds with the right Perlscript. In this case I'm making an OO approach to it so that you can easily manipulate stuff through Perl and do things to them, like extraction, changes, and stuff like embedded geometry extraction. For instance, using this, once it's done, you'll be able to write something like this:
#!C:perlbinperl.exe
use strict;
use 3DModel::Poser;
my $propslib = 'C:Program FilesPoser 4RuntimeLibrariesProps';
my $geomlib = 'C:Program FilesPoser 4RuntimeGeometriesmyProps';
opendir PROPS, $propslib;
my @props = grep /.pp2$/i, readdir PROPS;
for my $propfile (@props) {
my $fn = $propfile;
$fn =~ s/.pp2$//i;
my $changed = 0;
my $pp2 = new 3DModel::Poser;
$pp2->read("$propslib/$propfile");
for my $object ($pp2->getGeomObjects) {
my $geomName = $object->{object};
if ($object->geomType eq 'geomCustom') {
$object->extractGeom(-filename=>"${fn}_$geomName.obj",
-path=>$geomlib);
$changed=1;
}
}
if ($changed) {
$pp2->backup("$propslib/${fn}_backup.pp2");
$pp2->write("$propslib/$propfile");
}
}
And this tiny little script run through Perl would, in about 1-2 seconds per prop, extract all the geometry from your prop file and place it nicely away in an external OBJ file instead. So if you had 100 props and some of them very complex, it might take a few minutes to extract every single wavefront OBJect that used customGeom to an external geometry and resave everything it touched (saving a backup of the unchanged file, too). One or two more lines and it can correct all your paths to be relative, too. During that time you can go take a pee, have half a smoke, have a cuppa, or whatnot, because you dont have to sit there doing it. Of course I'll give the module and some scripts away for free, and I'll sell some, too, probably. I'm already giving the development stage module away for free B^) Speaking of which It's updated. It now correctly parses the heirarchy, too, and stores that in the data structure. Yeehee! Same URL as above.
BTW, perl is an 11 meg installation that's useful for EVERYTHING! Perl can be used for all sorts of stuff. Automation, batch processing, database interaction, text file munging, and so on. If you're good with geometry and Perl, you can use a Perlscript to generate OBJ file primitives of all sorts. That's just the beginning. It's an almost trivial task to create deltas from a morph target without Poser running at all. Or, better yet, to batch them! Using the Image::Magick Perl module available from CPAN, you could roll your own rendering engine if you felt so inclined, and render in the background while you hang out on Renderosity. Of course, the more complex the task, the more Perl and programming knowledge in general you need. Building your own raytracer is no petty task. But it's doable. In this case perl wouldn't be the fastest thing to do it in, but it could be done. Complete with radiosity. On the other hand, making something go through and concatenate all your collected V2 morph dials into one single CR2 would be a piece of cake, at least once I get this module done. And you wouldn't even need this module to make a simple package checker to verify that you didn't leave out a texture map or an OBJ file. Or validate that your paths are all small enough for a Mac. That could be done in less than twenty lines as is. B^)
Hmmm.... well, thanks for the explanation, dodger, but it doesn't sound like anything I'd want to get into. I'm not a programmer-type person. I'd rather mess around in max with things I can see, than build them with numbers. I guess it's just a question of mindset. mac PS I posted a question in the tech forum for you about figure-props.
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
Attached Link: http://www.dodger.org/ttt/poserParser/PoserParser.pm
Anyone who's watching my progress on the Poser-Parsing module for Perl can grab a copy of the latest version at http://www.dodger.org/ttt/poserParser/PoserParser.pmOf course, you'll need Perl to play with this at all, but it does finally put things into the right data structure as I intended. I'm starting building the export methods currently.
You can get various versions of perl at http://www.cpan.org, which contains source and binaries and links to Windows and Mac ports (MacOS X should be able to compile the standard perl source, as it's a UNIX)