[Bf-blender-cvs] [86847bf5ba3] master: Cleanup: Split depsgraph uber transform function callback

Sergey Sharybin noreply at git.blender.org
Wed Nov 29 16:26:36 CET 2017


Commit: 86847bf5ba3efed90e2cfc238b4d478029287bf8
Author: Sergey Sharybin
Date:   Wed Nov 29 16:22:59 2017 +0100
Branches: master
https://developer.blender.org/rB86847bf5ba3efed90e2cfc238b4d478029287bf8

Cleanup: Split depsgraph uber transform function callback

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

M	source/blender/blenkernel/BKE_object.h
M	source/blender/blenkernel/intern/object_update.c

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

diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 83a9dfaa6a7..4d232e9ed6c 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -188,6 +188,8 @@ void BKE_object_eval_constraints(struct EvaluationContext *eval_ctx,
                                  struct Object *ob);
 void BKE_object_eval_done(struct EvaluationContext *eval_ctx, struct Object *ob);
 
+bool BKE_object_eval_proxy_copy(struct EvaluationContext *eval_ctx,
+                                struct Object *object);
 void BKE_object_eval_uber_transform(struct EvaluationContext *eval_ctx,
                                     struct Object *ob);
 void BKE_object_eval_uber_data(struct EvaluationContext *eval_ctx,
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index ef6827dca5c..84d2f624577 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -295,32 +295,36 @@ void BKE_object_handle_data_update(EvaluationContext *eval_ctx,
 	/* quick cache removed */
 }
 
-void BKE_object_eval_uber_transform(EvaluationContext *UNUSED(eval_ctx),
-                                    Object *ob)
+bool BKE_object_eval_proxy_copy(EvaluationContext *UNUSED(eval_ctx),
+                                Object *object)
 {
-	/* TODO(sergey): Currently it's a duplicate of logic in BKE_object_handle_update_ex(). */
-	// XXX: it's almost redundant now...
-
 	/* Handle proxy copy for target, */
-	if (ID_IS_LINKED(ob) && ob->proxy_from) {
-		if (ob->proxy_from->proxy_group) {
+	if (ID_IS_LINKED(object) && object->proxy_from) {
+		if (object->proxy_from->proxy_group) {
 			/* Transform proxy into group space. */
-			Object *obg = ob->proxy_from->proxy_group;
+			Object *obg = object->proxy_from->proxy_group;
 			float imat[4][4];
 			invert_m4_m4(imat, obg->obmat);
-			mul_m4_m4m4(ob->obmat, imat, ob->proxy_from->obmat);
+			mul_m4_m4m4(object->obmat, imat, object->proxy_from->obmat);
 			/* Should always be true. */
 			if (obg->dup_group) {
-				add_v3_v3(ob->obmat[3], obg->dup_group->dupli_ofs);
+				add_v3_v3(object->obmat[3], obg->dup_group->dupli_ofs);
 			}
 		}
-		else
-			copy_m4_m4(ob->obmat, ob->proxy_from->obmat);
+		else {
+			copy_m4_m4(object->obmat, object->proxy_from->obmat);
+		}
+		return true;
 	}
+	return false;
+}
 
-	ob->recalc &= ~(OB_RECALC_OB | OB_RECALC_TIME);
-	if (ob->data == NULL) {
-		ob->recalc &= ~OB_RECALC_DATA;
+void BKE_object_eval_uber_transform(EvaluationContext *eval_ctx, Object *object)
+{
+	BKE_object_eval_proxy_copy(eval_ctx, object);
+	object->recalc &= ~(OB_RECALC_OB | OB_RECALC_TIME);
+	if (object->data == NULL) {
+		object->recalc &= ~OB_RECALC_DATA;
 	}
 }



More information about the Bf-blender-cvs mailing list