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
d35c99fb
Commit
d35c99fb
authored
14 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
update for changes in rna
parent
d7752e1b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
add_mesh_gears.py
+10
-10
10 additions, 10 deletions
add_mesh_gears.py
io_import_scene_mhx.py
+2
-2
2 additions, 2 deletions
io_import_scene_mhx.py
with
12 additions
and
12 deletions
add_mesh_gears.py
+
10
−
10
View file @
d35c99fb
...
...
@@ -40,9 +40,9 @@ unchanged (add_tooth, add_spoke, add_gear)
Also, the vertex group API is changed a little bit but the concepts
are the same:
=========
vertexgroup = ob.
add_
vertex_group(
'
NAME_OF_VERTEXGROUP
'
)
vertexgroup = ob.vertex_group
s.new
(
'
NAME_OF_VERTEXGROUP
'
)
for i in vertexgroup_vertex_indices:
ob.
add_
vertex_
to_
group(i, vertexgroup, weight,
'
ADD
'
)
ob.vertex_group
s.assign_vertex
(i, vertexgroup, weight,
'
ADD
'
)
=========
Now for some reason the name does not
'
stick
'
and we have to set it this way:
...
...
@@ -784,13 +784,13 @@ class AddGear(bpy.types.Operator):
obj
=
create_mesh_object
(
context
,
verts
,
[],
faces
,
"
Gear
"
,
props
.
edit
,
self
.
align_matrix
)
# Create vertex groups from stored vertices.
tipGroup
=
obj
.
add_
vertex_group
(
'
Tips
'
)
tipGroup
=
obj
.
vertex_group
s
.
new
(
'
Tips
'
)
for
vert
in
verts_tip
:
obj
.
add_
vertex_
to_
group
(
vert
,
tipGroup
,
1.0
,
'
ADD
'
)
obj
.
vertex_group
s
.
assign
(
vert
,
tipGroup
,
1.0
,
'
ADD
'
)
valleyGroup
=
obj
.
add_
vertex_group
(
'
Valleys
'
)
valleyGroup
=
obj
.
vertex_group
s
.
new
(
'
Valleys
'
)
for
vert
in
verts_valley
:
obj
.
add_
vertex_
to_
group
(
vert
,
valleyGroup
,
1.0
,
'
ADD
'
)
obj
.
vertex_group
s
.
assign
(
vert
,
valleyGroup
,
1.0
,
'
ADD
'
)
return
{
'
FINISHED
'
}
...
...
@@ -892,13 +892,13 @@ class AddWormGear(bpy.types.Operator):
props
.
edit
,
self
.
align_matrix
)
# Create vertex groups from stored vertices.
tipGroup
=
obj
.
add_
vertex_group
(
'
Tips
'
)
tipGroup
=
obj
.
vertex_group
s
.
new
(
'
Tips
'
)
for
vert
in
verts_tip
:
obj
.
add_
vertex_
to_
group
(
vert
,
tipGroup
,
1.0
,
'
ADD
'
)
obj
.
vertex_group
s
.
assign
(
vert
,
tipGroup
,
1.0
,
'
ADD
'
)
valleyGroup
=
obj
.
add_
vertex_group
(
'
Valleys
'
)
valleyGroup
=
obj
.
vertex_group
s
.
new
(
'
Valleys
'
)
for
vert
in
verts_valley
:
obj
.
add_
vertex_
to_
group
(
vert
,
valleyGroup
,
1.0
,
'
ADD
'
)
obj
.
vertex_group
s
.
assign
(
vert
,
valleyGroup
,
1.0
,
'
ADD
'
)
return
{
'
FINISHED
'
}
...
...
This diff is collapsed.
Click to expand it.
io_import_scene_mhx.py
+
2
−
2
View file @
d35c99fb
...
...
@@ -1260,12 +1260,12 @@ def parseVertexGroup(ob, me, args, tokens):
return
if
(
toggle
&
T_Armature
)
or
(
grpName
in
[
'
Eye_L
'
,
'
Eye_R
'
,
'
Gums
'
,
'
Head
'
,
'
Jaw
'
,
'
Left
'
,
'
Middle
'
,
'
Right
'
,
'
Scalp
'
]):
group
=
ob
.
add_
vertex_group
(
grpName
)
group
=
ob
.
vertex_group
s
.
new
(
grpName
)
group
.
name
=
grpName
loadedData
[
'
VertexGroup
'
][
grpName
]
=
group
for
(
key
,
val
,
sub
)
in
tokens
:
if
key
==
'
wv
'
:
ob
.
add_
vertex_
to_
group
(
int
(
val
[
0
]),
group
,
float
(
val
[
1
]),
'
REPLACE
'
)
ob
.
vertex_group
s
.
assign
(
int
(
val
[
0
]),
group
,
float
(
val
[
1
]),
'
REPLACE
'
)
return
...
...
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