How would I create a new texture for a particle system? I tried bpy.ops.texture.new() but that wouldn't create any type of texture.
import bpy bpy.ops.texture.new()
you can see the "new" texture from:
you can change the current texture to the "new one" with a simple code.. in this case my material name is 'Material', and after that you can change anything, for example I apply the new texture and change the type from CLOUDS :
import bpy D = bpy.data ob = bpy.context.active_object bpy.ops.texture.new() text =bpy.data.textures[len(bpy.data.textures)-1] mat = bpy.data.materials['Material'] slots = mat.texture_slots for slot in slots: try: slot.texture = text bpy.data.textures[text.name].type = 'CLOUDS' except: print("empty slot")
ACTUALLY , you have some better options to add textures, as texture slot add:
mat = bpy.data.materials['Material'] tex = bpy.data.textures.new("SomeName", 'IMAGE') slot = mat.texture_slots.add() slot.texture = tex