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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-06-15 00:16:04 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-06-15 00:21:12 +0300
commit23254ce4ee6b21b202549b421cf1d98f6a03b33d (patch)
tree77ebd72c7f1cd2776e058f04b5e6e49f14a327ec /source/blender/editors/interface
parentf64070185808f153d141b26e63942424a1b258b1 (diff)
Cleanup: Rename: Static Override -> Library Override.
Better to make internal code naming match official/UI naming to some extent, this will reduce confusion in the future. This is 'breaking' scripts and files that would use that feature, but since it is not yet officially supported nor exposed in 2.80, as far as that release is concerned, it is effectively a 'no functional changes' commit.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface.c2
-rw-r--r--source/blender/editors/interface/interface_context_menu.c2
-rw-r--r--source/blender/editors/interface/interface_ops.c36
-rw-r--r--source/blender/editors/interface/interface_templates.c43
4 files changed, 41 insertions, 42 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 2154ac4a7f6..8ee78e661d8 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1462,7 +1462,7 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
void ui_but_override_flag(uiBut *but)
{
- const int override_status = RNA_property_static_override_status(
+ const int override_status = RNA_property_override_library_status(
&but->rnapoin, but->rnaprop, but->rnaindex);
if (override_status & RNA_OVERRIDE_STATUS_OVERRIDDEN) {
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c
index 71026e79f60..36e197a0591 100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@ -524,7 +524,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
const bool is_array = RNA_property_array_length(&but->rnapoin, but->rnaprop) != 0;
const bool is_array_component = (is_array && but->rnaindex != -1);
- const int override_status = RNA_property_static_override_status(ptr, prop, -1);
+ const int override_status = RNA_property_override_library_status(ptr, prop, -1);
const bool is_overridable = (override_status & RNA_OVERRIDE_STATUS_OVERRIDABLE) != 0;
/* Set the (button_pointer, button_prop)
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 768cc32aeb5..b08810c966b 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -430,7 +430,7 @@ static bool override_type_set_button_poll(bContext *C)
UI_context_active_but_prop_get(C, &ptr, &prop, &index);
- const int override_status = RNA_property_static_override_status(&ptr, prop, index);
+ const int override_status = RNA_property_override_library_status(&ptr, prop, index);
return (ptr.data && prop && (override_status & RNA_OVERRIDE_STATUS_OVERRIDABLE));
}
@@ -448,20 +448,20 @@ static int override_type_set_button_exec(bContext *C, wmOperator *op)
switch (op_type) {
case UIOverride_Type_NOOP:
- operation = IDOVERRIDESTATIC_OP_NOOP;
+ operation = IDOVERRIDE_LIBRARY_OP_NOOP;
break;
case UIOverride_Type_Replace:
- operation = IDOVERRIDESTATIC_OP_REPLACE;
+ operation = IDOVERRIDE_LIBRARY_OP_REPLACE;
break;
case UIOverride_Type_Difference:
/* override code will automatically switch to subtract if needed. */
- operation = IDOVERRIDESTATIC_OP_ADD;
+ operation = IDOVERRIDE_LIBRARY_OP_ADD;
break;
case UIOverride_Type_Factor:
- operation = IDOVERRIDESTATIC_OP_MULTIPLY;
+ operation = IDOVERRIDE_LIBRARY_OP_MULTIPLY;
break;
default:
- operation = IDOVERRIDESTATIC_OP_REPLACE;
+ operation = IDOVERRIDE_LIBRARY_OP_REPLACE;
BLI_assert(0);
break;
}
@@ -475,7 +475,7 @@ static int override_type_set_button_exec(bContext *C, wmOperator *op)
index = -1;
}
- IDOverrideStaticPropertyOperation *opop = RNA_property_override_property_operation_get(
+ IDOverrideLibraryPropertyOperation *opop = RNA_property_override_property_operation_get(
&ptr, prop, operation, index, true, NULL, &created);
if (!created) {
opop->operation = operation;
@@ -491,7 +491,7 @@ static int override_type_set_button_invoke(bContext *C,
#if 0 /* Disabled for now */
return WM_menu_invoke_ex(C, op, WM_OP_INVOKE_DEFAULT);
#else
- RNA_enum_set(op->ptr, "type", IDOVERRIDESTATIC_OP_REPLACE);
+ RNA_enum_set(op->ptr, "type", IDOVERRIDE_LIBRARY_OP_REPLACE);
return override_type_set_button_exec(C, op);
#endif
}
@@ -530,7 +530,7 @@ static bool override_remove_button_poll(bContext *C)
UI_context_active_but_prop_get(C, &ptr, &prop, &index);
- const int override_status = RNA_property_static_override_status(&ptr, prop, index);
+ const int override_status = RNA_property_override_library_status(&ptr, prop, index);
return (ptr.data && ptr.id.data && prop && (override_status & RNA_OVERRIDE_STATUS_OVERRIDDEN));
}
@@ -547,16 +547,16 @@ static int override_remove_button_exec(bContext *C, wmOperator *op)
UI_context_active_but_prop_get(C, &ptr, &prop, &index);
ID *id = ptr.id.data;
- IDOverrideStaticProperty *oprop = RNA_property_override_property_find(&ptr, prop);
+ IDOverrideLibraryProperty *oprop = RNA_property_override_property_find(&ptr, prop);
BLI_assert(oprop != NULL);
- BLI_assert(id != NULL && id->override_static != NULL);
+ BLI_assert(id != NULL && id->override_library != NULL);
- const bool is_template = (id->override_static->reference == NULL);
+ const bool is_template = (id->override_library->reference == NULL);
/* We need source (i.e. linked data) to restore values of deleted overrides...
* If this is an override template, we obviously do not need to restore anything. */
if (!is_template) {
- RNA_id_pointer_create(id->override_static->reference, &id_refptr);
+ RNA_id_pointer_create(id->override_library->reference, &id_refptr);
if (!RNA_path_resolve(&id_refptr, oprop->rna_path, &src, NULL)) {
BLI_assert(0 && "Failed to create matching source (linked data) RNA pointer");
}
@@ -566,7 +566,7 @@ static int override_remove_button_exec(bContext *C, wmOperator *op)
bool is_strict_find;
/* Remove override operation for given item,
* add singular operations for the other items as needed. */
- IDOverrideStaticPropertyOperation *opop = BKE_override_static_property_operation_find(
+ IDOverrideLibraryPropertyOperation *opop = BKE_override_library_property_operation_find(
oprop, NULL, NULL, index, index, false, &is_strict_find);
BLI_assert(opop != NULL);
if (!is_strict_find) {
@@ -575,22 +575,22 @@ static int override_remove_button_exec(bContext *C, wmOperator *op)
* before removing generic one. */
for (int idx = RNA_property_array_length(&ptr, prop); idx--;) {
if (idx != index) {
- BKE_override_static_property_operation_get(
+ BKE_override_library_property_operation_get(
oprop, opop->operation, NULL, NULL, idx, idx, true, NULL, NULL);
}
}
}
- BKE_override_static_property_operation_delete(oprop, opop);
+ BKE_override_library_property_operation_delete(oprop, opop);
if (!is_template) {
RNA_property_copy(bmain, &ptr, &src, prop, index);
}
if (BLI_listbase_is_empty(&oprop->operations)) {
- BKE_override_static_property_delete(id->override_static, oprop);
+ BKE_override_library_property_delete(id->override_library, oprop);
}
}
else {
/* Just remove whole generic override operation of this property. */
- BKE_override_static_property_delete(id->override_static, oprop);
+ BKE_override_library_property_delete(id->override_library, oprop);
if (!is_template) {
RNA_property_copy(bmain, &ptr, &src, prop, -1);
}
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 4efa024ac77..58d352ac8d1 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -515,8 +515,8 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
case UI_ID_LOCAL:
if (id) {
Main *bmain = CTX_data_main(C);
- if (BKE_override_static_is_enabled() && CTX_wm_window(C)->eventstate->shift) {
- ID *override_id = BKE_override_static_create_from_id(bmain, id);
+ if (BKE_override_library_is_enabled() && CTX_wm_window(C)->eventstate->shift) {
+ ID *override_id = BKE_override_library_create_from_id(bmain, id);
if (override_id != NULL) {
BKE_main_id_clear_newpoins(bmain);
@@ -537,8 +537,8 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
}
break;
case UI_ID_OVERRIDE:
- if (id && id->override_static) {
- BKE_override_static_free(&id->override_static);
+ if (id && id->override_library) {
+ BKE_override_library_free(&id->override_library);
/* reassign to get get proper updates/notifiers */
idptr = RNA_property_pointer_get(&template_ui->ptr, template_ui->prop);
RNA_property_pointer_set(&template_ui->ptr, template_ui->prop, idptr, NULL);
@@ -856,9 +856,9 @@ static void template_ID(bContext *C,
0,
0,
0,
- BKE_override_static_is_enabled() ?
+ BKE_override_library_is_enabled() ?
TIP_("Direct linked library data-block, click to make local, "
- "Shift + Click to create a static override") :
+ "Shift + Click to create a library override") :
TIP_("Direct linked library data-block, click to make local"));
if (disabled) {
UI_but_flag_enable(but, UI_BUT_DISABLED);
@@ -869,22 +869,21 @@ static void template_ID(bContext *C,
}
}
}
- else if (ID_IS_STATIC_OVERRIDE(id)) {
- but = uiDefIconBut(
- block,
- UI_BTYPE_BUT,
- 0,
- ICON_LIBRARY_DATA_OVERRIDE,
- 0,
- 0,
- UI_UNIT_X,
- UI_UNIT_Y,
- NULL,
- 0,
- 0,
- 0,
- 0,
- TIP_("Static override of linked library data-block, click to make fully local"));
+ else if (ID_IS_OVERRIDE_LIBRARY(id)) {
+ but = uiDefIconBut(block,
+ UI_BTYPE_BUT,
+ 0,
+ ICON_LIBRARY_DATA_OVERRIDE,
+ 0,
+ 0,
+ UI_UNIT_X,
+ UI_UNIT_Y,
+ NULL,
+ 0,
+ 0,
+ 0,
+ 0,
+ TIP_("Library override of linked data-block, click to make fully local"));
UI_but_funcN_set(
but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_OVERRIDE));
}