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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2015-01-26 16:09:50 +0300
committerJoshua Leung <aligorith@gmail.com>2015-01-26 16:10:26 +0300
commite0ee74a171135e0e13a65eb60fc352eb34ada542 (patch)
tree96be4d96a77c3b15d880360e43fa6a964d662c85 /release/scripts/startup/bl_ui/properties_scene.py
parentb648ba4103f73e085fb27fa144f886f7464eeb20 (diff)
Fix T38619: Confusing logic for Keying Set keyframing Settings
The logic used for determining whether certain keyframing settings (i.e. visual, only needed, xyz -> rgb) got applied was wonky. The original intention here was that the Keying Set settings would override the global settings, and the path settings would override what was used for the Keying Set. However, that was not happening in all cases previously, as it was only possible to add flags and not to turn them off. This commit fixes that by introducing separate toggles to control whether the Keying Set/Path's settings override the settings inherited from its parent (i.e. the Keying Set for the Path, and the User Prefs for the Keying Set). The icons used for these toggles could get revised a bit (we need something which communicates "override this"; the current one is the closest I could find) WARNING: If you have old keying sets, this may cause some breakage!
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_scene.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_scene.py58
1 files changed, 50 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index 5d822cef9af..5e4c9314479 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -85,7 +85,53 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel):
row.prop(unit, "use_separate")
-class SCENE_PT_keying_sets(SceneButtonsPanel, Panel):
+class SceneKeyingSetsPanel():
+ def draw_keyframing_settings(self, context, layout, ks, ksp):
+ self.draw_keyframing_setting(context, layout, ks, ksp, "Needed",
+ "use_insertkey_override_needed", "use_insertkey_needed",
+ userpref_fallback="use_keyframe_insert_needed")
+
+ self.draw_keyframing_setting(context, layout, ks, ksp, "Visual",
+ "use_insertkey_override_visual", "use_insertkey_visual",
+ userpref_fallback="use_visual_keying")
+
+ self.draw_keyframing_setting(context, layout, ks, ksp, "XYZ to RGB",
+ "use_insertkey_override_xyz_to_rgb", "use_insertkey_xyz_to_rgb")
+
+ def draw_keyframing_setting(self, context, layout, ks, ksp, label, toggle_prop, prop, userpref_fallback=None):
+ if ksp:
+ item = ksp
+
+ if getattr(ks, toggle_prop):
+ owner = ks
+ propname = prop
+ else:
+ owner = context.user_preferences.edit
+ if userpref_fallback:
+ propname = userpref_fallback
+ else:
+ propname = prop
+ else:
+ item = ks
+
+ owner = context.user_preferences.edit
+ if userpref_fallback:
+ propname = userpref_fallback
+ else:
+ propname = prop
+
+ row = layout.row(align=True)
+ row.prop(item, toggle_prop, text="", icon='STYLUS_PRESSURE', toggle=True) # XXX: needs dedicated icon
+
+ subrow = row.row()
+ subrow.active = getattr(item, toggle_prop)
+ if subrow.active:
+ subrow.prop(item, prop, text=label)
+ else:
+ subrow.prop(owner, propname, text=label)
+
+
+class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
bl_label = "Keying Sets"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -115,12 +161,10 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, Panel):
col = row.column()
col.label(text="Keyframing Settings:")
- col.prop(ks, "use_insertkey_needed", text="Needed")
- col.prop(ks, "use_insertkey_visual", text="Visual")
- col.prop(ks, "use_insertkey_xyz_to_rgb", text="XYZ to RGB")
+ self.draw_keyframing_settings(context, col, ks, None)
-class SCENE_PT_keying_set_paths(SceneButtonsPanel, Panel):
+class SCENE_PT_keying_set_paths(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
bl_label = "Active Keying Set"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@@ -173,9 +217,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, Panel):
col = row.column()
col.label(text="Keyframing Settings:")
- col.prop(ksp, "use_insertkey_needed", text="Needed")
- col.prop(ksp, "use_insertkey_visual", text="Visual")
- col.prop(ksp, "use_insertkey_xyz_to_rgb", text="XYZ to RGB")
+ self.draw_keyframing_settings(context, col, ks, ksp)
class SCENE_PT_color_management(SceneButtonsPanel, Panel):