bugfix/aviodance for [#23488] bpy.types.Texture.type don´t update the parameters of texture
bpy.data.textures.new() now has a type argument since changing the type after forces the hacky use of recast_type().
This commit is contained in:
@@ -356,18 +356,15 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
|
||||
#==================================================================================#
|
||||
def load_material_image(blender_material, context_material_name, imagepath, 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')
|
||||
texture= bpy.data.textures.new(name=type, type='IMAGE')
|
||||
|
||||
# Absolute path - c:\.. etc would work here
|
||||
image= obj_image_load(imagepath, DIR, IMAGE_SEARCH)
|
||||
has_data = image.has_data if image else False
|
||||
image = obj_image_load(imagepath, DIR, IMAGE_SEARCH)
|
||||
has_data = False
|
||||
|
||||
if image:
|
||||
texture.image = image
|
||||
has_data = image.has_data
|
||||
|
||||
# Adds textures for materials (rendering)
|
||||
if type == 'Kd':
|
||||
|
||||
Reference in New Issue
Block a user