diff options
author | Spivak Vladimir (cwolf3d) <cwolf3d@gmail.com> | 2019-07-14 01:17:09 +0300 |
---|---|---|
committer | Spivak Vladimir (cwolf3d) <cwolf3d@gmail.com> | 2019-07-14 01:17:09 +0300 |
commit | 13eb2d2e68afe6dd2f7ddd0d897718f8599baf82 (patch) | |
tree | b12e8a4b8ea53cc0aa56c796c1c1b2386f793598 /add_curve_extra_objects | |
parent | e829f3ddffd2980876027c8d0069cddcfa9911a2 (diff) |
Add Curve: Extra Objects addon: add_curve_torus_knots: error correction when creating material
Diffstat (limited to 'add_curve_extra_objects')
-rw-r--r-- | add_curve_extra_objects/add_curve_torus_knots.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/add_curve_extra_objects/add_curve_torus_knots.py b/add_curve_extra_objects/add_curve_torus_knots.py index 3b2b362c..ea00bd2a 100644 --- a/add_curve_extra_objects/add_curve_torus_knots.py +++ b/add_curve_extra_objects/add_curve_torus_knots.py @@ -269,13 +269,11 @@ def create_torus_knot(self, context): # set object in the scene scene = bpy.context.scene scene.collection.objects.link(new_obj) # place in active scene + bpy.ops.object.select_all(action='DESELECT') new_obj.select_set(True) # set as selected - #scene.objects.active = new_obj # set as active + bpy.context.view_layer.objects.active = new_obj new_obj.matrix_world = self.align_matrix # apply matrix - - # set BEZIER handles - #if splineType == 'BEZIER': - # setBezierHandles(new_obj, self.handleType) + bpy.context.view_layer.update() return @@ -331,9 +329,9 @@ def addLinkColors(self, curveData): mat.diffuse_color = (*colors[cID], 1.0) if self.options_plus: - mat.diffuse_color.s = self.saturation + mat.diffuse_color = (mat.diffuse_color[0] * self.saturation, mat.diffuse_color[1] * self.saturation, mat.diffuse_color[2] * self.saturation, 1.0) else: - mat.diffuse_color.s = 0.75 + mat.diffuse_color = (mat.diffuse_color[0] * 0.75, mat.diffuse_color[1] * 0.75, mat.diffuse_color[2] * 0.75, 1.0) me.materials.append(mat) |