Forum: Poser Python Scripting


Subject: Moving morphs between different figures

Cage opened this issue on Dec 20, 2006 · 1232 posts


Spanki posted Mon, 08 January 2007 at 2:07 PM

Just some house-keeping... apparently when I was chopping up the example python code shown above, I chopped out the code where 'morphval' got assigned.  In the original code, right after:

if (parm.IsMorphTarget()):

...there was another level of indentation that read...

    #---------------------------------------------------------------------------------
    # if morph target found, see if it's currently set to something besides zero
    #---------------------------------------------------------------------------------
    morphval = parm.Value()
    if(morphval):

...I took it out to simplify the example but savvy readers may have wondered why the sample was using un-assigned variables :).

This has nothing to do with the discussion at hand, I just hate leaving things dangling like that.  Just for completeness, I offer this freebie script, from which I chopped out that example:

<pre style="border-right:#000000 1px solid;padding-right:2mm;border-top:#000000 1px solid;padding-left:2mm;padding-bottom:2mm;margin:2mm;border-left:#000000 1px solid;padding-top:2mm;border-bottom:#000000 1px solid;background-color:#aefe50;">

...this script will 'bake' any active morphs (morph dials set to non-zero) into a figure's mesh.  If you then save the .cr2 file (or export it's .obj file), you'd get a new .obj file with the new shape.  This can be handy for using Poser magnets (or the new morph tool) to fine-tune some mesh you are creating, without going back to the modelling app.

Speaking of savvy readers... you might also note that this particular script didn't bother checking to see if the deltas exist for every vertex before using them... which means that the deltaX/Y/Z values might all be zero, but that doesn't hurt anything in this case.

Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.