Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/6cff6d0f2d98ccdb97e7 to your computer and use it in GitHub Desktop.
Save zeffii/6cff6d0f2d98ccdb97e7 to your computer and use it in GitHub Desktop.
import bpy
from bpy.types import Operator, Macro
# Our finalizing operator, shall run after transform
class Finalize(Operator):
bl_idname = "test.finalize"
bl_label = "Finalize"
def execute(self, context):
print("DONE!")
return {'FINISHED'}
class Make(Operator):
bl_idname = "test.make"
bl_label = "Make"
def execute(self, context):
bpy.ops.object.empty_add()
print('wigz')
return {'FINISHED'}
# Macro operator to concatenate transform and our finalization
class Test(Macro):
bl_idname = "test.trigger_macro"
bl_label = "Test Macro"
# BUTTON
class ObjectData(bpy.types.Panel):
bl_label = "Object + Mesh Data"
bl_idname = "ObjectData"
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
bl_category = "Modeling Toolbox"
def draw(self, context):
layout = self.layout
row = layout.row()
row.operator("test.trigger_macro")
# END
def register():
bpy.utils.register_module(__name__)
Test.define("test.make")
Test.define("test.finalize")
def unregister():
bpy.utils.unregister_module(__name__)
if __name__ == "__main__":
register()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment