Changeset View
Changeset View
Standalone View
Standalone View
rigify/legacy/generate.py
| Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | try: | ||||
| name = metarig["rig_object_name"] | name = metarig["rig_object_name"] | ||||
| except KeyError: | except KeyError: | ||||
| name = "rig" | name = "rig" | ||||
| try: | try: | ||||
| obj = scene.objects[name] | obj = scene.objects[name] | ||||
| except KeyError: | except KeyError: | ||||
| obj = bpy.data.objects.new(name, bpy.data.armatures.new(name)) | obj = bpy.data.objects.new(name, bpy.data.armatures.new(name)) | ||||
| obj.draw_type = 'WIRE' | obj.display_type = 'WIRE' | ||||
| scene.objects.link(obj) | scene.objects.link(obj) | ||||
| obj.data.pose_position = 'POSE' | obj.data.pose_position = 'POSE' | ||||
| # Get rid of anim data in case the rig already existed | # Get rid of anim data in case the rig already existed | ||||
| print("Clear rig animation data.") | print("Clear rig animation data.") | ||||
| obj.animation_data_clear() | obj.animation_data_clear() | ||||
| ▲ Show 20 Lines • Show All 383 Lines • Show Last 20 Lines | |||||