FrameNode.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:blemd 作者: niacdoial 项目源码 文件源码
def _FixBoneLength(self):

        for childBone in self.children:
            if (self._bone is not None) and (self._bone.parent.fget() is not None):
                mt = mathutils.Matrix.Translation(mathutils.Vector((self.f.t.x, self.f.t.y, self.f.t.z)))
                mx = mathutils.Matrix.Rotation(self.f.rx, 4, 'X')
                my = mathutils.Matrix.Rotation(self.f.ry, 4, 'Y')
                mz = mathutils.Matrix.Rotation(self.f.rz, 4, 'Z')

                parentVec = vect_normalize((self._bone.position)*self._bone.transform.inverted() -
                                           (self._bone.parent.fget().position)*self._bone.parent.fget().transform.inverted())

                mTransform = (mx * my * mz * mt)

                boneVec2 = vect_normalize((vect_normalize(self._bone.dir)) * mTransform)

                print(str(parentVec) + ":" + str(boneVec2))

            childBone._FixBoneLength()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号