[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [977] trunk/py/scripts/addons: update for changes in rna io_import_scene_mhx. py mapto isnt working as it should since this can now only be accessed as many bools
Campbell Barton
ideasman42 at gmail.com
Fri Sep 3 17:05:18 CEST 2010
Revision: 977
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=977
Author: campbellbarton
Date: 2010-09-03 17:05:18 +0200 (Fri, 03 Sep 2010)
Log Message:
-----------
update for changes in rna io_import_scene_mhx.py mapto isnt working as it should since this can now only be accessed as many bools
Modified Paths:
--------------
trunk/py/scripts/addons/io_import_images_as_planes.py
trunk/py/scripts/addons/io_import_scene_mhx.py
trunk/py/scripts/addons/object_cloud_gen.py
trunk/py/scripts/addons/space_view3d_materials_utils.py
Modified: trunk/py/scripts/addons/io_import_images_as_planes.py
===================================================================
--- trunk/py/scripts/addons/io_import_images_as_planes.py 2010-09-03 12:41:24 UTC (rev 976)
+++ trunk/py/scripts/addons/io_import_images_as_planes.py 2010-09-03 15:05:18 UTC (rev 977)
@@ -231,7 +231,11 @@
# ... 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
Modified: trunk/py/scripts/addons/io_import_scene_mhx.py
===================================================================
--- trunk/py/scripts/addons/io_import_scene_mhx.py 2010-09-03 12:41:24 UTC (rev 976)
+++ trunk/py/scripts/addons/io_import_scene_mhx.py 2010-09-03 15:05:18 UTC (rev 977)
@@ -769,9 +769,10 @@
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())
Modified: trunk/py/scripts/addons/object_cloud_gen.py
===================================================================
--- trunk/py/scripts/addons/object_cloud_gen.py 2010-09-03 12:41:24 UTC (rev 976)
+++ trunk/py/scripts/addons/object_cloud_gen.py 2010-09-03 15:05:18 UTC (rev 977)
@@ -513,7 +513,10 @@
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 @@
# 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'
Modified: trunk/py/scripts/addons/space_view3d_materials_utils.py
===================================================================
--- trunk/py/scripts/addons/space_view3d_materials_utils.py 2010-09-03 12:41:24 UTC (rev 976)
+++ trunk/py/scripts/addons/space_view3d_materials_utils.py 2010-09-03 15:05:18 UTC (rev 977)
@@ -416,7 +416,10 @@
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!
More information about the Bf-extensions-cvs
mailing list