Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDemeter Dzadik <Mets>2021-12-14 14:44:52 +0300
committerDemeter Dzadik <demeter@blender.studio>2021-12-14 14:44:56 +0300
commitece39d809ceb27b5a06da7c4b8f25ca77016b151 (patch)
tree787ff10a2b854a36d5b756e35ec03561cc8eb9ee /rigify/rig_ui_template.py
parentc60fef38175ad989ee0c45e924cb27e1417c8667 (diff)
Rigify: Clean up "Rigify Buttons" panel UX
The overall goal of this patch is to improve the UI/UX of the panel previously known as "Rigify Buttons" which presumably takes its name from the old "Buttons Panel" which is now known as the Properties Editor. Before: {F10511640} After: {F10511624} - Make Rigify less reliant on name matching when it comes to maintaining the link between the metarig, the UI script, the generated rig, and the widgets collection. (Use pointers only, names shouldn't matter!) - Change the "Advanced" toggle button into a real sub-panel. - Split up the "Rigify Buttons" panels into "Rigify Generation" and "Rigify Samples" panels in non-edit and edit mode respectively, to better describe what the user will find there. Changes in the Rigify Buttons panel: - Removed the "overwrite/new" enum. - If there is a target rig object, it will be overwritten. If not, it will be created. - If a rig object with the desired name already existed, but wasn't selected as the target rig, the "overwrite" option still overwrote that rig. I don't agree with that because this meant messing with data without indicating that that data is going to be messed with. Unaware users could lose data/work. With these changes, the worst thing that can happen is that your rig ends up with a .001 suffix. - Removed the "rig name" text input field. Before this patch, this would always rename your rig object and your rig script text datablock, which I think is more frustrating than useful. Now you can simply rename them after generation yourself, and the names will be kept in subsequent generations. - Single-column layout - Changed the "Advanced Options" into a sub-panel instead. On request: - Added an info message to show the name of the successfully generated rig: {F10159079} Feedback welcome. Reviewed By: angavrilov Differential Revision: https://developer.blender.org/D11356
Diffstat (limited to 'rigify/rig_ui_template.py')
-rw-r--r--rigify/rig_ui_template.py25
1 files changed, 4 insertions, 21 deletions
diff --git a/rigify/rig_ui_template.py b/rigify/rig_ui_template.py
index c83dd02b..8780461d 100644
--- a/rigify/rig_ui_template.py
+++ b/rigify/rig_ui_template.py
@@ -1167,27 +1167,10 @@ class ScriptGenerator(base_generate.GeneratorPlugin):
layer_layout += [(l.name, l.row)]
# Generate the UI script
- if metarig.data.rigify_rig_basename:
- rig_ui_name = metarig.data.rigify_rig_basename + '_ui.py'
- else:
- rig_ui_name = 'rig_ui.py'
-
- script = None
-
- if metarig.data.rigify_generate_mode == 'overwrite':
- script = metarig.data.rigify_rig_ui
-
- if not script and rig_ui_name in bpy.data.texts:
- script = bpy.data.texts[rig_ui_name]
-
- if script:
- script.clear()
- script.name = rig_ui_name
-
- if script is None:
- script = bpy.data.texts.new(rig_ui_name)
-
- metarig.data.rigify_rig_ui = script
+ script = metarig.data.rigify_rig_ui
+ if not script:
+ script = bpy.data.texts.new("rig_ui.py")
+ metarig.data.rigify_rig_ui = script
for s in OrderedDict.fromkeys(self.ui_imports):
script.write(s + "\n")