Forum: Poser Python Scripting


Subject: Is there a clothes fitting script?

miked123 opened this issue on Mar 14, 2005 ยท 29 posts


an0malaus posted Sat, 19 March 2005 at 4:02 AM

miked123, this brings to mind something I was playing with when looking at ockham's jiggles script. At one point, a body part morph value is modified by a little bit to determine the average direction the morph moves and then set back to its previous value. Unfortunately, what Poser Python (at least in P5) gives you for the morph.Value() is NOT that body part's morph dial setting, but the accumulated effect of PBM and JCM influences in addition to the local dial setting. If you have any active PBM or JCM effects, a loop getting and setting the morph value for the body part repeatedly will exponentially increase the effect. To try and counteract this, I developed a little function which takes a morph (actor.parameter), gets its current value and splits that into PBM/JCM (delta) and local dial parts and returns them, resetting the value without modification. def DialAndDelta(Morph): val1 = Morph.Value() # read value Morph.SetValue(val1) # set same value val2 = Morph.Value() # get new value delta = val2 - val1 # find FBM or JCM delta influence val0 = val1 - delta # find original parameter dial value for this actor Morph.SetValue(val0) # reset to original value return (val0, delta) example using DialAndDelta: for OneMorph in TheActor.Parameters(): if OneMorph.IsMorphTarget(): (dial, delta) = DialAndDelta(OneMorph) OneMorph.SetValue(-delta+0.001) # Set morph upward a bit without delta influence ... For a given body part, you could traverse back up the actor parent chain collecting all the PBM dial values for a given morph. Hope this is useful :-)



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.