Skip to content
🤖
AI 翻译提示

本文档使用 AI 自动翻译。如有不准确之处,请通过页面底部的评论系统告知我们,感谢您的反馈!

修复损坏的 Rigify 骨骼层

原因

更新到 Blender 4.0 版本后,新的骨骼集合替换了传统的编号层和骨骼组,请参阅更新日志了解详情

Rigify 通过 Python 脚本生成 Rig Layers 进行控制,您可以根据本指南修复它们。

您也可以观看此视频了解更多信息。

步骤

找到脚本

您可以将视图切换到脚本编辑,然后找到 rig_ui.py。默认情况下,它显示脚本的末尾部分;只需稍微滚动,您就能看到需要修改的部分。

替换文本

您可以点击修复版本的右上角进行复制,然后点击原始版本列,这是需要修改的地方。

在 Blender 中找到相应的部分,全选然后粘贴以覆盖。

检查骨骼的命名,将 rig 替换为相应的名称,然后运行脚本。

python
    def draw(self, context):
        layout = self.layout
        col = layout.column()

		collection =  bpy.data.armatures["rig"].collections

		row = col.row()
		row.prop(collection["Layer 2"], 'is_visible', toggle=True, text='Face ')
		row.prop(collection["Layer 3"], 'is_visible', toggle=True, text='Face (detail) ')

		row = col.row()
		row.separator()

		row = col.row()
		row.prop(collection["Layer 4"], 'is_visible', toggle=True, text='Torso')

		row = col.row()
		row.prop(collection["Layer 5"], 'is_visible', toggle=True, text='Torso (Tweak)')

		row = col.row()
		row.separator()

		row = col.row()
		row.prop(collection["Layer 6"], 'is_visible', toggle=True, text='Fingers')

		row = col.row()
		row.prop(collection["Layer 7"], 'is_visible', toggle=True, text='Fingers (Detail)')

		row = col.row()
		row.separator()

		row = col.row()
		row.prop(collection["Layer 8"], 'is_visible', toggle=True, text='Arm.L (IK)')
		row.prop(collection["Layer 11"], 'is_visible', toggle=True, text='Arm.R (IK)')

		row = col.row()
		row.prop(collection["Layer 9"], 'is_visible', toggle=True, text='Arm.L (FK)')
		row.prop(collection["Layer 12"], 'is_visible', toggle=True, text='Arm.R (FK)')

		row = col.row()
		row.prop(collection["Layer 10"], 'is_visible', toggle=True, text='Arm.L (Tweak)')
		row.prop(collection["Layer 13"], 'is_visible', toggle=True, text='Arm.R (Tweak)')

		row = col.row()
		row.separator()

		row = col.row()
		row.prop(collection["Layer 14"], 'is_visible', toggle=True, text='Leg.L (IK)')
		row.prop(collection["Layer 17"], 'is_visible', toggle=True, text='Leg.R (IK)')

		row = col.row()
		row.prop(collection["Layer 15"], 'is_visible', toggle=True, text='Leg.L (FK)')
		row.prop(collection["Layer 18"], 'is_visible', toggle=True, text='Leg.R (FK)')

		row = col.row()
		row.prop(collection["Layer 16"], 'is_visible', toggle=True, text='Leg.L (Tweak)')
		row.prop(collection["Layer 19"], 'is_visible', toggle=True, text='Leg.R (Tweak)')

		row = col.row()
		row.separator()

		row = col.row()
		row.prop(collection["Layer 20"], 'is_visible', toggle=True, text='Custom ')

		row = col.row()
		row.separator()
		row = col.row()
		row.separator()

		row = col.row()
		row.prop(collection["Layer 29"], 'is_visible', toggle=True, text='Root')
python
	def draw(self, context):
        layout = self.layout
        col = layout.column()

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=1, toggle=True, text='Face ')
        row.prop(context.active_object.data, 'layers', index=2, toggle=True, text='Face (detail) ')

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=3, toggle=True, text='Torso')

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=4, toggle=True, text='Torso (Tweak)')

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=5, toggle=True, text='Fingers')

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=6, toggle=True, text='Fingers (Detail)')

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=7, toggle=True, text='Arm.L (IK)')
        row.prop(context.active_object.data, 'layers', index=10, toggle=True, text='Arm.R (IK)')

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=8, toggle=True, text='Arm.L (FK)')
        row.prop(context.active_object.data, 'layers', index=11, toggle=True, text='Arm.R (FK)')

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=9, toggle=True, text='Arm.L (Tweak)')
        row.prop(context.active_object.data, 'layers', index=12, toggle=True, text='Arm.R (Tweak)')

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=13, toggle=True, text='Leg.L (IK)')
        row.prop(context.active_object.data, 'layers', index=16, toggle=True, text='Leg.R (IK)')

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=14, toggle=True, text='Leg.L (FK)')
        row.prop(context.active_object.data, 'layers', index=17, toggle=True, text='Leg.R (FK)')

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=15, toggle=True, text='Leg.L (Tweak)')
        row.prop(context.active_object.data, 'layers', index=18, toggle=True, text='Leg.R (Tweak)')

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=19, toggle=True, text='Custom ')

        row = col.row()
        row.separator()
        row = col.row()
        row.separator()

        row = col.row()
        row.prop(context.active_object.data, 'layers', index=28, toggle=True, text='Root')

Released under the MIT License.