When calling an operator like wm.link
, is there a way to get the user input like selected directory, filepath or object name?
Here is a simple code example:
import bpy
class appendObjectsPanel(bpy.types.Panel):
"""Creates a Panel in the Object properties window"""
bl_label = "Replace Object"
bl_idname = "OBJECT_PT_append"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
def draw(self, context):
layout = self.layout
obj = context.object
row = layout.row()
property = row.operator("wm.link")
property.relative_path=True
property.autoselect=True
property.active_layer=True
property.instance_groups=True
# ------------------------------------------------------------------------
# register and unregister functions
# ------------------------------------------------------------------------
def register():
bpy.utils.register_class(appendObjectsPanel)
def unregister():
bpy.utils.unregister_class(appendObjectsPanel)
if __name__ == "__main__":
register()