I'm trying to make something like map editor for my project. I'm rather new in Blender Python scripting and I have some troubles.
I made "Material" panel and I want to set "textureName" property for my object. What I need is to make some list of loaded in blender images (like in UV Editor you can load image and it appears on list).
In my panel I want just to choose one image and assign name of that image to my property. I can list loaded images by bpy.data.images but I can't dynamically add new images to property (for now I'm using EnumProperty assigned to bpy.types.Object.textureName). I was trying to make same UI widget like blender have (https://i.sstatic.net/MKVWQ.png) but I have no idea how it works.
Can somebody help me with this?
template_ID()
and uses an ID Property to store the reference to an ID datablock (based on what you picked). The problem is, that we can't create new ID Properties with Python, so you can't reference a datablock. You can, however, store the name of an object in aStringProperty()
. Use theprop_search()
on e.g.bpy.data, "images"
$\endgroup$