Forum: Poser Python Scripting


Subject: Moving morphs between different figures

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


Spanki posted Sun, 23 March 2008 at 3:02 AM

Quote - > Quote - ...snip....Hmm.  How would I use the .pyd code to do our zero deltas check before adding a morph delta?

...
if delta:
...
if abs(delta):
...
Or something else?  Do we need the abs() now, given that you've added the non-zero check for vectors?

If you look back into the flipmap creation code, it did a test and culled out extremely small weight values... the new C++ routine does the same thing, so if you're using a flipmap generated by FlipWeightIndexing() to create a morph, then it already has those culled out.

If you are doing something else and can point me at the spot in the code, I can give a better answer.

 
Ok, after reviewing your script, I assume you're asking about the code in your setShape() routine...

The answer, in that case, is that "if delta:" should be sufficient.  Currently, the "if" non-zero conditional test on the class only specifically tests for 0.0 values, but that really only catches the "not yet initialized" cases (and/or some cases where the python code explicately set it to 0.0).  I've been meaning to change that to an epsilon value test, so I think I'll do that in the next build.

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.