Unable to create new prop_search item in the panel when button is clicked.
import bpy
# And now we can use this list everywhere in Blender. Here is a small example panel.
class MyPanel(bpy.types.Panel):
bl_label = "My Panel"
bl_idname = "my_panel"
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'
bl_category = "Library Texture List"
bl_context = "objectmode"
t_slotList = 1
t_slot = bpy.props.StringProperty()
def draw(self, context):
layout = self.layout
layout.operator("obs.to_my_list", icon='ZOOMIN', text="")
#layout.prop_search(self, "t_slot", bpy.data, "textures", icon='TEXTURE_DATA')
for i in range(0,self.t_slotList):
layout.prop_search(self, "t_slot", bpy.data, "textures", icon='TEXTURE_DATA')
class dummyOperator(bpy.types.Operator):
bl_label = "Operator for appending"
bl_idname = "obs.to_my_list"
def execute(self, context):
MyPanel.t_slotList += 1;
return {"FINISHED"}
def register():
bpy.utils.register_module(__name__)
def unregister():
bpy.utils.unregister_module(__name__)
if __name__ == "__main__":
register()