decompose.py 文件源码

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

项目:Urho3D-Blender-Mod 作者: Mike3D 项目源码 文件源码
def SetRestPosePosition(context, armatureObj):
    if not armatureObj:
        return None

    # Force the armature in the rest position (warning: https://developer.blender.org/T24674)
    # This should reset bones matrices ok, but for sure it is not resetting the mesh tessfaces
    # positions
    savedPosePositionAndVisibility = [armatureObj.data.pose_position, armatureObj.hide]
    armatureObj.data.pose_position = 'REST'
    armatureObj.hide = False

    # This should help to recalculate all the mesh vertices, it is needed by decomposeMesh
    # and maybe it helps decomposeArmature (but no problem was seen there)
    # TODO: find the correct way, for sure it is not this
    objects = context.scene.objects
    savedObjectActive = objects.active
    objects.active = armatureObj
    if bpy.ops.object.mode_set.poll():
        bpy.ops.object.mode_set(mode='EDIT', toggle=False)
    if bpy.ops.object.mode_set.poll():
        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
    objects.active = savedObjectActive

    return savedPosePositionAndVisibility
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号