Changeset View
Changeset View
Standalone View
Standalone View
object_fracture/__init__.py
| Show All 34 Lines | if "bpy" in locals(): | ||||
| importlib.reload(fracture_setup) | importlib.reload(fracture_setup) | ||||
| else: | else: | ||||
| from . import fracture_ops | from . import fracture_ops | ||||
| from . import fracture_setup | from . import fracture_setup | ||||
| import bpy | import bpy | ||||
| class INFO_MT_add_fracture_objects(bpy.types.Menu): | class VIEW3D_MT_add_fracture_objects(bpy.types.Menu): | ||||
| bl_idname = "INFO_MT_add_fracture_objects" | bl_idname = "VIEW3D_MT_add_fracture_objects" | ||||
| bl_label = "Fracture Helper Objects" | bl_label = "Fracture Helper Objects" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.operator_context = 'INVOKE_REGION_WIN' | layout.operator_context = 'INVOKE_REGION_WIN' | ||||
| layout.operator("object.import_fracture_bomb", | layout.operator("object.import_fracture_bomb", | ||||
| text="Bomb") | text="Bomb") | ||||
| layout.operator("object.import_fracture_projectile", | layout.operator("object.import_fracture_projectile", | ||||
| text="Projectile") | text="Projectile") | ||||
| layout.operator("object.import_fracture_recorder", | layout.operator("object.import_fracture_recorder", | ||||
| text="Rigidbody Recorder") | text="Rigidbody Recorder") | ||||
| def menu_func(self, context): | def menu_func(self, context): | ||||
| self.layout.menu("INFO_MT_add_fracture_objects") | self.layout.menu("VIEW3D_MT_add_fracture_objects") | ||||
| def register(): | def register(): | ||||
| bpy.utils.register_module(__name__) | bpy.utils.register_module(__name__) | ||||
| # Add the "add fracture objects" menu to the "Add" menu | # Add the "add fracture objects" menu to the "Add" menu | ||||
| bpy.types.INFO_MT_add.append(menu_func) | bpy.types.VIEW3D_MT_add.append(menu_func) | ||||
| def unregister(): | def unregister(): | ||||
| bpy.utils.unregister_module(__name__) | bpy.utils.unregister_module(__name__) | ||||
| # Remove "add fracture objects" menu from the "Add" menu. | # Remove "add fracture objects" menu from the "Add" menu. | ||||
| bpy.types.INFO_MT_add.remove(menu_func) | bpy.types.VIEW3D_MT_add.remove(menu_func) | ||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||
| register() | register() | ||||