diff options
author | Bastien Montagne <bastien@blender.org> | 2020-08-18 13:46:17 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-08-18 13:46:17 +0300 |
commit | 701a026d95dd80c16629540ab02bce8ba5491766 (patch) | |
tree | 0d62b00ed96af92fbc57468441863ffa7eface79 /release/scripts | |
parent | 5aecc4b57bb54464e8cc8bcf239d42c1d78322f0 (diff) | |
parent | 6df4b00f5f6f5e27b67814389bceb650ea335bc3 (diff) |
Merge branch 'blender-v2.90-release' into master
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/modules/rna_prop_ui.py | 8 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 18 |
2 files changed, 23 insertions, 3 deletions
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py index 662c1d908fc..98722ea322b 100644 --- a/release/scripts/modules/rna_prop_ui.py +++ b/release/scripts/modules/rna_prop_ui.py @@ -309,13 +309,15 @@ def draw(layout, context, context_member, property_type, use_edit=True): # Do not allow editing of overridden properties (we cannot use a poll function of the operators here # since they's have no access to the specific property...). row.enabled = not(is_lib_override and key in rna_item.id_data.override_library.reference) - if not is_rna: + if is_rna: + row.label(text="API Defined") + elif is_lib_override: + row.label(text="Library Override") + else: props = row.operator("wm.properties_edit", text="Edit") assign_props(props, val_draw, key) props = row.operator("wm.properties_remove", text="", icon='REMOVE') assign_props(props, val_draw, key) - else: - row.label(text="API Defined") del flow diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 570b4663f1d..83039a5c333 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1276,6 +1276,11 @@ class WM_OT_properties_edit(Operator): # First remove item = eval("context.%s" % data_path) + + if (item.id_data and item.id_data.override_library and item.id_data.override_library.reference): + self.report({'ERROR'}, "Cannot edit properties from override data") + return {'CANCELLED'} + prop_type_old = type(item[prop_old]) rna_idprop_ui_prop_clear(item, prop_old) @@ -1375,6 +1380,10 @@ class WM_OT_properties_edit(Operator): item = eval("context.%s" % data_path) + if (item.id_data and item.id_data.override_library and item.id_data.override_library.reference): + self.report({'ERROR'}, "Cannot edit properties from override data") + return {'CANCELLED'} + # retrieve overridable static exec_str = "item.is_property_overridable_library('[\"%s\"]')" % (self.property) self.is_overridable_library = bool(eval(exec_str)) @@ -1498,6 +1507,10 @@ class WM_OT_properties_add(Operator): data_path = self.data_path item = eval("context.%s" % data_path) + if (item.id_data and item.id_data.override_library and item.id_data.override_library.reference): + self.report({'ERROR'}, "Cannot add properties to override data") + return {'CANCELLED'} + def unique_name(names): prop = "prop" prop_new = prop @@ -1550,6 +1563,11 @@ class WM_OT_properties_remove(Operator): ) data_path = self.data_path item = eval("context.%s" % data_path) + + if (item.id_data and item.id_data.override_library and item.id_data.override_library.reference): + self.report({'ERROR'}, "Cannot remove properties from override data") + return {'CANCELLED'} + prop = self.property rna_idprop_ui_prop_update(item, prop) del item[prop] |