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-08-18 20:23:01 +0300
committerDemeter Dzadik <demeter@blender.studio>2021-08-18 20:36:02 +0300
commit9a7afcbcae91978db8173e205f0ec73f1d6ad440 (patch)
tree4988c90ccd139ac3f3998bab1ffb0c101e4da6c7 /rigify/rig_ui_template.py
parent9ffc56b3b7fbc1b76ff50d32ab791d27f28b2d2b (diff)
Rigify: Clean up "Rigify Buttons" panel UX
The UX for this panel felt like it could use a facelift. It was extremely ugly to look at, nothing about it was done the correct way and it broke every possible modern Blender UI convention it could. Before/After: {F10135475} {F10159077} After generating a rig: {F10159078} - Removed the "overwrite/new" enum. - If there is a target rig object, we overwrite. If not, we create. I think that's intuitive behaviour without the extra UI element. - 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. - Renamed the panel from "Rigify Buttons" to "Rigify Generation" in pose/object mode and "Rigify Samples" in edit mode. - Changed the "Advanced Options" into a sub-panel instead. - Single column layout. - Added an info message to show the name of the successfully generated rig: {F10159079} Feedback welcome. 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")