diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py index 61c88c467c9c6068897e9f5d75e86025e538cf82..50dd2cfffcfb6d2342eee016b65e0ba2be1cc5a3 100644 --- a/io_import_images_as_planes.py +++ b/io_import_images_as_planes.py @@ -231,7 +231,11 @@ def getMaterial(tex, mapping): # ... otherwise create new one and apply mapping. if not mat: mat = bpy.data.materials.new(name=tex.name) - mat.add_texture(tex, texture_coordinates='UV', map_to='COLOR') + mtex = mat.texture_slots.add() + mtex.texture = tex + mtex.texture_coords = 'UV' + mtex.use_map_color_diffuse = True + mat.mapping = mapping mat.name = tex.name diff --git a/io_import_scene_mhx.py b/io_import_scene_mhx.py index 765ba0d98bfe033482a813663183084fedf0c376..bc637c9eed7fd1e24aa28c1d94526be96e470779 100644 --- a/io_import_scene_mhx.py +++ b/io_import_scene_mhx.py @@ -769,9 +769,10 @@ def parseMTex(mat, args, tokens): texco = args[2] mapto = args[3] - mat.add_texture(texture = loadedData['Texture'][texname], texture_coordinates = texco, map_to = mapto) - mtex = mat.texture_slots[index] - #mat.use_textures[index] = Bool(use) + mtex = mat.texture_slots.add() + mtex.texture = loadedData['Texture'][texname] + mtex.texture_coords = texco + mtex.use_map_color_diffuse = True # XXX, fixme, mapto not used for (key, val, sub) in tokens: defaultKey(key, val, sub, "mtex", [], globals(), locals()) diff --git a/object_cloud_gen.py b/object_cloud_gen.py index d2336c633953103e553149ec33f463fd88cca97f..956120bbe5eff5e3484158d48ae2b7fb69673a0f 100644 --- a/object_cloud_gen.py +++ b/object_cloud_gen.py @@ -513,7 +513,10 @@ class GenerateCloud(bpy.types.Operator): cloudtex = blend_data.textures.new("CloudTex", type='CLOUDS') cloudtex.noise_type = 'HARD_NOISE' cloudtex.noise_scale = 2 - cloudMaterial.add_texture(cloudtex, 'ORCO') + mtex = cloudMaterial.texture_slots.add() + mtex.texture = cloudtex + mtex.texture_coords = 'ORCO' + mtex.use_map_color_diffuse = True # Add a force field to the points. cloudField = bounds.field @@ -531,10 +534,14 @@ class GenerateCloud(bpy.types.Operator): # Add a Point Density texture pDensity = blend_data.textures.new("CloudPointDensity", 'POINT_DENSITY') - cloudMaterial.add_texture(pDensity, 'ORCO') - vMaterialTextureSlots[1].use_map_density = True - vMaterialTextureSlots[1].use_rgb_to_intensity = True - vMaterialTextureSlots[1].texture_coords = 'GLOBAL' + + mtex = cloudMaterial.texture_slots.add() + mtex.texture = pDensity + mtex.texture_coords = 'GLOBAL' + mtex.use_map_density = True + mtex.use_rgb_to_intensity = True + mtex.texture_coords = 'GLOBAL' + pDensity.point_density.vertex_cache_space = 'WORLD_SPACE' pDensity.point_density.use_turbulence = True pDensity.point_density.noise_basis = 'VORONOI_F2' diff --git a/space_view3d_materials_utils.py b/space_view3d_materials_utils.py index c013e4c645043d5f945ce2c43d2c757e6a1db0c9..8417c4c527aa989c2502ba849e6bdb812bef6602 100644 --- a/space_view3d_materials_utils.py +++ b/space_view3d_materials_utils.py @@ -416,7 +416,10 @@ def check_texture(img,mat): found = True break if not found and mat: - mat.add_texture(tex, texture_coordinates='UV', map_to='COLOR') + mtex = mat.texture_slots.add() + mtex.texture = tex + mtex.texture_coords = 'UV' + mtex.use_map_color_diffuse = True def texface_to_mat(): # editmode check here!