Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
13eb2d2e
Commit
13eb2d2e
authored
5 years ago
by
Spivak Vladimir (cwolf3d)
Browse files
Options
Downloads
Patches
Plain Diff
Add Curve: Extra Objects addon: add_curve_torus_knots: error correction when creating material
parent
e829f3dd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
add_curve_extra_objects/add_curve_torus_knots.py
+5
-7
5 additions, 7 deletions
add_curve_extra_objects/add_curve_torus_knots.py
with
5 additions
and
7 deletions
add_curve_extra_objects/add_curve_torus_knots.py
+
5
−
7
View file @
13eb2d2e
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment