Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2cb5748900 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,4 +0,0 @@
|
|||||||
__pycache__/*
|
|
||||||
.blender_ext/*
|
|
||||||
*.pyc
|
|
||||||
*.zip
|
|
||||||
17
__init__.py
17
__init__.py
@ -3,14 +3,15 @@ from .utils import parse_scene_objects, parse_object, release_object, recompute,
|
|||||||
|
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
class OBJECT_OT_parse_scene_objects(bpy.types.Operator):
|
class OBJECT_OT_parse_all_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_scene_objects"
|
bl_idname = "object.parse_all_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):
|
||||||
parse_scene_objects()
|
for obj in context.scene.objects:
|
||||||
|
parse_scene_objects(obj)
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
@ -56,11 +57,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="All Objects:")
|
layout.label(text="Control Range Operations:")
|
||||||
layout.operator("object.parse_scene_objects", text="Parse All Objects")
|
layout.operator("object.collect_control_ranges", text="Collect Control Ranges")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
layout.label(text="Active Object:")
|
layout.label(text="Active Object Operations:")
|
||||||
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")
|
||||||
|
|
||||||
@ -77,7 +78,7 @@ def register():
|
|||||||
unregister_existing_handler()
|
unregister_existing_handler()
|
||||||
register_handler()
|
register_handler()
|
||||||
|
|
||||||
bpy.utils.register_class(OBJECT_OT_parse_scene_objects)
|
bpy.utils.register_class(OBJECT_OT_parse_all_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
|
||||||
@ -85,7 +86,7 @@ def register():
|
|||||||
def unregister():
|
def unregister():
|
||||||
|
|
||||||
unregister_existing_handler()
|
unregister_existing_handler()
|
||||||
bpy.utils.unregister_class(OBJECT_OT_parse_scene_objects)
|
bpy.utils.unregister_class(OBJECT_OT_parse_all_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
|
||||||
|
|||||||
BIN
__pycache__/__init__.cpython-311.pyc
Normal file
BIN
__pycache__/__init__.cpython-311.pyc
Normal file
Binary file not shown.
BIN
__pycache__/utils.cpython-311.pyc
Normal file
BIN
__pycache__/utils.cpython-311.pyc
Normal file
Binary file not shown.
BIN
juggler7.blend
Normal file
BIN
juggler7.blend
Normal file
Binary file not shown.
1
utils.py
1
utils.py
@ -138,7 +138,6 @@ 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