Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bpy
- bl_info = {
- "name" : "Test",
- "version": (0, 0, 1),
- "description" : "",
- "blender" : (2, 80, 0),
- "location" : "",
- "warning" : "",
- "category" : "Scene"
- }
- class ThisThingOperator(bpy.types.Operator):
- bl_idname = "scene.tester" # Unique identifier for buttons and menu items to reference.
- bl_label = "Export tester project" # Display name in the interface.
- prop_directory : bpy.props.StringProperty(
- name="Root Folder",
- description="TesterButton.",
- subtype="DIR_PATH"
- )
- @classmethod
- def poll(cls, context):
- return (context.mode == 'OBJECT')
- def execute(self, context):
- return {'FINISHED'}
- def invoke(self, context, event): # Used for user interaction
- wm = context.window_manager
- return wm.invoke_props_dialog(self)
- def draw(self, context): # Draw options
- row = self.layout
- row.prop(self, "prop_directory", text="Bla")
- def menu_func(self, context):
- self.layout.operator(ThisThingOperator.bl_idname)
- def register():
- bpy.utils.register_class(ThisThingOperator)
- bpy.types.TOPBAR_MT_render.append(menu_func)
- bpy.types.Scene.directory = bpy.props.StringProperty(subtype='DIR_PATH')
- def unregister():
- bpy.utils.unregister_class(ThisThingOperator)
- bpy.types.TOPBAR_MT_render.remove(menu_func)
- if __name__ == "__main__":
- register()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement