[Bf-blender-cvs] [b8bb15f744e] blender2.8: Finalize/enable new static override for linked groups.

Bastien Montagne noreply at git.blender.org
Thu Feb 1 14:12:36 CET 2018


Commit: b8bb15f744ea811f3ff14882fdd012a378fbbc97
Author: Bastien Montagne
Date:   Thu Feb 1 14:08:18 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBb8bb15f744ea811f3ff14882fdd012a378fbbc97

Finalize/enable new static override for linked groups.

Behavior is expected to be simillar to 'make proxy' on linked groups, it
basically allows you to select which object in the group will be to
'root' override (usually, the armature), checks which other objects
needs to be overridden as well, overrides the group itself too, and
instantiates the group and the root overridden object.

It seems to be working, though handling of armature deformation is kind
of totally broken in blender2.8 currently (modifiers...). ;)

===================================================================

M	source/blender/editors/object/object_relations.c

===================================================================

diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 589b54cd3c0..43d29b6f931 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -2411,7 +2411,6 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
 	bool success = false;
 
 	if (!ID_IS_LINKED(obact) && obact->dup_group != NULL && ID_IS_LINKED(obact->dup_group)) {
-#if 0  /* Not working yet! */
 		Base *base = BLI_findlink(&obact->dup_group->view_layer->object_bases, RNA_enum_get(op->ptr, "object"));
 		Object *obgroup = obact;
 		obact = base->object;
@@ -2424,7 +2423,7 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
 
 		FOREACH_GROUP_OBJECT(obgroup->dup_group, ob)
 		{
-			make_override_tag_object(obact, ob);
+			make_override_static_tag_object(obact, ob);
 		}
 		FOREACH_GROUP_OBJECT_END;
 
@@ -2435,7 +2434,7 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
 		ViewLayer *view_layer = CTX_data_view_layer(C);
 		Object *new_obact = (Object *)obact->id.newid;
 		if (new_obact != NULL && (base = BKE_view_layer_base_find(view_layer, new_obact)) == NULL) {
-			BKE_collection_object_add_from(scene, obact, new_obact);
+			BKE_collection_object_add_from(scene, obgroup, new_obact);
 			base = BKE_view_layer_base_find(view_layer, new_obact);
 			BKE_view_layer_base_select(view_layer, base);
 		}
@@ -2453,9 +2452,6 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
 		/* Cleanup. */
 		BKE_main_id_clear_newpoins(bmain);
 		BKE_main_id_tag_listbase(&bmain->object, LIB_TAG_DOIT, false);
-#else
-		UNUSED_VARS(op);
-#endif
 	}
 	/* Else, poll func ensures us that ID_IS_LINKED(obact) is true. */
 	else if (obact->type == OB_ARMATURE) {
@@ -2512,8 +2508,8 @@ void OBJECT_OT_make_override_static(wmOperatorType *ot)
 
 	/* properties */
 	PropertyRNA *prop;
-	prop = RNA_def_enum(ot->srna, "object", DummyRNA_DEFAULT_items, 0, "Proxy Object",
-	                    "Name of lib-linked/grouped object to make a proxy for");
+	prop = RNA_def_enum(ot->srna, "object", DummyRNA_DEFAULT_items, 0, "Override Object",
+	                    "Name of lib-linked/group object to make an override from");
 	RNA_def_enum_funcs(prop, proxy_group_object_itemf);
 	RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE);
 	ot->prop = prop;



More information about the Bf-blender-cvs mailing list