Forum: Poser - OFFICIAL


Subject: Is there a Python Script for this? (Poser/BVH fix)

tvining opened this issue on Nov 21, 2009 · 8 posts


ockham posted Sun, 22 November 2009 at 9:10 AM

Hmm.  Thinking out loud...

First, it's possible that the BVH was recorded on a different style of rigging?

Assuming it's a valid rig:

When the forearm is bent, side-side on forearm should be exactly the same motion
as twist on shoulder.  (Except for a slight variation because the joint center isn't
going to be precisely centered, but this shouldn't be highly noticeable.)

But when the forearm is straight, there should be no side-side at all.

Including this exception in the script (with a little "tolerance" around zero)

import poser
scene=poser.Scene()
fig=scene.CurrentFigure()
lfore=fig.ActorByInternalName('lForeArm').Parameter('Side-Side')
rfore=fig.ActorByInternalName('rForeArm').Parameter('Side-Side')
lsh=fig.ActorByInternalName('lShldr').Parameter('Twist')
rsh=fig.ActorByInternalName('rShldr').Parameter('Twist')
for f in range(scene.NumFrames()):
     scene.SetFrame(f)
     if abs(lfore.Value()) > 3.0:  # do the change only when forearm is bent
         lsh.SetValue(lsh.Value()+lfore.Value())
         rsh.SetValue(rsh.Value()+rfore.Value())
for f in range(scene.NumFrames()):
     scene.SetFrame(f)
     lfore.SetValue(0.0)
     rfore.SetValue(0.0)

My python page
My ShareCG freebies