Wednesday, March 20, 2013

Not quite programming, not quite prop building...

...but sort of like the annoying parts of both.

I've been building some Poser content this week.  Every now and then I build a little, and put it up at an online broker that handles all the file hosting and payment processing details in return for a 50% cut.  It brings in a spot of cash every now and then, and parts of it are fun to do.

I mean, I like creating things.  I can even get a kick sometimes out of finding creative solutions to the somewhat archaic (and arcane) Poser systems.

But like so many things on the computer, too many parts of it do become drudgery.  Today was mostly the drudgery part.

I finished a model last night.  Today was getting it into Poser.   Technical rant on the joy of doing that below the fold:





Grouped the model within Carrara, exported as .obj, imported that to Poser with the defaults set to scale it and center it in the Poser universe.  Poser also uses the wavefront .obj format, but the Poser universe is roughly 1/1000 of the scale of most other objects.  An arbitrary scale, of course; the true unit of scale in the Poserverse is the "Poser Unit," which equals the height of some character at some point in Poser's past.

Anyhow.  First up is the normals dance.  Poser ignores large hunks of the .obj file, preferring to build its surface normals from the winding order (aka, the order in which vertices are presented in the file.)  This plays Hobb with Carrara, since Carrara has a terrible habit of inverting the winding order when duplicating with symmetry (which you do a lot of times when making bilaterally symmetrical objects).

If you planned your object right, you can grab the offending normals in Poser and fix them by using the Grouping Tool.  I had, however, forgotten that Poser also is funny about double-sided polys so I needed to go back to the modeller, add a lining to the inside of a box, and export a new version of the model.

Then flipped the normals, scaled the object using a handy caliper tool created by another content designer, and exported the Poser-ready mesh.



Next up is to fix the groups.  To be able to rig a prop with moving parts, I need to have groups within the .obj file.  I also need the materials lines to be in the right places so I can assign different surface materials properly (unlike low-poly game content, we don't use a single texture map to cover the whole thing).  Carrara does not fold these properly into the .obj export, of course.

Say I have a rivit, with the texture metal_rivit.  I duplicate it twenty times to make a row of rivits, and group those within Carrara.  Following export from Carrara, the .obj file will contain rivit, rivit_1, rivit_2, rivit_3, etc.  And worse yet, the materials assigned will be metal_rivit, metal_rivit_1, metal_rivit_2, ad nas.

Yes, you can group them within Poser.  But I find it simpler to just open up the .obj file in a text editor and use search and find-and-replace.  Once they have been named identically, they behave as if they were never grouped separately at all (in fact, if you export from Poser at that point there will no longer be any separating lines).

Also, I may have assembled the prop from fifty different bits (like all those rivits!) but the final prop will only have two moving parts.  So after working out a scheme of what will get included in each final Actor in the Poser universe, I re-name (or delete the group lines) in order to force all the random bits together into the right order.

Brought the model back into Poser, found a few errors in my re-naming and re-ordering, fixed those. Assigned some basic colors and did a test render.



And, unfortunately, I didn't like a couple of things.  Just quick repairs, but I was in the wrong place now; the working copy was now the one that had been through Poser.  So I imported THAT version into Carrara, used "select by polygon name" to get at the places I needed to tweak....and very near the last fix of almost an hour's work, applied one of the edge tools.  Bang.  Carrara removed all the group data from the model, making it one homogeneous, (and un-editable) mass.

Dumped that file.  Went back to the original model file, made the changes there -- where it was easier to work anyhow and I could do a better job of it.  Went back through fixing the normals, scaling to the Poser universe, and editing the group names and materials names in text.  Faster this time, at least, because I already knew where everything needed to be.



Now I was finally ready to rig.  Brought the current mesh into Poser, used the Grouping Tool to spawn it into one prop per group, used the Hierarchy Editor to establish the parent-child relationships and rotation order, and created a new figure.  Actually, went through that three times before it finally "stuck" and created a figure with the right number of parts.  Don't know what was the problem.  This is my favorite method of figure creation.  I wouldn't recommend it for something with 200 body parts, and there are better methods to bone a conforming clothing item (use a donor skeleton or cr2), but it is fast and effective for props with a few working parts.

One downside is the geometry gets imbedded in the cr2.  So open the cr2 in that same text editor (I'm still using BBedit Lite!) and delete the geometry lines.  Paste in lines to fetch external geometry, and move everything into the pre-built Runtime folder.  Then open in Poser to check.  Had a couple of missing parts -- I'd managed to miss those actor definitions.  Added those and it all checked out.



And this next part is actually one of the fun parts.  Except, the first part I went to in order to adjust the joint centers, I saw I'd misplaced a section on one of the body parts during my repairs!  So.  Deleted the figure from the Poser workspace.  Imported the .obj directly.  Used the Grouping Tool to grab the body part/actor with the misalignment.  Fortunately, the bad bit had a different material assigned to it, so I could select by material, spawn a new prop with just that material, nudge it in the workspace, then export a new hybrid object, Frankenstiening the new changes with remaining good parts of the mesh.

Yes, I've done this part before.  I've done all these parts before.  This was actually one of the fastest and least painful Poser rigs I've done yet.

Re-opened the figure, which now has the repaired mesh.  This time the tool is the Joint Editor.  Fortunately this is a prop of all hard materials, so turn off bending in every body part, and just set joint centers; no need to edit the zones of influence.  I'm also not building any morphs on this one (I do a lot of them in Poserspace using magnets.)

But this does have ERC.  I used to do these in -- yes, once again -- text.  Now I do most of the work inside Poser, using a collection of Poser scripts from PhilC.  So once the joint centers were set, opened PPK and created new dials in the default body part.  Then used the same scripts to set up ERC relationships allowing those remote dials to move all the gears at the right relative rotations so they would mesh smoothly.

Save that.  Now open that....you know what I'm going to say next...in BBEdit once again.  This is dial-cleaning now.  I can re-name the dials within Poser itself, and set limits; in fact, is best to set limits here, because you can view the actual motion and see what looks right.  But in text (or with the right editing scripts), you can turn off visibility to all the dials you don't want to user to be fooling with.  You can also turn on dials that aren't normally visible, in order to allow sliding motions.  And you can also turn off actors as well; this removes them from mouse selection or the drop-down menu, although they can still be selected from the Hierarchy Room.  In this case, even though all my little gears are individual actors, none of them show up as individual body parts within the Poser workspace; just the master dial to make them all turn.



And one more prop is rigged.  I have a little more clean-up to do on one of the previous models, and at least one more model to build and rig before this set is done, but I might have it built by the end of next week.  Texturing is up next, and that sometimes takes some time.  It isn't rare that I find problems with the mapping during the texture stage and have to take the .obj file back into a modeling application to tweak it some more.  It is this tweaking; this finding of issues late in the process, that makes for the most pain, especially with 3d applications that do not play well with other children.

The interaction between Poser and Carrara is a known quantity for me now: I know the pitfalls in the interchange.  I know how to build a mesh that will display properly, and how to work with it to preserve the Poser data as I move it back and forth while making repairs.  That is the major reason why I haven't converted to Blender, or something else more powerful, with better support.



No comments:

Post a Comment