[Bf-blender-cvs] [0439733cf89] blender2.8: Merge branch 'master' into blender2.8

Sergey Sharybin noreply at git.blender.org
Wed Nov 29 16:33:09 CET 2017


Commit: 0439733cf8963dec13654c5b55556d8b11639d9c
Author: Sergey Sharybin
Date:   Wed Nov 29 16:32:50 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB0439733cf8963dec13654c5b55556d8b11639d9c

Merge branch 'master' into blender2.8

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



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

diff --cc source/blender/blenkernel/BKE_object.h
index e446451d999,4d232e9ed6c..2b183906f57
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@@ -183,21 -178,21 +183,21 @@@ void BKE_object_tfm_protected_restore(s
                                        const short protectflag);
  
  /* Dependency graph evaluation callbacks. */
 -void BKE_object_eval_local_transform(struct EvaluationContext *eval_ctx,
 +void BKE_object_eval_local_transform(const struct EvaluationContext *eval_ctx,
-                                      struct Scene *scene,
                                       struct Object *ob);
 -void BKE_object_eval_parent(struct EvaluationContext *eval_ctx,
 +void BKE_object_eval_parent(const struct EvaluationContext *eval_ctx,
                              struct Scene *scene,
                              struct Object *ob);
 -void BKE_object_eval_constraints(struct EvaluationContext *eval_ctx,
 +void BKE_object_eval_constraints(const struct EvaluationContext *eval_ctx,
                                   struct Scene *scene,
                                   struct Object *ob);
 -void BKE_object_eval_done(struct EvaluationContext *eval_ctx, struct Object *ob);
 +void BKE_object_eval_done(const struct EvaluationContext *eval_ctx, struct Object *ob);
  
 -bool BKE_object_eval_proxy_copy(struct EvaluationContext *eval_ctx,
++bool BKE_object_eval_proxy_copy(const struct EvaluationContext *eval_ct,
+                                 struct Object *object);
 -void BKE_object_eval_uber_transform(struct EvaluationContext *eval_ctx,
 +void BKE_object_eval_uber_transform(const struct EvaluationContext *eval_ctx,
-                                     struct Scene *scene,
                                      struct Object *ob);
 -void BKE_object_eval_uber_data(struct EvaluationContext *eval_ctx,
 +void BKE_object_eval_uber_data(const struct EvaluationContext *eval_ctx,
                                 struct Scene *scene,
                                 struct Object *ob);
  
@@@ -205,7 -200,8 +205,7 @@@ void BKE_object_eval_cloth(const struc
                             struct Scene *scene,
                             struct Object *object);
  
 -
--void BKE_object_eval_transform_all(struct EvaluationContext *eval_ctx,
++void BKE_object_eval_transform_all(const struct EvaluationContext *eval_ctx,
                                     struct Scene *scene,
                                     struct Object *object);
  
diff --cc source/blender/blenkernel/intern/object.c
index 3795e1bbf0e,c6b4e3fb0c7..f58a0d76b6a
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@@ -2664,6 -2586,28 +2664,28 @@@ bool BKE_object_parent_loop_check(cons
  	return BKE_object_parent_loop_check(par->parent, ob);
  }
  
 -static void object_handle_update_proxy(EvaluationContext *eval_ctx,
++static void object_handle_update_proxy(const EvaluationContext *eval_ctx,
+                                        Scene *scene,
+                                        Object *object,
+                                        const bool do_proxy_update)
+ {
+ 	/* The case when this is a group proxy, object_update is called in group.c */
+ 	if (object->proxy == NULL) {
+ 		return;
+ 	}
+ 	/* set pointer in library proxy target, for copying, but restore it */
+ 	object->proxy->proxy_from = object;
+ 	// printf("set proxy pointer for later group stuff %s\n", ob->id.name);
+ 
+ 	/* the no-group proxy case, we call update */
+ 	if (object->proxy_group == NULL) {
+ 		if (do_proxy_update) {
+ 			// printf("call update, lib ob %s proxy %s\n", ob->proxy->id.name, ob->id.name);
+ 			BKE_object_handle_update(eval_ctx, scene, object->proxy);
+ 		}
+ 	}
+ }
+ 
  /* proxy rule: lib_object->proxy_from == the one we borrow from, only set temporal and cleared here */
  /*           local_object->proxy      == pointer to library object, saved in files and read */
  
@@@ -2677,75 -2621,49 +2699,49 @@@ void BKE_object_handle_update_ex(const 
                                   RigidBodyWorld *rbw,
                                   const bool do_proxy_update)
  {
- 	if (ob->recalc & OB_RECALC_ALL) {
- 		/* speed optimization for animation lookups */
- 		if (ob->pose) {
- 			BKE_pose_channels_hash_make(ob->pose);
- 			if (ob->pose->flag & POSE_CONSTRAINTS_NEED_UPDATE_FLAGS) {
- 				BKE_pose_update_constraint_flags(ob->pose);
- 			}
+ 	if ((ob->recalc & OB_RECALC_ALL) == 0) {
+ 		object_handle_update_proxy(eval_ctx, scene, ob, do_proxy_update);
+ 		return;
+ 	}
+ 	/* Speed optimization for animation lookups. */
+ 	if (ob->pose != NULL) {
+ 		BKE_pose_channels_hash_make(ob->pose);
+ 		if (ob->pose->flag & POSE_CONSTRAINTS_NEED_UPDATE_FLAGS) {
+ 			BKE_pose_update_constraint_flags(ob->pose);
  		}
- 
- 		if (ob->recalc & OB_RECALC_DATA) {
- 			if (ob->type == OB_ARMATURE) {
- 				/* this happens for reading old files and to match library armatures
- 				 * with poses we do it ahead of BKE_object_where_is_calc to ensure animation
- 				 * is evaluated on the rebuilt pose, otherwise we get incorrect poses
- 				 * on file load */
- 				if (ob->pose == NULL || (ob->pose->flag & POSE_RECALC))
- 					BKE_pose_rebuild(ob, ob->data);
- 			}
+ 	}
+ 	if (ob->recalc & OB_RECALC_DATA) {
+ 		if (ob->type == OB_ARMATURE) {
+ 			/* this happens for reading old files and to match library armatures
+ 			 * with poses we do it ahead of BKE_object_where_is_calc to ensure animation
+ 			 * is evaluated on the rebuilt pose, otherwise we get incorrect poses
+ 			 * on file load */
+ 			if (ob->pose == NULL || (ob->pose->flag & POSE_RECALC))
+ 				BKE_pose_rebuild(ob, ob->data);
  		}
- 
- 		/* XXX new animsys warning: depsgraph tag OB_RECALC_DATA should not skip drivers, 
- 		 * which is only in BKE_object_where_is_calc now */
- 		/* XXX: should this case be OB_RECALC_OB instead? */
- 		if (ob->recalc & OB_RECALC_ALL) {
- 			
- 			if (G.debug & G_DEBUG_DEPSGRAPH)
- 				printf("recalcob %s\n", ob->id.name + 2);
- 			
- 			/* handle proxy copy for target */
- 			if (ID_IS_LINKED(ob) && ob->proxy_from) {
- 				// printf("ob proxy copy, lib ob %s proxy %s\n", ob->id.name, ob->proxy_from->id.name);
- 				if (ob->proxy_from->proxy_group) { /* transform proxy into group space */
- 					Object *obg = ob->proxy_from->proxy_group;
- 					float imat[4][4];
- 					invert_m4_m4(imat, obg->obmat);
- 					mul_m4_m4m4(ob->obmat, imat, ob->proxy_from->obmat);
- 					if (obg->dup_group) { /* should always be true */
- 						add_v3_v3(ob->obmat[3], obg->dup_group->dupli_ofs);
- 					}
- 				}
- 				else
- 					copy_m4_m4(ob->obmat, ob->proxy_from->obmat);
- 			}
- 			else
- 				BKE_object_where_is_calc_ex(eval_ctx, scene, rbw, ob, NULL);
+ 	}
+ 	/* XXX new animsys warning: depsgraph tag OB_RECALC_DATA should not skip drivers,
+ 	 * which is only in BKE_object_where_is_calc now */
+ 	/* XXX: should this case be OB_RECALC_OB instead? */
+ 	if (ob->recalc & OB_RECALC_ALL) {
+ 		if (G.debug & G_DEBUG_DEPSGRAPH) {
+ 			printf("recalcob %s\n", ob->id.name + 2);
  		}
- 		
- 		if (ob->recalc & OB_RECALC_DATA) {
- 			BKE_object_handle_data_update(eval_ctx, scene, ob);
+ 		/* Handle proxy copy for target. */
+ 		if (!BKE_object_eval_proxy_copy(eval_ctx, ob)) {
 -			BKE_object_where_is_calc_ex(scene, rbw, ob, NULL);
++			BKE_object_where_is_calc_ex(eval_ctx, scene, rbw, ob, NULL);
  		}
+ 	}
  
- 		ob->recalc &= ~OB_RECALC_ALL;
+ 	if (ob->recalc & OB_RECALC_DATA) {
+ 		BKE_object_handle_data_update(eval_ctx, scene, ob);
  	}
  
- 	/* the case when this is a group proxy, object_update is called in group.c */
- 	if (ob->proxy) {
- 		/* set pointer in library proxy target, for copying, but restore it */
- 		ob->proxy->proxy_from = ob;
- 		// printf("set proxy pointer for later group stuff %s\n", ob->id.name);
+ 	ob->recalc &= ~OB_RECALC_ALL;
  
- 		/* the no-group proxy case, we call update */
- 		if (ob->proxy_group == NULL) {
- 			if (do_proxy_update) {
- 				// printf("call update, lib ob %s proxy %s\n", ob->proxy->id.name, ob->id.name);
- 				BKE_object_handle_update(eval_ctx, scene, ob->proxy);
- 			}
- 		}
- 	}
+ 	object_handle_update_proxy(eval_ctx, scene, ob, do_proxy_update);
  }
+ 
  /* WARNING: "scene" here may not be the scene object actually resides in. 
   * When dealing with background-sets, "scene" is actually the active scene.
   * e.g. "scene" <-- set 1 <-- set 2 ("ob" lives here) <-- set 3 <-- ... <-- set n
diff --cc source/blender/blenkernel/intern/object_update.c
index 4d2cf0c5dc6,84d2f624577..f5f521e119d
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@@ -58,20 -57,22 +58,19 @@@
  #include "BKE_pointcache.h"
  #include "BKE_scene.h"
  #include "BKE_material.h"
 +#include "BKE_mball.h"
 +#include "BKE_mesh.h"
  #include "BKE_image.h"
  
 +#include "MEM_guardedalloc.h"
  #include "DEG_depsgraph.h"
  
 -#ifdef WITH_LEGACY_DEPSGRAPH
 -#  define DEBUG_PRINT if (!DEG_depsgraph_use_legacy() && G.debug & G_DEBUG_DEPSGRAPH) printf
 -#else
 -#  define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
 -#endif
 -
 -static ThreadMutex material_lock = BLI_MUTEX_INITIALIZER;
 +#define DEBUG_PRINT if (G.debug & G_DEBUG_DEPSGRAPH) printf
  
 -void BKE_object_eval_local_transform(EvaluationContext *UNUSED(eval_ctx),
 +void BKE_object_eval_local_transform(const EvaluationContext *UNUSED(eval_ctx),
-                                      Scene *UNUSED(scene),
                                       Object *ob)
  {
 -	DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);
 +	DEBUG_PRINT("%s on %s (%p)\n", __func__, ob->id.name, ob);
  
  	/* calculate local matrix */
  	BKE_object_to_mat4(ob, ob->obmat);
@@@ -273,33 -295,36 +272,36 @@@ void BKE_object_handle_data_update
  	/* quick cache removed */
  }
  
- void BKE_object_eval_uber_transform(const EvaluationContext *UNUSED(eval_ctx),
-                                     Scene *UNUSED(scene),
-                                     Object *ob)
 -bool BKE_object_eval_proxy_copy(EvaluationContext *UNUSED(eval_ctx),
++bool BKE_object_eval_proxy_copy(const EvaluationContext *UNUSED(eval_ctx),
+                                 Object *object)
  {
- 	/* TODO(sergey): Currentl

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list