本文整理汇总了Python中mathutils.Matrix.col[3]方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.col[3]方法的具体用法?Python Matrix.col[3]怎么用?Python Matrix.col[3]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mathutils.Matrix
的用法示例。
在下文中一共展示了Matrix.col[3]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: buildSkeleton
# 需要导入模块: from mathutils import Matrix [as 别名]
# 或者: from mathutils.Matrix import col[3] [as 别名]
def buildSkeleton(mhSkel, scn, cfg):
from .geometries import getScaleOffset
from .bone_drivers import buildAnimation, buildExpressions
rname = mhSkel["name"]
amt = bpy.data.armatures.new(rname)
rig = bpy.data.objects.new(rname, amt)
amt.draw_type = 'STICK'
rig.show_x_ray = True
scn.objects.link(rig)
reallySelect(rig, scn)
scale,offset = getScaleOffset(mhSkel, cfg, True)
bpy.ops.object.mode_set(mode='EDIT')
for mhBone in mhSkel["bones"]:
eb = amt.edit_bones.new(mhBone["name"])
eb.head = zup(mhBone["head"])+offset
eb.tail = zup(mhBone["tail"])+offset
if "matrix" in mhBone.keys():
mat = Matrix(mhBone["matrix"])
nmat = Matrix((mat[0], -mat[2], mat[1])).to_3x3().to_4x4()
nmat.col[3] = eb.matrix.col[3]
eb.matrix = nmat
else:
eb.roll = mhBone["roll"]
if "parent" in mhBone.keys():
eb.parent = amt.edit_bones[mhBone["parent"]]
bpy.ops.object.mode_set(mode='OBJECT')
for mhBone in mhSkel["bones"]:
pb = rig.pose.bones[mhBone["name"]]
if pb.parent:
pb.lock_location = [True,True,True]
rig.MhxRig = "Exported"
buildExpressions(mhSkel, rig, scn, cfg)
buildAnimation(mhSkel, rig, scn, offset, cfg)
return rig