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
0ff37c16
Commit
0ff37c16
authored
13 years ago
by
Nathan Vegdahl
Browse files
Options
Downloads
Patches
Plain Diff
Rigify: fixed bug where generating failed on metarig with no animation data.
parent
1cb0ec14
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
rigify/generate.py
+40
-39
40 additions, 39 deletions
rigify/generate.py
with
40 additions
and
39 deletions
rigify/generate.py
+
40
−
39
View file @
0ff37c16
...
...
@@ -168,45 +168,46 @@ def generate_rig(context, metarig):
con2
.
target
=
obj
# Copy drivers
for
d1
in
metarig
.
animation_data
.
drivers
:
d2
=
obj
.
driver_add
(
d1
.
data_path
)
copy_attributes
(
d1
,
d2
)
copy_attributes
(
d1
.
driver
,
d2
.
driver
)
# Remove default modifiers, variables, etc.
for
m
in
d2
.
modifiers
:
d2
.
modifiers
.
remove
(
m
)
for
v
in
d2
.
driver
.
variables
:
d2
.
driver
.
variables
.
remove
(
v
)
# Copy modifiers
for
m1
in
d1
.
modifiers
:
m2
=
d2
.
modifiers
.
new
(
type
=
m1
.
type
)
copy_attributes
(
m1
,
m2
)
# Copy variables
for
v1
in
d1
.
driver
.
variables
:
v2
=
d2
.
driver
.
variables
.
new
()
copy_attributes
(
v1
,
v2
)
for
i
in
range
(
len
(
v1
.
targets
)):
copy_attributes
(
v1
.
targets
[
i
],
v2
.
targets
[
i
])
# Switch metarig targets to rig targets
if
v2
.
targets
[
i
].
id
==
metarig
:
v2
.
targets
[
i
].
id
=
obj
# Mark targets that may need to be altered after rig generation
tar
=
v2
.
targets
[
i
]
# If a custom property
if
v2
.
type
==
'
SINGLE_PROP
'
\
and
re
.
match
(
'
^pose.bones\[
"
[^
"
\]]*
"
\]\[
"
[^
"
\]]*
"
\]$
'
,
tar
.
data_path
):
tar
.
data_path
=
"
RIGIFY-
"
+
tar
.
data_path
# Copy key frames
for
i
in
range
(
len
(
d1
.
keyframe_points
)):
d2
.
keyframe_points
.
add
()
k1
=
d1
.
keyframe_points
[
i
]
k2
=
d2
.
keyframe_points
[
i
]
copy_attributes
(
k1
,
k2
)
if
metarig
.
animation_data
:
for
d1
in
metarig
.
animation_data
.
drivers
:
d2
=
obj
.
driver_add
(
d1
.
data_path
)
copy_attributes
(
d1
,
d2
)
copy_attributes
(
d1
.
driver
,
d2
.
driver
)
# Remove default modifiers, variables, etc.
for
m
in
d2
.
modifiers
:
d2
.
modifiers
.
remove
(
m
)
for
v
in
d2
.
driver
.
variables
:
d2
.
driver
.
variables
.
remove
(
v
)
# Copy modifiers
for
m1
in
d1
.
modifiers
:
m2
=
d2
.
modifiers
.
new
(
type
=
m1
.
type
)
copy_attributes
(
m1
,
m2
)
# Copy variables
for
v1
in
d1
.
driver
.
variables
:
v2
=
d2
.
driver
.
variables
.
new
()
copy_attributes
(
v1
,
v2
)
for
i
in
range
(
len
(
v1
.
targets
)):
copy_attributes
(
v1
.
targets
[
i
],
v2
.
targets
[
i
])
# Switch metarig targets to rig targets
if
v2
.
targets
[
i
].
id
==
metarig
:
v2
.
targets
[
i
].
id
=
obj
# Mark targets that may need to be altered after rig generation
tar
=
v2
.
targets
[
i
]
# If a custom property
if
v2
.
type
==
'
SINGLE_PROP
'
\
and
re
.
match
(
'
^pose.bones\[
"
[^
"
\]]*
"
\]\[
"
[^
"
\]]*
"
\]$
'
,
tar
.
data_path
):
tar
.
data_path
=
"
RIGIFY-
"
+
tar
.
data_path
# Copy key frames
for
i
in
range
(
len
(
d1
.
keyframe_points
)):
d2
.
keyframe_points
.
add
()
k1
=
d1
.
keyframe_points
[
i
]
k2
=
d2
.
keyframe_points
[
i
]
copy_attributes
(
k1
,
k2
)
t
.
tick
(
"
Duplicate rig:
"
)
#----------------------------------
...
...
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