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
e529d0d0
Commit
e529d0d0
authored
14 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
fix for rigify with data editing restriction, store runtime props in the window manager.
parent
9d4e9bdc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
rigify/__init__.py
+8
-6
8 additions, 6 deletions
rigify/__init__.py
rigify/ui.py
+18
-16
18 additions, 16 deletions
rigify/ui.py
with
26 additions
and
22 deletions
rigify/__init__.py
+
8
−
6
View file @
e529d0d0
...
@@ -125,9 +125,10 @@ def register():
...
@@ -125,9 +125,10 @@ def register():
bpy
.
types
.
PoseBone
.
rigify_type
=
bpy
.
props
.
StringProperty
(
name
=
"
Rigify Type
"
,
description
=
"
Rig type for this bone.
"
)
bpy
.
types
.
PoseBone
.
rigify_type
=
bpy
.
props
.
StringProperty
(
name
=
"
Rigify Type
"
,
description
=
"
Rig type for this bone.
"
)
bpy
.
types
.
PoseBone
.
rigify_parameters
=
bpy
.
props
.
CollectionProperty
(
type
=
RigifyParameters
)
bpy
.
types
.
PoseBone
.
rigify_parameters
=
bpy
.
props
.
CollectionProperty
(
type
=
RigifyParameters
)
bpy
.
types
.
Scene
.
rigify_collection
=
bpy
.
props
.
EnumProperty
(
items
=
col_enum_list
,
default
=
"
All
"
,
name
=
"
Rigify Active Collection
"
,
description
=
"
The selected rig collection
"
)
IDStore
=
bpy
.
types
.
WindowManager
bpy
.
types
.
Scene
.
rigify_types
=
bpy
.
props
.
CollectionProperty
(
type
=
RigifyName
)
IDStore
.
rigify_collection
=
bpy
.
props
.
EnumProperty
(
items
=
col_enum_list
,
default
=
"
All
"
,
name
=
"
Rigify Active Collection
"
,
description
=
"
The selected rig collection
"
)
bpy
.
types
.
Scene
.
rigify_active_type
=
bpy
.
props
.
IntProperty
(
name
=
"
Rigify Active Type
"
,
description
=
"
The selected rig type.
"
)
IDStore
.
rigify_types
=
bpy
.
props
.
CollectionProperty
(
type
=
RigifyName
)
IDStore
.
rigify_active_type
=
bpy
.
props
.
IntProperty
(
name
=
"
Rigify Active Type
"
,
description
=
"
The selected rig type.
"
)
metarig_menu
.
register
()
metarig_menu
.
register
()
...
@@ -136,9 +137,10 @@ def unregister():
...
@@ -136,9 +137,10 @@ def unregister():
del
bpy
.
types
.
PoseBone
.
rigify_type
del
bpy
.
types
.
PoseBone
.
rigify_type
del
bpy
.
types
.
PoseBone
.
rigify_parameters
del
bpy
.
types
.
PoseBone
.
rigify_parameters
del
bpy
.
types
.
Scene
.
rigify_collection
IDStore
=
bpy
.
types
.
WindowManager
del
bpy
.
types
.
Scene
.
rigify_types
del
IDStore
.
rigify_collection
del
bpy
.
types
.
Scene
.
rigify_active_type
del
IDStore
.
rigify_types
del
IDStore
.
rigify_active_type
metarig_menu
.
unregister
()
metarig_menu
.
unregister
()
This diff is collapsed.
Click to expand it.
rigify/ui.py
+
18
−
16
View file @
e529d0d0
...
@@ -45,39 +45,40 @@ class DATA_PT_rigify_buttons(bpy.types.Panel):
...
@@ -45,39 +45,40 @@ class DATA_PT_rigify_buttons(bpy.types.Panel):
C
=
context
C
=
context
layout
=
self
.
layout
layout
=
self
.
layout
obj
=
context
.
object
obj
=
context
.
object
id_store
=
C
.
window_manager
if
obj
.
mode
in
(
'
POSE
'
,
'
OBJECT
'
):
if
obj
.
mode
in
(
'
POSE
'
,
'
OBJECT
'
):
row
=
layout
.
row
()
row
=
layout
.
row
()
row
.
operator
(
"
pose.rigify_generate
"
,
text
=
"
Generate
"
)
row
.
operator
(
"
pose.rigify_generate
"
,
text
=
"
Generate
"
)
elif
obj
.
mode
==
'
EDIT
'
:
elif
obj
.
mode
==
'
EDIT
'
:
# Build types list
# Build types list
collection_name
=
str
(
C
.
scen
e
.
rigify_collection
).
replace
(
"
"
,
""
)
collection_name
=
str
(
id_stor
e
.
rigify_collection
).
replace
(
"
"
,
""
)
for
i
in
range
(
0
,
len
(
C
.
scen
e
.
rigify_types
)):
for
i
in
range
(
0
,
len
(
id_stor
e
.
rigify_types
)):
C
.
scen
e
.
rigify_types
.
remove
(
0
)
id_stor
e
.
rigify_types
.
remove
(
0
)
for
r
in
rigify
.
rig_list
:
for
r
in
rigify
.
rig_list
:
collection
=
r
.
split
(
'
.
'
)[
0
]
collection
=
r
.
split
(
'
.
'
)[
0
]
if
collection_name
==
"
All
"
:
if
collection_name
==
"
All
"
:
a
=
C
.
scen
e
.
rigify_types
.
add
()
a
=
id_stor
e
.
rigify_types
.
add
()
a
.
name
=
r
a
.
name
=
r
elif
r
.
startswith
(
collection_name
+
'
.
'
):
elif
r
.
startswith
(
collection_name
+
'
.
'
):
a
=
C
.
scen
e
.
rigify_types
.
add
()
a
=
id_stor
e
.
rigify_types
.
add
()
a
.
name
=
r
a
.
name
=
r
elif
collection_name
==
"
None
"
and
len
(
r
.
split
(
'
.
'
))
==
1
:
elif
collection_name
==
"
None
"
and
len
(
r
.
split
(
'
.
'
))
==
1
:
a
=
C
.
scen
e
.
rigify_types
.
add
()
a
=
id_stor
e
.
rigify_types
.
add
()
a
.
name
=
r
a
.
name
=
r
## Rig collection field
## Rig collection field
#row = layout.row()
#row = layout.row()
#row.prop(
C.scen
e, 'rigify_collection', text="Category")
#row.prop(
id_stor
e, 'rigify_collection', text="Category")
# Rig type list
# Rig type list
row
=
layout
.
row
()
row
=
layout
.
row
()
row
.
template_list
(
C
.
scen
e
,
"
rigify_types
"
,
C
.
scen
e
,
'
rigify_active_type
'
)
row
.
template_list
(
id_stor
e
,
"
rigify_types
"
,
id_stor
e
,
'
rigify_active_type
'
)
row
=
layout
.
row
()
row
=
layout
.
row
()
op
=
row
.
operator
(
"
armature.metarig_sample_add
"
,
text
=
"
Add sample
"
)
op
=
row
.
operator
(
"
armature.metarig_sample_add
"
,
text
=
"
Add sample
"
)
op
.
metarig_type
=
C
.
scen
e
.
rigify_types
[
C
.
scen
e
.
rigify_active_type
].
name
op
.
metarig_type
=
id_stor
e
.
rigify_types
[
id_stor
e
.
rigify_active_type
].
name
class
BONE_PT_rigify_buttons
(
bpy
.
types
.
Panel
):
class
BONE_PT_rigify_buttons
(
bpy
.
types
.
Panel
):
...
@@ -98,31 +99,32 @@ class BONE_PT_rigify_buttons(bpy.types.Panel):
...
@@ -98,31 +99,32 @@ class BONE_PT_rigify_buttons(bpy.types.Panel):
def
draw
(
self
,
context
):
def
draw
(
self
,
context
):
C
=
context
C
=
context
id_store
=
C
.
window_manager
bone
=
context
.
active_pose_bone
bone
=
context
.
active_pose_bone
collection_name
=
str
(
C
.
scen
e
.
rigify_collection
).
replace
(
"
"
,
""
)
collection_name
=
str
(
id_stor
e
.
rigify_collection
).
replace
(
"
"
,
""
)
rig_name
=
str
(
context
.
active_pose_bone
.
rigify_type
).
replace
(
"
"
,
""
)
rig_name
=
str
(
context
.
active_pose_bone
.
rigify_type
).
replace
(
"
"
,
""
)
layout
=
self
.
layout
layout
=
self
.
layout
# Build types list
# Build types list
for
i
in
range
(
0
,
len
(
C
.
scen
e
.
rigify_types
)):
for
i
in
range
(
0
,
len
(
id_stor
e
.
rigify_types
)):
C
.
scen
e
.
rigify_types
.
remove
(
0
)
id_stor
e
.
rigify_types
.
remove
(
0
)
for
r
in
rigify
.
rig_list
:
for
r
in
rigify
.
rig_list
:
collection
=
r
.
split
(
'
.
'
)[
0
]
collection
=
r
.
split
(
'
.
'
)[
0
]
if
collection_name
==
"
All
"
:
if
collection_name
==
"
All
"
:
a
=
C
.
scen
e
.
rigify_types
.
add
()
a
=
id_stor
e
.
rigify_types
.
add
()
a
.
name
=
r
a
.
name
=
r
elif
r
.
startswith
(
collection_name
+
'
.
'
):
elif
r
.
startswith
(
collection_name
+
'
.
'
):
a
=
C
.
scen
e
.
rigify_types
.
add
()
a
=
id_stor
e
.
rigify_types
.
add
()
a
.
name
=
r
a
.
name
=
r
elif
collection_name
==
"
None
"
and
len
(
r
.
split
(
'
.
'
))
==
1
:
elif
collection_name
==
"
None
"
and
len
(
r
.
split
(
'
.
'
))
==
1
:
a
=
C
.
scen
e
.
rigify_types
.
add
()
a
=
id_stor
e
.
rigify_types
.
add
()
a
.
name
=
r
a
.
name
=
r
# Rig type field
# Rig type field
row
=
layout
.
row
()
row
=
layout
.
row
()
row
.
prop_search
(
bone
,
"
rigify_type
"
,
C
.
scen
e
,
"
rigify_types
"
,
text
=
"
Rig type:
"
)
row
.
prop_search
(
bone
,
"
rigify_type
"
,
id_stor
e
,
"
rigify_types
"
,
text
=
"
Rig type:
"
)
# Rig type parameters / Rig type non-exist alert
# Rig type parameters / Rig type non-exist alert
if
rig_name
!=
""
:
if
rig_name
!=
""
:
...
...
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