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
b3716b48
Commit
b3716b48
authored
6 years ago
by
Spivak Vladimir (cwolf3d)
Browse files
Options
Downloads
Patches
Plain Diff
implementation of adding curly (add_curve_curly) in edit mode
parent
77f53216
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
add_curve_extra_objects/__init__.py
+2
-3
2 additions, 3 deletions
add_curve_extra_objects/__init__.py
add_curve_extra_objects/add_curve_curly.py
+51
-24
51 additions, 24 deletions
add_curve_extra_objects/add_curve_curly.py
with
53 additions
and
27 deletions
add_curve_extra_objects/__init__.py
+
2
−
3
View file @
b3716b48
...
@@ -248,14 +248,13 @@ def menu_func(self, context):
...
@@ -248,14 +248,13 @@ def menu_func(self, context):
layout
.
operator_menu_enum
(
"
curve.curveaceous_galore
"
,
"
ProfileType
"
,
icon
=
'
CURVE_DATA
'
)
layout
.
operator_menu_enum
(
"
curve.curveaceous_galore
"
,
"
ProfileType
"
,
icon
=
'
CURVE_DATA
'
)
layout
.
operator_menu_enum
(
"
curve.spirals
"
,
"
spiral_type
"
,
icon
=
'
CURVE_DATA
'
)
layout
.
operator_menu_enum
(
"
curve.spirals
"
,
"
spiral_type
"
,
icon
=
'
CURVE_DATA
'
)
layout
.
separator
()
layout
.
operator
(
"
curve.curlycurve
"
,
text
=
"
Curly Curve
"
,
icon
=
'
CURVE_DATA
'
)
if
context
.
mode
!=
'
OBJECT
'
:
if
context
.
mode
!=
'
OBJECT
'
:
# fix in D2142 will allow to work in EDIT_CURVE
# fix in D2142 will allow to work in EDIT_CURVE
return
None
return
None
layout
.
separator
()
layout
.
separator
()
layout
.
menu
(
INFO_MT_curve_knots_add
.
bl_idname
,
text
=
"
Knots
"
,
icon
=
'
CURVE_DATA
'
)
layout
.
menu
(
INFO_MT_curve_knots_add
.
bl_idname
,
text
=
"
Knots
"
,
icon
=
'
CURVE_DATA
'
)
layout
.
separator
()
layout
.
operator
(
"
curve.curlycurve
"
,
text
=
"
Curly Curve
"
,
icon
=
'
CURVE_DATA
'
)
#layout.menu(VIEW3D_MT_bevel_taper_curve_menu, text="Bevel/Taper", icon='CURVE_DATA')
#layout.menu(VIEW3D_MT_bevel_taper_curve_menu, text="Bevel/Taper", icon='CURVE_DATA')
...
...
This diff is collapsed.
Click to expand it.
add_curve_extra_objects/add_curve_curly.py
+
51
−
24
View file @
b3716b48
...
@@ -179,11 +179,13 @@ def add_type2(self, context):
...
@@ -179,11 +179,13 @@ def add_type2(self, context):
scale_x
=
self
.
scale_x
scale_x
=
self
.
scale_x
scale_y
=
self
.
scale_y
scale_y
=
self
.
scale_y
verts
=
[
verts
=
[
[
-
0.719632
*
scale_x
,
-
0.08781
*
scale_y
,
[
-
0.719632
*
scale_x
,
-
0.08781
*
scale_y
,
0.0
,
0.0
,
-
0.605138
*
scale_x
,
-
0.31612
*
scale_y
,
-
0.605138
*
scale_x
,
-
0.31612
*
scale_y
,
0.0
,
0.0
,
-
0.935392
*
scale_x
,
0.0
,
0.0
,
0.0
,
0.0
,
-
0.935392
*
scale_x
,
0.0
,
0.0
,
0.0
,
0.935392
*
scale_x
,
0.0
,
0.0
,
0.605138
*
scale_x
,
0.0
,
0.0
,
0.0
,
-
0.316119
*
scale_y
,
0.0
,
0.719632
*
scale_x
,
-
0.08781
*
scale_y
,
0.0
]
0.935392
*
scale_x
,
0.0
,
0.0
,
0.605138
*
scale_x
,
-
0.316119
*
scale_y
,
0.0
,
0.719632
*
scale_x
,
-
0.08781
*
scale_y
,
0.0
]
]
]
lhandles
=
[
lhandles
=
[
[(
-
0.82125
*
scale_x
,
-
0.142999
*
scale_y
,
0.0
),
[(
-
0.82125
*
scale_x
,
-
0.142999
*
scale_y
,
0.0
),
...
@@ -380,26 +382,51 @@ def add_type1(self, context):
...
@@ -380,26 +382,51 @@ def add_type1(self, context):
def
make_curve
(
self
,
context
,
verts
,
lh
,
rh
):
def
make_curve
(
self
,
context
,
verts
,
lh
,
rh
):
types
=
self
.
types
types
=
self
.
types
curve_data
=
bpy
.
data
.
curves
.
new
(
name
=
'
CurlyCurve
'
,
type
=
'
CURVE
'
)
curve_data
.
dimensions
=
'
3D
'
for
p
in
range
(
len
(
verts
)):
c
=
0
spline
=
curve_data
.
splines
.
new
(
type
=
'
BEZIER
'
)
spline
.
bezier_points
.
add
(
len
(
verts
[
p
])
/
3
-
1
)
spline
.
bezier_points
.
foreach_set
(
'
co
'
,
verts
[
p
])
for
bp
in
spline
.
bezier_points
:
bp
.
handle_left_type
=
'
ALIGNED
'
bp
.
handle_right_type
=
'
ALIGNED
'
bp
.
handle_left
.
xyz
=
lh
[
p
][
c
]
bp
.
handle_right
.
xyz
=
rh
[
p
][
c
]
c
+=
1
# something weird with this one
if
types
==
1
or
types
==
2
or
types
==
3
:
spline
.
bezier_points
[
3
].
handle_left
.
xyz
=
lh
[
p
][
3
]
object_data_add
(
context
,
curve_data
,
operator
=
self
)
# create object
if
bpy
.
context
.
mode
==
'
EDIT_CURVE
'
:
Curve
=
context
.
active_object
for
p
in
range
(
len
(
verts
)):
c
=
0
newSpline
=
Curve
.
data
.
splines
.
new
(
type
=
'
BEZIER
'
)
# newSpline
newSpline
.
bezier_points
.
add
(
len
(
verts
[
p
])
/
3
-
1
)
newSpline
.
bezier_points
.
foreach_set
(
'
co
'
,
verts
[
p
])
for
bp
in
newSpline
.
bezier_points
:
bp
.
handle_left_type
=
'
ALIGNED
'
bp
.
handle_right_type
=
'
ALIGNED
'
bp
.
handle_left
.
xyz
=
lh
[
p
][
c
]
bp
.
handle_right
.
xyz
=
rh
[
p
][
c
]
c
+=
1
# something weird with this one
if
types
==
1
or
types
==
2
or
types
==
3
:
newSpline
.
bezier_points
[
3
].
handle_left
.
xyz
=
lh
[
p
][
3
]
else
:
# create curve
newCurve
=
bpy
.
data
.
curves
.
new
(
name
=
'
CurlyCurve
'
,
type
=
'
CURVE
'
)
# curvedatablock
for
p
in
range
(
len
(
verts
)):
c
=
0
newSpline
=
newCurve
.
splines
.
new
(
type
=
'
BEZIER
'
)
# newSpline
newSpline
.
bezier_points
.
add
(
len
(
verts
[
p
])
/
3
-
1
)
newSpline
.
bezier_points
.
foreach_set
(
'
co
'
,
verts
[
p
])
for
bp
in
newSpline
.
bezier_points
:
bp
.
handle_left_type
=
'
ALIGNED
'
bp
.
handle_right_type
=
'
ALIGNED
'
bp
.
handle_left
.
xyz
=
lh
[
p
][
c
]
bp
.
handle_right
.
xyz
=
rh
[
p
][
c
]
c
+=
1
# something weird with this one
if
types
==
1
or
types
==
2
or
types
==
3
:
newSpline
.
bezier_points
[
3
].
handle_left
.
xyz
=
lh
[
p
][
3
]
# create object with newCurve
Curve
=
object_data_add
(
context
,
newCurve
,
operator
=
self
)
# place in active scene
Curve
.
select_set
(
True
)
# set curveOptions
Curve
.
data
.
dimensions
=
'
3D
'
Curve
.
data
.
use_path
=
True
class
add_curlycurve
(
Operator
,
AddObjectHelper
):
class
add_curlycurve
(
Operator
,
AddObjectHelper
):
bl_idname
=
"
curve.curlycurve
"
bl_idname
=
"
curve.curlycurve
"
...
...
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