I'm making an add-on located in the slidebar and I need an object picker for later on referencing that object.
For now this is what I have:
And I would like to add the object picker (like this):
This are the lines of code:
import bpy
class TestPanel (bpy.types.Panel):
bl_label = "Slime"
bl_idname = "PT_TestPanel"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = 'Add Slime '
def draw (self,context):
layout = self.layout
row = layout.row()
row.operator ("mesh.primitive_plane_add" ,text = 'Create cube ',icon='CUBE')
def register():
bpy.utils.register_class(TestPanel)
def unregister():
bpy.utils.unregister_class(TestPanel)
if name == "main":
register()

