diff options
author | Maurice Raybaud <mauriceraybaud@hotmail.fr> | 2019-11-24 23:15:49 +0300 |
---|---|---|
committer | Maurice Raybaud <mauriceraybaud@hotmail.fr> | 2019-11-24 23:15:49 +0300 |
commit | 14d4b8f4e936d37eb783ae7368549f6b98d34761 (patch) | |
tree | 085560b632b1a03083200435a9fafc27b8cb27be /render_povray | |
parent | a96fa1e6111a62ac0d179e149419844b71323996 (diff) |
pov 2.8 fixes
primitive grid radius became size and noise deprecated
Diffstat (limited to 'render_povray')
-rw-r--r-- | render_povray/primitives.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/render_povray/primitives.py b/render_povray/primitives.py index ef2da230..75aa2d25 100644 --- a/render_povray/primitives.py +++ b/render_povray/primitives.py @@ -1126,8 +1126,8 @@ class POVRAY_OT_height_field_add(bpy.types.Operator, ImportHelper): hf_tex = bpy.data.textures.new('%s_hf_image'%im_name, type = 'IMAGE') hf_tex.image = img mat = bpy.data.materials.new('Tex_%s_hf'%im_name) - hf_slot = mat.pov_texture_slots.create(-1) - hf_slot.texture = hf_tex + hf_slot = mat.pov_texture_slots.add() + hf_slot.texture = hf_tex.name #layers = 20*[False] #layers[0] = True quality = props.quality @@ -1135,12 +1135,12 @@ class POVRAY_OT_height_field_add(bpy.types.Operator, ImportHelper): w,h = hf_tex.image.size[:] w = int(w/res) h = int(h/res) - bpy.ops.mesh.primitive_grid_add(x_subdivisions=w, y_subdivisions=h,radius = 0.5) + bpy.ops.mesh.primitive_grid_add(x_subdivisions=w, y_subdivisions=h,size = 0.5) ob = context.object ob.name = ob.data.name = '%s'%im_name ob.data.materials.append(mat) bpy.ops.object.mode_set(mode="EDIT") - bpy.ops.mesh.noise(factor=1) + # bpy.ops.mesh.noise(factor=1) # TODO replace by a displace modifier as noise deprecated in 2.8 bpy.ops.object.mode_set(mode="OBJECT") #needs a loop to select by index? @@ -1148,7 +1148,7 @@ class POVRAY_OT_height_field_add(bpy.types.Operator, ImportHelper): #material just left there for now - mat.texture_slots.clear(-1) + mat.pov_texture_slots.clear() bpy.ops.object.mode_set(mode="EDIT") bpy.ops.mesh.hide(unselected=False) bpy.ops.object.mode_set(mode="OBJECT") |