diff options
author | Bastien Montagne <bastien@blender.org> | 2020-07-16 12:03:11 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-07-16 12:04:03 +0300 |
commit | 7e0bf7a0f10bc86fa50ddc852a949890efc11fe2 (patch) | |
tree | 9eaac739c46a30846615efbc09cf175d840085e4 /source/blender/editors/interface/interface_ops.c | |
parent | 35bfe1702c3754af17f440c7ee7cb0e9abb8fa9d (diff) |
LibOverride: Fix getting proper RNA path and ID from embedded ones.
Master collections and root node trees should now be working as expected
in that regard.
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 5237e2ea3f7..39c1b8bb909 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -510,7 +510,8 @@ static bool override_type_set_button_poll(bContext *C) UI_context_active_but_prop_get(C, &ptr, &prop, &index); - const uint override_status = RNA_property_override_library_status(&ptr, prop, index); + const uint override_status = RNA_property_override_library_status( + CTX_data_main(C), &ptr, prop, index); return (ptr.data && prop && (override_status & RNA_OVERRIDE_STATUS_OVERRIDABLE)); } @@ -556,7 +557,7 @@ static int override_type_set_button_exec(bContext *C, wmOperator *op) } IDOverrideLibraryPropertyOperation *opop = RNA_property_override_property_operation_get( - &ptr, prop, operation, index, true, NULL, &created); + CTX_data_main(C), &ptr, prop, operation, index, true, NULL, &created); if (!created) { opop->operation = operation; } @@ -610,7 +611,8 @@ static bool override_remove_button_poll(bContext *C) UI_context_active_but_prop_get(C, &ptr, &prop, &index); - const uint override_status = RNA_property_override_library_status(&ptr, prop, index); + const uint override_status = RNA_property_override_library_status( + CTX_data_main(C), &ptr, prop, index); return (ptr.data && ptr.owner_id && prop && (override_status & RNA_OVERRIDE_STATUS_OVERRIDDEN)); } @@ -627,7 +629,7 @@ static int override_remove_button_exec(bContext *C, wmOperator *op) UI_context_active_but_prop_get(C, &ptr, &prop, &index); ID *id = ptr.owner_id; - IDOverrideLibraryProperty *oprop = RNA_property_override_property_find(&ptr, prop, &id); + IDOverrideLibraryProperty *oprop = RNA_property_override_property_find(bmain, &ptr, prop, &id); BLI_assert(oprop != NULL); BLI_assert(id != NULL && id->override_library != NULL); |