Bug fix: The quick effect operators got broken a bit by the new material slot behavior.
* The operators now add new materials and assign them to the created material slots explicitly.
This commit is contained in:
@@ -163,8 +163,8 @@ class MakeSmoke(bpy.types.Operator):
|
||||
# create a volume material with a voxel data texture for the domain
|
||||
bpy.ops.object.material_slot_add({"object": obj})
|
||||
|
||||
mat = obj.material_slots[0].material
|
||||
mat.name = "Smoke Domain Material"
|
||||
mat = bpy.data.materials.new("Smoke Domain Material");
|
||||
obj.material_slots[0].material = mat
|
||||
mat.type = 'VOLUME'
|
||||
mat.volume.density = 0
|
||||
mat.volume.density_scale = 5
|
||||
@@ -274,9 +274,10 @@ class MakeFluid(bpy.types.Operator):
|
||||
|
||||
# create a ray-transparent material for the domain
|
||||
bpy.ops.object.material_slot_add({"object": obj})
|
||||
|
||||
mat = bpy.data.materials.new("Fluid Domain Material");
|
||||
obj.material_slots[0].material = mat
|
||||
|
||||
mat = obj.material_slots[0].material
|
||||
mat.name = "Fluid Domain Material"
|
||||
mat.specular_intensity = 1
|
||||
mat.specular_hardness = 100
|
||||
mat.use_transparency = True
|
||||
|
||||
Reference in New Issue
Block a user