Created
January 14, 2016 18:37
-
-
Save zeffii/6cff6d0f2d98ccdb97e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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