Compare commits
2 Commits
5511f3a80e
...
8400999b2f
| Author | SHA1 | Date | |
|---|---|---|---|
| 8400999b2f | |||
| d09f3024a4 |
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
__pycache__/*
|
||||||
|
.blender_ext/*
|
||||||
|
*.pyc
|
||||||
|
*.zip
|
||||||
17
__init__.py
17
__init__.py
@ -3,15 +3,14 @@ from .utils import parse_scene_objects, parse_object, release_object, recompute,
|
|||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
class OBJECT_OT_parse_all_objects(bpy.types.Operator):
|
class OBJECT_OT_parse_scene_objects(bpy.types.Operator):
|
||||||
"""Collect control ranges for all objects in the scene"""
|
"""Collect control ranges for all objects in the scene"""
|
||||||
bl_idname = "object.parse_all_objects"
|
bl_idname = "object.parse_scene_objects"
|
||||||
bl_label = "Collect Control Ranges"
|
bl_label = "Collect Control Ranges"
|
||||||
bl_options = {'REGISTER', 'UNDO'}
|
bl_options = {'REGISTER', 'UNDO'}
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
for obj in context.scene.objects:
|
parse_scene_objects()
|
||||||
parse_scene_objects(obj)
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
@ -57,11 +56,11 @@ class OBJECT_PT_control_tools(bpy.types.Panel):
|
|||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
layout.label(text="Control Range Operations:")
|
layout.label(text="All Objects:")
|
||||||
layout.operator("object.collect_control_ranges", text="Collect Control Ranges")
|
layout.operator("object.parse_scene_objects", text="Parse All Objects")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
layout.label(text="Active Object Operations:")
|
layout.label(text="Active Object:")
|
||||||
layout.operator("object.parse_object", text="Parse Object")
|
layout.operator("object.parse_object", text="Parse Object")
|
||||||
layout.operator("object.release_object", text="Release Object")
|
layout.operator("object.release_object", text="Release Object")
|
||||||
|
|
||||||
@ -78,7 +77,7 @@ def register():
|
|||||||
unregister_existing_handler()
|
unregister_existing_handler()
|
||||||
register_handler()
|
register_handler()
|
||||||
|
|
||||||
bpy.utils.register_class(OBJECT_OT_parse_all_objects)
|
bpy.utils.register_class(OBJECT_OT_parse_scene_objects)
|
||||||
bpy.utils.register_class(OBJECT_OT_parse_object)
|
bpy.utils.register_class(OBJECT_OT_parse_object)
|
||||||
bpy.utils.register_class(OBJECT_OT_release_object)
|
bpy.utils.register_class(OBJECT_OT_release_object)
|
||||||
bpy.utils.register_class(OBJECT_PT_control_tools) # Register panel
|
bpy.utils.register_class(OBJECT_PT_control_tools) # Register panel
|
||||||
@ -86,7 +85,7 @@ def register():
|
|||||||
def unregister():
|
def unregister():
|
||||||
|
|
||||||
unregister_existing_handler()
|
unregister_existing_handler()
|
||||||
bpy.utils.unregister_class(OBJECT_OT_parse_all_objects)
|
bpy.utils.unregister_class(OBJECT_OT_parse_scene_objects)
|
||||||
bpy.utils.unregister_class(OBJECT_OT_parse_object)
|
bpy.utils.unregister_class(OBJECT_OT_parse_object)
|
||||||
bpy.utils.unregister_class(OBJECT_OT_release_object)
|
bpy.utils.unregister_class(OBJECT_OT_release_object)
|
||||||
bpy.utils.unregister_class(OBJECT_PT_control_tools) # Register panel
|
bpy.utils.unregister_class(OBJECT_PT_control_tools) # Register panel
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
1
utils.py
1
utils.py
@ -138,6 +138,7 @@ def release_object(obj:bpy.types.Object)->None:
|
|||||||
|
|
||||||
for i, record in enumerate(cached_objects):
|
for i, record in enumerate(cached_objects):
|
||||||
if obj is record.obj:
|
if obj is record.obj:
|
||||||
|
obj.matrix_world = record.mat
|
||||||
del cached_objects[i]
|
del cached_objects[i]
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user