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.
Asked
Active
Viewed 1,209 times
1 Answers
1
after run:
import bpy
bpy.ops.texture.new()
you can see the "new" texture from:
/// update
*///////////////**
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

bpy.ops.textures.new()operator (the call to create the error message above) andbpy.data.textures.new(...)your stated script. – batFINGER May 14 '18 at 16:19