From 2e2d7c7a52b818329189ac63188212b2d8108aeb Mon Sep 17 00:00:00 2001 From: Campbell Barton <ideasman42@gmail.com> Date: Sat, 21 Aug 2010 05:27:49 +0000 Subject: [PATCH] update for changes in rna --- io_import_images_as_planes.py | 30 +++++++++++++-------------- io_import_scene_mhx.py | 12 +++++------ object_add_chain.py | 4 ++-- object_cloud_gen.py | 36 ++++++++++++++++----------------- render_povray/render.py | 10 ++++----- space_view3d_materials_utils.py | 4 ++-- 6 files changed, 48 insertions(+), 48 deletions(-) diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py index 53a7e9ed7..36e13d97a 100644 --- a/io_import_images_as_planes.py +++ b/io_import_images_as_planes.py @@ -262,8 +262,8 @@ def getTexture(path, img): def mapget(self): """Custom property of the images_as_planes addon.""" mapping = [] - mapping.append(self.shadeless) - mapping.append(self.transparency) + mapping.append(self.use_shadeless) + mapping.append(self.use_transparency) mapping.append(self.alpha) mapping.append(self.specular_alpha) mapping.append(self.transparency_method) @@ -271,7 +271,7 @@ def mapget(self): if (self.texture_slots[0] and self.texture_slots[0].texture.type == 'IMAGE' and self.texture_slots[0].texture.image): - mapping.append(self.texture_slots[0].texture.image.premultiply) + mapping.append(self.texture_slots[0].texture.image.use_premultiply) else: mapping.append("no image") @@ -281,8 +281,8 @@ def mapget(self): # Custom material property - set def mapset(self, value): - self.shadeless = value[0] - self.transparency = value[1] + self.use_shadeless = value[0] + self.use_transparency = value[1] self.alpha = float(value[2]) self.specular_alpha = float(value[3]) self.transparency_method = value[4] @@ -290,9 +290,9 @@ def mapset(self, value): if (self.texture_slots[0] and self.texture_slots[0].texture.type == 'IMAGE' and self.texture_slots[0].texture.image): - self.texture_slots[0].texture.image.premultiply = value[5] + self.texture_slots[0].texture.image.use_premultiply = value[5] if self.alpha: - self.texture_slots[0].map_alpha=True + self.texture_slots[0].use_map_alpha=True bpy.types.Material.mapping = property(mapget, mapset) @@ -330,8 +330,8 @@ def main(filePath, options, mapping, dimension): # Put Image into UVTextureLayer plane.data.uv_textures[0].data[0].image = img - plane.data.uv_textures[0].data[0].use_texture = True - plane.data.uv_textures[0].data[0].blend_mode = 'ALPHA' + plane.data.uv_textures[0].data[0].use_image = True + plane.data.uv_textures[0].data[0].blend_type = 'ALPHA' plane.data.uv_textures[0].data[0].use_twoside = True plane.select = True @@ -359,8 +359,8 @@ def main(filePath, options, mapping, dimension): # Put image into UVTextureLayer plane.data.uv_textures[0].data[0].image = img - plane.data.uv_textures[0].data[0].use_texture = True - plane.data.uv_textures[0].data[0].blend_mode = 'ALPHA' + plane.data.uv_textures[0].data[0].use_image = True + plane.data.uv_textures[0].data[0].blend_type = 'ALPHA' plane.data.uv_textures[0].data[0].use_twoside = True plane.select = True @@ -448,9 +448,9 @@ class ImportImagesAsPlanes(bpy.types.Operator): box.prop(props, 'extension', icon='FILE_IMAGE') box = layout.box() box.label('Material mappings:', icon='MATERIAL') - box.prop(props, 'shadeless') + box.prop(props, 'use_shadeless') box.prop(props, 'transp') - box.prop(props, 'premultiply') + box.prop(props, 'use_premultiply') box.prop(props, 'transp_method', expand=True) box = layout.box() box.label('Plane dimensions:', icon='ARROW_LEFTRIGHT') @@ -475,9 +475,9 @@ class ImportImagesAsPlanes(bpy.types.Operator): if transp: alphavalue = 0 - shadeless = self.properties.shadeless + shadeless = self.properties.use_shadeless transp_method = self.properties.transp_method - premultiply = self.properties.premultiply + premultiply = self.properties.use_premultiply mapping = ([shadeless, transp, diff --git a/io_import_scene_mhx.py b/io_import_scene_mhx.py index d745f8981..8c55c2621 100644 --- a/io_import_scene_mhx.py +++ b/io_import_scene_mhx.py @@ -608,7 +608,7 @@ def parseActionFCurve(act, ob, args, tokens): if key == 'kp': try: pt = fcu.keyframe_points[n] - pt.interpolation = 'LINEAR' + pt.use_interpolation = 'LINEAR' pt = parseKeyFramePoint(pt, val, sub) n += 1 except: @@ -759,7 +759,7 @@ def parseMaterial(args, tokens): elif key == 'Strand': parseStrand(mat, val, sub) else: - exclude = ['specular_intensity', 'tangent_shading'] + exclude = ['specular_intensity', 'use_tangent_shading'] defaultKey(key, val, sub, 'mat', [], globals(), locals()) #print("Done ", mat) @@ -1549,9 +1549,9 @@ def parsePoseBone(pbones, ob, args, tokens): exec(expr) print("show_alive") elif key == 'ik_dof': - parseArray(pb, ["ik_dof_x", "ik_dof_y", "ik_dof_z"], val) + parseArray(pb, ["lock_ik_x", "lock_ik_y", "lock_ik_z"], val) elif key == 'ik_limit': - parseArray(pb, ["ik_limit_x", "ik_limit_y", "ik_limit_z"], val) + parseArray(pb, ["use_ik_limit_x", "use_ik_limit_y", "use_ik_limit_z"], val) elif key == 'ik_max': parseArray(pb, ["ik_max_x", "ik_max_y", "ik_max_z"], val) elif key == 'ik_min': @@ -1591,9 +1591,9 @@ def parseConstraint(constraints, args, tokens): elif key == 'use': parseArray(cns, ["use_x", "use_y", "use_z"], val) elif key == 'pos_lock': - parseArray(cns, ["pos_lock_x", "pos_lock_y", "pos_lock_z"], val) + parseArray(cns, ["lock_location_x", "lock_location_y", "lock_location_z"], val) elif key == 'rot_lock': - parseArray(cns, ["rot_lock_x", "rot_lock_y", "rot_lock_z"], val) + parseArray(cns, ["lock_rotation_x", "lock_rotation_y", "lock_rotation_z"], val) else: defaultKey(key, val, sub, "cns", [], globals(), locals()) #print("cns %s done" % cns.name) diff --git a/object_add_chain.py b/object_add_chain.py index 5c766af44..ee4448995 100644 --- a/object_add_chain.py +++ b/object_add_chain.py @@ -104,8 +104,8 @@ release_confirm=False) array.fit_type = ('FIT_CURVE') array.curve = curv array.offset_object = emp - array.add_offset_object = True - array.relative_offset_displacement = [ 0.549, 0, 0 ] + array.use_object_offset = True + array.relative_offset_displace = [ 0.549, 0, 0 ] ##Add curve modifier bpy.ops.object.modifier_add(type='CURVE') diff --git a/object_cloud_gen.py b/object_cloud_gen.py index 7ab039786..5122871ea 100644 --- a/object_cloud_gen.py +++ b/object_cloud_gen.py @@ -376,7 +376,7 @@ class GenerateCloud(bpy.types.Operator): # Select all of the left over boxes so people can immediately # press generate again if they want. for eachMember in definitionObjects: - eachMember.max_draw_type = 'SOLID' + eachMember.draw_type = 'SOLID' eachMember.select = True #scene.objects.active = eachMember @@ -397,7 +397,7 @@ class GenerateCloud(bpy.types.Operator): "CloudBounds", selectedObjects[0]) - bounds.max_draw_type = 'BOUNDS' + bounds.draw_type = 'BOUNDS' bounds.hide_render = False # Just add a Definition Property designating this @@ -421,14 +421,14 @@ class GenerateCloud(bpy.types.Operator): for selObj in selectedObjects: selObj["CloudMember"] = "DefinitioinObj" selObj.name = "DefinitioinObj" - selObj.max_draw_type = 'WIRE' + selObj.draw_type = 'WIRE' selObj.hide_render = True makeParent(bounds, selObj, scene) # Do the same to the 1. object since it is no longer in list. firstObject["CloudMember"] = "DefinitioinObj" firstObject.name = "DefinitioinObj" - firstObject.max_draw_type = 'WIRE' + firstObject.draw_type = 'WIRE' firstObject.hide_render = True makeParent(bounds, firstObject, scene) @@ -436,7 +436,7 @@ class GenerateCloud(bpy.types.Operator): # Create a new object cloud. cloud = addNewObject(scene, "CloudMesh", bounds) cloud["CloudMember"] = "CreatedObj" - cloud.max_draw_type = 'WIRE' + cloud.draw_type = 'WIRE' cloud.hide_render = True makeParent(bounds, cloud, scene) @@ -466,8 +466,8 @@ class GenerateCloud(bpy.types.Operator): cloudParticles.settings.frame_start = 0 cloudParticles.settings.frame_end = 0 cloudParticles.settings.emit_from = 'VOLUME' - cloudParticles.settings.draw_as = 'DOT' - cloudParticles.settings.ren_as = 'NONE' + cloudParticles.settings.draw_method = 'DOT' + cloudParticles.settings.render_type = 'NONE' cloudParticles.settings.normal_factor = 0 cloudParticles.settings.distribution = 'RAND' cloudParticles.settings.physics_type = 'NO' @@ -502,7 +502,7 @@ class GenerateCloud(bpy.types.Operator): mVolume.density_scale = densityScale mVolume.transmission_color = [3, 3, 3] mVolume.step_size = 0.1 - mVolume.light_cache = True + mVolume.use_light_cache = True mVolume.cache_resolution = 75 # Add a texture @@ -511,7 +511,7 @@ class GenerateCloud(bpy.types.Operator): cloudMaterial.add_texture(cloudtex, 'ORCO') cloudtex.type = 'CLOUDS' cloudtex.noise_type = 'HARD_NOISE' - cloudtex.noise_size = 2 + cloudtex.noise_scale = 2 # Add a force field to the points. cloudField = bounds.field @@ -532,17 +532,17 @@ class GenerateCloud(bpy.types.Operator): cloudPointDensity.type = 'POINT_DENSITY' cloudMaterial.add_texture(cloudPointDensity, 'ORCO') pDensity = vMaterialTextureSlots[1].texture - vMaterialTextureSlots[1].map_density = True - vMaterialTextureSlots[1].rgb_to_intensity = True - vMaterialTextureSlots[1].texture_coordinates = 'GLOBAL' - pDensity.point_density.vertices_cache = 'WORLD_SPACE' - pDensity.point_density.turbulence = True + vMaterialTextureSlots[1].use_map_density = True + vMaterialTextureSlots[1].use_rgb_to_intensity = True + vMaterialTextureSlots[1].texture_coords = 'GLOBAL' + pDensity.point_density.vertex_cache_space = 'WORLD_SPACE' + pDensity.point_density.use_turbulence = True pDensity.point_density.noise_basis = 'VORONOI_F2' pDensity.point_density.turbulence_depth = 3 pDensity.use_color_ramp = True pRamp = pDensity.color_ramp - pRamp.interpolation = 'LINEAR' + pRamp.use_interpolation = 'LINEAR' pRampElements = pRamp.elements #pRampElements[1].position = .9 #pRampElements[1].color = [.18,.18,.18,.8] @@ -572,7 +572,7 @@ class GenerateCloud(bpy.types.Operator): # Create a new object cloudPnts cloudPnts = addNewObject(scene, "CloudPoints", bounds) cloudPnts["CloudMember"] = "CreatedObj" - cloudPnts.max_draw_type = 'WIRE' + cloudPnts.draw_type = 'WIRE' cloudPnts.hide_render = True makeParent(bounds, cloudPnts, scene) @@ -605,7 +605,7 @@ class GenerateCloud(bpy.types.Operator): cldPntsModifiers = cloudPnts.modifiers cldPntsModifiers[0].name = "CloudPnts" cldPntsModifiers[0].texture = cloudtex - cldPntsModifiers[0].texture_coordinates = 'OBJECT' + cldPntsModifiers[0].texture_coords = 'OBJECT' cldPntsModifiers[0].texture_coordinate_object = cloud cldPntsModifiers[0].strength = -1.4 @@ -638,7 +638,7 @@ class GenerateCloud(bpy.types.Operator): mVolume.density_scale = 2.22 pDensity.point_density.turbulence_depth = 10 pDensity.point_density.turbulence_strength = 6.3 - pDensity.point_density.turbulence_size = 2.9 + pDensity.point_density.turbulence_scale = 2.9 pRampElements[1].position = .606 pDensity.point_density.radius = pDensity.point_density.radius + .1 diff --git a/render_povray/render.py b/render_povray/render.py index ae222da25..c6ece409e 100644 --- a/render_povray/render.py +++ b/render_povray/render.py @@ -188,7 +188,7 @@ def write_pov(filename, scene=None, info_callback=None): samples_y = lamp.shadow_ray_samples_y file.write('\tarea_light <%d,0,0>,<0,0,%d> %d, %d\n' % (size_x, size_y, samples_x, samples_y)) - if lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED': + if lamp.shadow_ray_sample_method == 'CONSTANT_JITTERED': if lamp.jitter: file.write('\tjitter\n') else: @@ -246,7 +246,7 @@ def write_pov(filename, scene=None, info_callback=None): if material: diffuse_color = material.diffuse_color - if material.transparency and material.transparency_method == 'RAYTRACE': + if material.use_transparency and material.transparency_method == 'RAYTRACE': trans = 1.0 - material.raytrace_transparency.filter else: trans = 0.0 @@ -377,7 +377,7 @@ def write_pov(filename, scene=None, info_callback=None): material_index = f.material_index material = me_materials[material_index] - if material and material.vertex_color_paint: + if material and material.use_vertex_color_paint: col = vcol_layer[fi] @@ -417,7 +417,7 @@ def write_pov(filename, scene=None, info_callback=None): material = me_materials[col[3]] material_finish = materialNames[material.name] - if material.transparency and material.transparency_method == 'RAYTRACE': + if material.use_transparency and material.transparency_method == 'RAYTRACE': trans = 1.0 - material.raytrace_transparency.filter else: trans = 0.0 @@ -461,7 +461,7 @@ def write_pov(filename, scene=None, info_callback=None): else: material = me_materials[material_index] for i1, i2, i3 in indicies: - if me.vertex_colors and material.vertex_color_paint: + if me.vertex_colors and material.use_vertex_color_paint: # Colour per vertex - vertex colour col1 = cols[i1] diff --git a/space_view3d_materials_utils.py b/space_view3d_materials_utils.py index 683d2b505..68e748d30 100644 --- a/space_view3d_materials_utils.py +++ b/space_view3d_materials_utils.py @@ -213,9 +213,9 @@ def mat_to_texface(): #check that material had an image! if images[f.material_index] != None: uvtex[f.index].image = images[f.material_index] - uvtex[f.index].use_texture = True + uvtex[f.index].use_image = True else: - uvtex[f.index].use_texture = False + uvtex[f.index].use_image = False me.update() -- GitLab