[Bf-extensions-cvs] [14d4b8f4] master: pov 2.8 fixes
Maurice Raybaud
noreply at git.blender.org
Sun Nov 24 21:15:54 CET 2019
Commit: 14d4b8f4e936d37eb783ae7368549f6b98d34761
Author: Maurice Raybaud
Date: Sun Nov 24 21:15:49 2019 +0100
Branches: master
https://developer.blender.org/rBA14d4b8f4e936d37eb783ae7368549f6b98d34761
pov 2.8 fixes
primitive grid radius became size and noise deprecated
===================================================================
M render_povray/primitives.py
===================================================================
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")
More information about the Bf-extensions-cvs
mailing list