Hey guys,
For past few days I have been trying to learn scripting in blender, after learning the very basic concept by copy pasting some code I thought about making a simple addon. A addon that allows user to right click on a image in the file browser and set it as the paint brush texture. I managed to get the file path of the image and load it into blender but I cannot create a texture slot for a brush for some reason. I can access existing texture slot and edit its properties but oddly I cannot set a image to it.
bpy.data.textures["mytex"].repeat_y = 69 #this works
bpy.data.textures["mytex"].image = image #this does not work
bpy.data.textures.new("myanothertex", type='IMAGE') #this does not work either
I have been flipping through the api reference for a while and I cannot find anything that would help me. Am I missing something obvious? Please help.