Creating a Puppet rig with script vs manually

I’m able to create a new puppet limb, align each bone to our game skeleton with maxscript, and pos and rotation constraint the game skeleton to the puppet. Everything seems to work great.

But when I import a BVH (exported from Biped) on the puppet it blows up the spine and the legs.

When I import the same BVH on a manually created puppet it works.

This is what I’m doing to create rootPuppet, pelvis, legs and spine:


-- puppet and root
nCharPuppet = puppetShop_CharHUB pos:[0,0,0] iconsize:0.01 name:"RiderPuppet" filterSpaces:true
nCharPelvis = ps_build.createRootNode nCharPuppet

-- leg
ps_build.default_leg nCharPelvis "R" green
ps_build.default_leg nCharPelvis "L" green

--spine
nCharSpineArray = ps_build.add_spine nCharPelvis
ps_build.removeBone nCharSpineArray[4] 
deleteItem nCharSpineArray 4

After that I do a puppetBone.rotation = gameBone.rotation and puppetBone.pos = gameBone.pos (there’s some switch in axis, but only on the spine). And yes, our character has 3 spine bones only, and the default puppet spine has 4, so I delete one. Which could explain the problems with the spine (although the BVH also has 3 bones). But I don’t get the problems with the legs… When I import the animation they look inverted… and the copy of rotation and position is quite straight forward since all axis are pointing to the same way. The same goes for the arms, but the animation on the arms are correct.

Any ideas of what I can try?

Edit: ARGH, it seems it’s our scale, not any difference between scripted or manually created puppet. If I create another puppet manually with scale 0.01 it also blows up the animation. If I use a normal scale it works…

What do you mean by scale? The scale on the puppet node?

[QUOTE=Rob Galanakis;7514]What do you mean by scale? The scale on the puppet node?[/QUOTE]

Yes, exactly. Which is the puppetnode.iconsize. We use a 1 unit = 1 meter, so it’s a really small scale. But I made more tests, and it’s not it. Creating manually both 0.01 and 1.0 iconsized puppet works. Creating with maxscript a 0.01 and importing BVH explodes, so does creating a 0.01 puppet then changing the iconsize to 1.0 and loading the BVH.

So it really seems the BVH importer does work a bit differently from script created limbs rather than manually created ones… Any ideas for why?