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:
authorOmar Emara <mail@OmarEmara.dev>2021-11-19 16:58:37 +0300
committerOmar Emara <mail@OmarEmara.dev>2021-11-19 16:58:37 +0300
commit0852805ed771043f43752658bb763983a8aae408 (patch)
tree8d77c8a13cd783c4932c8a937176209e92ad551f /source/blender
parent06691d1b21fe06c86876c78e45ca75cb1aa048ae (diff)
parenta20e703d1a5cc0d3e4294825e31609d9b92da06d (diff)
Merge branch 'blender-v3.0-release'
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_lib_id.h3
-rw-r--r--source/blender/blenkernel/intern/constraint.c5
-rw-r--r--source/blender/blenkernel/intern/lib_override.c5
-rw-r--r--source/blender/editors/object/object_constraint.c18
-rw-r--r--source/blender/editors/space_node/drawnode.cc4
-rw-r--r--source/blender/makesrna/intern/rna_constraint.c9
-rw-r--r--source/blender/makesrna/intern/rna_gpencil_modifier.c10
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c9
-rw-r--r--source/blender/makesrna/intern/rna_nla.c9
-rw-r--r--source/blender/makesrna/intern/rna_object.c1
-rw-r--r--source/blender/makesrna/intern/rna_pose.c1
11 files changed, 64 insertions, 10 deletions
diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h
index 4faf6d94df8..359fb72534a 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -123,6 +123,9 @@ enum {
LIB_ID_COPY_CD_REFERENCE = 1 << 20,
/** Do not copy id->override_library, used by ID datablock override routines. */
LIB_ID_COPY_NO_LIB_OVERRIDE = 1 << 21,
+ /** When copying local sub-data (like constraints or modifiers), do not set their "library
+ * override local data" flag. */
+ LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG = 1 << 22,
/* *** XXX Hackish/not-so-nice specific behaviors needed for some corner cases. *** */
/* *** Ideally we should not have those, but we need them for now... *** */
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index beaf2f2be9a..3455baa9292 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -6022,7 +6022,6 @@ bConstraint *BKE_constraint_duplicate_ex(bConstraint *src, const int flag, const
bConstraint *dst = MEM_dupallocN(src);
constraint_copy_data_ex(dst, src, flag, do_extern);
dst->next = dst->prev = NULL;
- dst->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
return dst;
}
@@ -6057,7 +6056,9 @@ void BKE_constraints_copy_ex(ListBase *dst, const ListBase *src, const int flag,
for (con = dst->first, srccon = src->first; con && srccon;
srccon = srccon->next, con = con->next) {
constraint_copy_data_ex(con, srccon, flag, do_extern);
- con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
+ if ((flag & LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG) == 0) {
+ con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
+ }
}
}
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c
index dcdcaf0793a..66a550ec6b0 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -2874,7 +2874,10 @@ void BKE_lib_override_library_update(Main *bmain, ID *local)
* Not impossible to do, but would rather see first if extra useless usual user handling
* is actually a (performances) issue here. */
- ID *tmp_id = BKE_id_copy(bmain, local->override_library->reference);
+ ID *tmp_id = BKE_id_copy_ex(bmain,
+ local->override_library->reference,
+ NULL,
+ LIB_ID_COPY_DEFAULT | LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG);
if (tmp_id == NULL) {
return;
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 8702b18a46f..47c2998ed3d 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -1449,7 +1449,9 @@ void ED_object_constraint_link(Main *bmain, Object *ob_dst, ListBase *dst, ListB
void ED_object_constraint_copy_for_object(Main *bmain, Object *ob_dst, bConstraint *con)
{
- BKE_constraint_copy_for_object(ob_dst, con);
+ bConstraint *copy_con = BKE_constraint_copy_for_object(ob_dst, con);
+ copy_con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
+
ED_object_constraint_dependency_tag_update(bmain, ob_dst, con);
WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, ob_dst);
}
@@ -1459,7 +1461,9 @@ void ED_object_constraint_copy_for_pose(Main *bmain,
bPoseChannel *pchan,
bConstraint *con)
{
- BKE_constraint_copy_for_pose(ob_dst, pchan, con);
+ bConstraint *copy_con = BKE_constraint_copy_for_pose(ob_dst, pchan, con);
+ copy_con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
+
ED_object_constraint_dependency_tag_update(bmain, ob_dst, con);
WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, ob_dst);
}
@@ -1654,6 +1658,8 @@ static int constraint_copy_exec(bContext *C, wmOperator *op)
/* Couldn't remove due to some invalid data. */
return OPERATOR_CANCELLED;
}
+ copy_con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
+
/* Move constraint to correct position. */
const int new_index = BLI_findindex(constraints, con) + 1;
const int current_index = BLI_findindex(constraints, copy_con);
@@ -1731,7 +1737,9 @@ static int constraint_copy_to_selected_exec(bContext *C, wmOperator *op)
continue;
}
- BKE_constraint_copy_for_pose(ob, chan, con);
+ bConstraint *copy_con = BKE_constraint_copy_for_pose(ob, chan, con);
+ copy_con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
+
/* Update flags (need to add here, not just copy). */
chan->constflag |= pchan->constflag;
@@ -1753,7 +1761,9 @@ static int constraint_copy_to_selected_exec(bContext *C, wmOperator *op)
continue;
}
- BKE_constraint_copy_for_object(ob, con);
+ bConstraint *copy_con = BKE_constraint_copy_for_object(ob, con);
+ copy_con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
+
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY | ID_RECALC_TRANSFORM);
}
CTX_DATA_END;
diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc
index bb57a65eb49..cf79893a8cb 100644
--- a/source/blender/editors/space_node/drawnode.cc
+++ b/source/blender/editors/space_node/drawnode.cc
@@ -4313,9 +4313,7 @@ void node_draw_link_bezier(const bContext *C,
}
if (snode->overlay.flag & SN_OVERLAY_SHOW_OVERLAYS &&
- snode->overlay.flag & SN_OVERLAY_SHOW_WIRE_COLORS &&
- ((link->fromsock == nullptr || link->fromsock->typeinfo->type >= 0) &&
- (link->tosock == nullptr || link->tosock->typeinfo->type >= 0))) {
+ snode->overlay.flag & SN_OVERLAY_SHOW_WIRE_COLORS) {
PointerRNA from_node_ptr, to_node_ptr;
RNA_pointer_create((ID *)snode->edittree, &RNA_Node, link->fromnode, &from_node_ptr);
RNA_pointer_create((ID *)snode->edittree, &RNA_Node, link->tonode, &to_node_ptr);
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c
index 5968c8bac8f..bde348c1848 100644
--- a/source/blender/makesrna/intern/rna_constraint.c
+++ b/source/blender/makesrna/intern/rna_constraint.c
@@ -3474,6 +3474,15 @@ void RNA_def_constraint(BlenderRNA *brna)
RNA_def_property_enum_items(prop, rna_enum_constraint_type_items);
RNA_def_property_ui_text(prop, "Type", "");
+ prop = RNA_def_boolean(srna,
+ "is_override_data",
+ false,
+ "Override Constraint",
+ "In a local override object, whether this constraint comes from the "
+ "linked reference object, or is local to the override");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_OVERRIDE_LIBRARY_LOCAL);
+
RNA_define_lib_overridable(true);
prop = RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index a62c27f5f4b..82f3279146a 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -3738,6 +3738,16 @@ void RNA_def_greasepencil_modifier(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1);
+ prop = RNA_def_boolean(srna,
+ "is_override_data",
+ false,
+ "Override Modifier",
+ "In a local override object, whether this modifier comes from the linked "
+ "reference object, or is local to the override");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_negative_sdna(
+ prop, NULL, "flag", eGpencilModifierFlag_OverrideLibrary_Local);
+
/* types */
rna_def_modifier_gpencilnoise(brna);
rna_def_modifier_gpencilsmooth(brna);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 028b6b6e11f..9ad6771cda3 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -7245,6 +7245,15 @@ void RNA_def_modifier(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Active", "The active modifier in the list");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL);
+ prop = RNA_def_boolean(srna,
+ "is_override_data",
+ false,
+ "Override Modifier",
+ "In a local override object, whether this modifier comes from the linked "
+ "reference object, or is local to the override");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", eModifierFlag_OverrideLibrary_Local);
+
prop = RNA_def_property(srna, "use_apply_on_spline", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_ApplyOnSpline);
RNA_def_property_ui_text(
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index d0711f28a6e..b19836a7f12 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -885,6 +885,15 @@ static void rna_def_nlatrack(BlenderRNA *brna)
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips on this NLA-track");
+ prop = RNA_def_boolean(srna,
+ "is_override_data",
+ false,
+ "Override Track",
+ "In a local override data, whether this NLA track comes from the linked "
+ "reference data, or is local to the override");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", NLATRACK_OVERRIDELIBRARY_LOCAL);
+
rna_api_nlatrack_strips(brna, prop);
RNA_define_lib_overridable(true);
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 99865078cbe..bf64196c8ab 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1673,6 +1673,7 @@ static bConstraint *rna_Object_constraints_copy(Object *object, Main *bmain, Poi
{
bConstraint *con = con_ptr->data;
bConstraint *new_con = BKE_constraint_copy_for_object(object, con);
+ new_con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
ED_object_constraint_tag_update(bmain, object, new_con);
WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, object);
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c
index ee509fa92d4..cdf7fe5a7aa 100644
--- a/source/blender/makesrna/intern/rna_pose.c
+++ b/source/blender/makesrna/intern/rna_pose.c
@@ -650,6 +650,7 @@ static bConstraint *rna_PoseChannel_constraints_copy(ID *id,
Object *ob = (Object *)id;
bConstraint *con = con_ptr->data;
bConstraint *new_con = BKE_constraint_copy_for_pose(ob, pchan, con);
+ new_con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL;
ED_object_constraint_dependency_tag_update(bmain, ob, new_con);
WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, id);