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
bde1bc48
Commit
bde1bc48
authored
5 years ago
by
Alexander Gavrilov
Browse files
Options
Downloads
Plain Diff
Merge branch 'blender-v2.81-release'
parents
b0e3ae4b
3114f0b9
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
rigify/ui.py
+8
-1
8 additions, 1 deletion
rigify/ui.py
rigify/utils/switch_parent.py
+18
-5
18 additions, 5 deletions
rigify/utils/switch_parent.py
with
26 additions
and
6 deletions
rigify/ui.py
+
8
−
1
View file @
bde1bc48
...
...
@@ -725,7 +725,7 @@ def rigify_report_exception(operator, exception):
message
.
reverse
()
# XXX - stupid! menu's are upside down!
operator
.
report
({
'
INFO
'
},
'
\n
'
.
join
(
message
))
operator
.
report
({
'
ERROR
'
},
'
\n
'
.
join
(
message
))
class
LayerInit
(
bpy
.
types
.
Operator
):
...
...
@@ -761,6 +761,13 @@ class Generate(bpy.types.Operator):
traceback
.
print_exc
()
rigify_report_exception
(
self
,
rig_exception
)
except
Exception
as
rig_exception
:
import
traceback
traceback
.
print_exc
()
self
.
report
({
'
ERROR
'
},
'
Generation has thrown an exception:
'
+
str
(
rig_exception
))
finally
:
bpy
.
ops
.
object
.
mode_set
(
mode
=
'
OBJECT
'
)
return
{
'
FINISHED
'
}
...
...
This diff is collapsed.
Click to expand it.
rigify/utils/switch_parent.py
+
18
−
5
View file @
bde1bc48
...
...
@@ -13,7 +13,8 @@ from .misc import map_list, map_apply, force_lazy
from
..base_rig
import
*
from
..base_generate
import
GeneratorPlugin
from
itertools
import
count
,
repeat
from
collections
import
defaultdict
from
itertools
import
count
,
repeat
,
chain
def
_rig_is_child
(
rig
,
parent
):
...
...
@@ -40,7 +41,7 @@ class SwitchParentBuilder(GeneratorPlugin, MechanismUtilityMixin):
self
.
child_list
=
[]
self
.
global_parents
=
[]
self
.
local_parents
=
[]
self
.
local_parents
=
defaultdict
(
list
)
self
.
child_map
=
{}
self
.
frozen
=
False
...
...
@@ -77,7 +78,7 @@ class SwitchParentBuilder(GeneratorPlugin, MechanismUtilityMixin):
if
is_global
:
self
.
global_parents
.
append
(
entry
)
else
:
self
.
local_parents
.
append
(
entry
)
self
.
local_parents
[
id
(
rig
)]
.
append
(
entry
)
def
build_child
(
self
,
rig
,
bone
,
*
,
use_parent_mch
=
True
,
**
options
):
...
...
@@ -171,16 +172,28 @@ class SwitchParentBuilder(GeneratorPlugin, MechanismUtilityMixin):
child
[
name
]
=
value
def
get_rig_parent_candidates
(
self
,
rig
):
candidates
=
[]
# Build a list in parent hierarchy order
while
rig
:
candidates
.
append
(
self
.
local_parents
[
id
(
rig
)])
rig
=
rig
.
rigify_parent
candidates
.
append
(
self
.
global_parents
)
return
list
(
chain
.
from_iterable
(
reversed
(
candidates
)))
def
generate_bones
(
self
):
self
.
frozen
=
True
self
.
parent_list
=
self
.
global_parents
+
self
.
local_parents
self
.
parent_list
=
self
.
global_parents
+
list
(
chain
.
from_iterable
(
self
.
local_parents
.
values
()))
# Link children to parents
for
child
in
self
.
child_list
:
child_rig
=
child
[
'
context_rig
'
]
or
child
[
'
rig
'
]
parents
=
[]
for
parent
in
self
.
parent_list
:
for
parent
in
self
.
get_rig_parent_candidates
(
child_rig
)
:
if
parent
[
'
rig
'
]
is
child_rig
:
if
parent
[
'
exclude_self
'
]
or
child
[
'
exclude_self
'
]:
continue
...
...
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