In one discussion, they provide a way to creat textures in blender Creating a new particle texture using python scripting
I listed the key part here
mat = bpy.data.materials['Material']
tex = bpy.data.textures.new("SomeName", 'IMAGE')
slot = mat.texture_slots.add()
slot.texture = tex
However, when I ran the command
tex = bpy.data.textures.new("SomeName", 'IMAGE')
What I get is error
TypeError: Calling operator "bpy.ops.texture.new" error, expected a string enum in ('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS', 'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT', 'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA', 'EXEC_SCREEN')
It seems that there are multiple overloaded versions of function bpy.data.textures.new() and bpy.data.textures.new(...)
How can we use them correctly?
bpy.ops.texture.new()not the API methodbpy.data.textures.new(). – batFINGER May 15 '18 at 07:13