Home Artists Posts Import Register

Content

(function(){

var startNode = Scene.getPrimarySelection();

if ( startNode ) {

var nodes = [ startNode ];

var rootnode = move_rootnode(nodes[0]);

var hipnode = rootnode.findNodeChildByLabel("Hip");


if(hipnode){

rootnode.setLocalPos(DzVec3(

rootnode.getXPosControl().getValue() + hipnode.getXPosControl().getValue(),

rootnode.getYPosControl().getValue() + hipnode.getYPosControl().getValue(),

rootnode.getZPosControl().getValue() + hipnode.getZPosControl().getValue()

));

hipnode.setLocalPos(DzVec3(0,0,0));


rootnode.setLocalRot(rootnode.getLocalRot().multiply(hipnode.getLocalRot()));

hipnode.setLocalRot(DzQuat(0,0,0,0));

}

}

})();

function move_rootnode(node){

debug(node.getLocalPos())

if(node.isRootNode()){

var rootnode = node;

}else{

var rootnode = move_rootnode(node.getNodeParent());

}

return rootnode;

}


なんか実行すると微妙にずれる。

パラメータ上は加算されているはずなのになんでだろう?

Comments

No comments found for this post.