bugfix [#20639] BF25_SVN_25888 and below - OBJ and 3DS import fails

blender supports type changing for textures in a way that python doesnt.
add a new general function.

Example usage:
 tex = bpy.data.textures.new("Foo")
 tex.type = 'IMAGE'
 tex = tex.recast_type()

Macro to give the number of users accounting for fake user.
 ID_REAL_USERS(id)
Use this so you can remove a datablock if it has a fake users as well as apply transformations to it in the 3D view.

Move api function bpy.data.add_texture() --> bpy.data.textures.new()/remove()
This commit is contained in:
2010-01-17 20:06:34 +00:00
parent 55756719fb
commit c7dfa96aea
12 changed files with 116 additions and 49 deletions

View File

@@ -367,8 +367,9 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
#==================================================================================#
def load_material_image(blender_material, context_material_name, imagepath, type):
texture= bpy.data.add_texture(type)
texture= bpy.data.textures.new(type)
texture.type= 'IMAGE'
texture = texture.recast_type() # Workaround for limitation in rna api.
# texture= bpy.data.textures.new(type)
# texture.setType('Image')