[Bf-blender-cvs] [cd702db3382] blender2.8: Animation: Pass dependency graph to animation system

Sergey Sharybin noreply at git.blender.org
Thu May 31 18:11:08 CEST 2018


Commit: cd702db3382adae6aa30f3d163e77dd8328e71e3
Author: Sergey Sharybin
Date:   Thu May 31 12:52:13 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBcd702db3382adae6aa30f3d163e77dd8328e71e3

Animation: Pass dependency graph to animation system

This way we allow animation system to make decisions based on which
context dependency graph is coming from, and whether it belongs to
an active edit window or not.

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

M	source/blender/blenkernel/BKE_animsys.h
M	source/blender/blenkernel/BKE_cachefile.h
M	source/blender/blenkernel/intern/action.c
M	source/blender/blenkernel/intern/anim_sys.c
M	source/blender/blenkernel/intern/cachefile.c
M	source/blender/blenkernel/intern/dynamicpaint.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/object_dupli.c
M	source/blender/blenkernel/intern/object_update.c
M	source/blender/blenkernel/intern/particle_system.c
M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenkernel/intern/sequencer.c
M	source/blender/blenkernel/nla_private.h
M	source/blender/draw/engines/eevee/eevee_motion_blur.c
M	source/blender/editors/armature/pose_transform.c
M	source/blender/editors/object/object_modifier.c
M	source/blender/render/intern/source/pipeline.c

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

diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h
index 2aa939c8b63..b7316011fdc 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -34,6 +34,7 @@
 struct AnimData;
 struct AnimMapper;
 struct ChannelDriver;
+struct Depsgraph;
 struct FCurve;
 struct ID;
 struct KS_Path;
@@ -174,10 +175,10 @@ void BKE_fcurves_main_cb(struct Main *bmain, ID_FCurve_Edit_Callback func, void
 /* In general, these ones should be called to do all animation evaluation */
 
 /* Evaluation loop for evaluating animation data  */
-void BKE_animsys_evaluate_animdata(struct Scene *scene, struct ID *id, struct AnimData *adt, float ctime, short recalc);
+void BKE_animsys_evaluate_animdata(struct Depsgraph *depsgraph, struct Scene *scene, struct ID *id, struct AnimData *adt, float ctime, short recalc);
 
 /* Evaluation of all ID-blocks with Animation Data blocks - Animation Data Only */
-void BKE_animsys_evaluate_all_animation(struct Main *main, struct Scene *scene, float ctime);
+void BKE_animsys_evaluate_all_animation(struct Main *main, struct Depsgraph *depsgraph, struct Scene *scene, float ctime);
 
 /* TODO(sergey): This is mainly a temp public function. */
 bool BKE_animsys_execute_fcurve(struct PointerRNA *ptr, struct AnimMapper *remap, struct FCurve *fcu, float curval);
@@ -191,7 +192,7 @@ bool BKE_animsys_execute_fcurve(struct PointerRNA *ptr, struct AnimMapper *remap
  */
 
 /* Evaluate Action (F-Curve Bag) */
-void animsys_evaluate_action(struct PointerRNA *ptr, struct bAction *act, struct AnimMapper *remap, float ctime);
+void animsys_evaluate_action(struct Depsgraph *depsgraph, struct PointerRNA *ptr, struct bAction *act, struct AnimMapper *remap, float ctime);
 
 /* Evaluate Action Group */
 void animsys_evaluate_action_group(struct PointerRNA *ptr, struct bAction *act, struct bActionGroup *agrp, struct AnimMapper *remap, float ctime);
diff --git a/source/blender/blenkernel/BKE_cachefile.h b/source/blender/blenkernel/BKE_cachefile.h
index e0419d0e749..43768b67f8f 100644
--- a/source/blender/blenkernel/BKE_cachefile.h
+++ b/source/blender/blenkernel/BKE_cachefile.h
@@ -35,6 +35,7 @@ extern "C" {
 #endif
 
 struct CacheFile;
+struct Depsgraph;
 struct Main;
 struct Scene;
 
@@ -57,7 +58,7 @@ void BKE_cachefile_reload(const struct Main *bmain, struct CacheFile *cache_file
 
 void BKE_cachefile_ensure_handle(const struct Main *bmain, struct CacheFile *cache_file);
 
-void BKE_cachefile_update_frame(struct Main *bmain, struct Scene *scene, const float ctime, const float fps);
+void BKE_cachefile_update_frame(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, const float ctime, const float fps);
 
 bool BKE_cachefile_filepath_get(
         const struct Main *bmain, const struct CacheFile *cache_file, float frame,
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index dd3e8c0afdb..360d9c019ba 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -1452,7 +1452,7 @@ void what_does_obaction(Object *ob, Object *workob, bPose *pose, bAction *act, c
 		adt.action = act;
 		
 		/* execute effects of Action on to workob (or it's PoseChannels) */
-		BKE_animsys_evaluate_animdata(NULL, &workob->id, &adt, cframe, ADT_RECALC_ANIM);
+		BKE_animsys_evaluate_animdata(NULL, NULL, &workob->id, &adt, cframe, ADT_RECALC_ANIM);
 	}
 }
 
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 29614b87579..12b85e14cf9 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1705,8 +1705,10 @@ bool BKE_animsys_execute_fcurve(PointerRNA *ptr, AnimMapper *remap, FCurve *fcu,
 /* Evaluate all the F-Curves in the given list 
  * This performs a set of standard checks. If extra checks are required, separate code should be used
  */
-static void animsys_evaluate_fcurves(PointerRNA *ptr, ListBase *list, AnimMapper *remap, float ctime, short recalc)
+static void animsys_evaluate_fcurves(
+        Depsgraph *depsgraph, PointerRNA *ptr, ListBase *list, AnimMapper *remap,float ctime, short recalc)
 {
+	(void) depsgraph;
 	FCurve *fcu;
 
 	/* Pointer is expected to be an ID pointer, if it's not -- we are doomed. */
@@ -1869,7 +1871,8 @@ void animsys_evaluate_action_group(PointerRNA *ptr, bAction *act, bActionGroup *
 }
 
 /* Evaluate Action (F-Curve Bag) */
-static void animsys_evaluate_action_ex(PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime, short recalc)
+static void animsys_evaluate_action_ex(
+        Depsgraph *depsgraph, PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime, short recalc)
 {
 	/* check if mapper is appropriate for use here (we set to NULL if it's inappropriate) */
 	if (act == NULL) return;
@@ -1878,12 +1881,12 @@ static void animsys_evaluate_action_ex(PointerRNA *ptr, bAction *act, AnimMapper
 	action_idcode_patch_check(ptr->id.data, act);
 	
 	/* calculate then execute each curve */
-	animsys_evaluate_fcurves(ptr, &act->curves, remap, ctime, recalc);
+	animsys_evaluate_fcurves(depsgraph, ptr, &act->curves, remap, ctime, recalc);
 }
 
-void animsys_evaluate_action(PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime)
+void animsys_evaluate_action(Depsgraph *depsgraph, PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime)
 {
-	animsys_evaluate_action_ex(ptr, act, remap, ctime, 0);
+	animsys_evaluate_action_ex(depsgraph, ptr, act, remap, ctime, 0);
 }
 
 /* ***************************************** */
@@ -1912,7 +1915,7 @@ static float nlastrip_get_influence(NlaStrip *strip, float cframe)
 }
 
 /* evaluate the evaluation time and influence for the strip, storing the results in the strip */
-static void nlastrip_evaluate_controls(NlaStrip *strip, float ctime)
+static void nlastrip_evaluate_controls(Depsgraph *depsgraph, NlaStrip *strip, float ctime)
 {
 	/* now strip's evaluate F-Curves for these settings (if applicable) */
 	if (strip->fcurves.first) {
@@ -1922,7 +1925,7 @@ static void nlastrip_evaluate_controls(NlaStrip *strip, float ctime)
 		RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr);
 		
 		/* execute these settings as per normal */
-		animsys_evaluate_fcurves(&strip_ptr, &strip->fcurves, NULL, ctime, 0);
+		animsys_evaluate_fcurves(depsgraph, &strip_ptr, &strip->fcurves, NULL, ctime, 0);
 	}
 	
 	/* analytically generate values for influence and time (if applicable)
@@ -1944,7 +1947,7 @@ static void nlastrip_evaluate_controls(NlaStrip *strip, float ctime)
 }
 
 /* gets the strip active at the current time for a list of strips for evaluation purposes */
-NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short index, float ctime)
+NlaEvalStrip *nlastrips_ctime_get_strip(Depsgraph *depsgraph, ListBase *list, ListBase *strips, short index, float ctime)
 {
 	NlaStrip *strip, *estrip = NULL;
 	NlaEvalStrip *nes;
@@ -2021,7 +2024,7 @@ NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short
 	 *	- negative influence is not supported yet... how would that be defined?
 	 */
 	/* TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on... */
-	nlastrip_evaluate_controls(estrip, ctime);
+	nlastrip_evaluate_controls(depsgraph, estrip, ctime);
 	if (estrip->influence <= 0.0f)
 		return NULL;
 		
@@ -2040,8 +2043,8 @@ NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short
 				return NULL;
 				
 			/* evaluate controls for the relevant extents of the bordering strips... */
-			nlastrip_evaluate_controls(estrip->prev, estrip->start);
-			nlastrip_evaluate_controls(estrip->next, estrip->end);
+			nlastrip_evaluate_controls(depsgraph, estrip->prev, estrip->start);
+			nlastrip_evaluate_controls(depsgraph, estrip->next, estrip->end);
 			break;
 	}
 	
@@ -2387,7 +2390,8 @@ static void nlastrip_evaluate_actionclip(PointerRNA *ptr, ListBase *channels, Li
 }
 
 /* evaluate transition strip */
-static void nlastrip_evaluate_transition(PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
+static void nlastrip_evaluate_transition(
+        Depsgraph *depsgraph, PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
 {
 	ListBase tmp_channels = {NULL, NULL};
 	ListBase tmp_modifiers = {NULL, NULL};
@@ -2427,12 +2431,12 @@ static void nlastrip_evaluate_transition(PointerRNA *ptr, ListBase *channels, Li
 	/* first strip */
 	tmp_nes.strip_mode = NES_TIME_TRANSITION_START;
 	tmp_nes.strip = s1;
-	nlastrip_evaluate(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes);
+	nlastrip_evaluate(depsgraph, ptr, &tmp_channels, &tmp_modifiers, &tmp_nes);
 	
 	/* second strip */
 	tmp_nes.strip_mode = NES_TIME_TRANSITION_END;
 	tmp_nes.strip = s2;
-	nlastrip_evaluate(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes);
+	nlastrip_evaluate(depsgraph, ptr, &tmp_channels, &tmp_modifiers, &tmp_nes);
 	
 	
 	/* accumulate temp-buffer and full-buffer, using the 'real' strip */
@@ -2443,7 +2447,8 @@ static void nlastrip_evaluate_transition(PointerRNA *ptr, ListBase *channels, Li
 }
 
 /* evaluate meta-strip */
-static void nlastrip_evaluate_meta(PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
+static void nlastrip_evaluate_meta(
+        Depsgraph *depsgraph, PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
 {
 	ListBase tmp_modifiers = {NULL, NULL};
 	NlaStrip *strip = nes->strip;
@@ -2463,13 +2468,13 @@ static void nlastrip_evaluate_meta(PointerRNA *ptr, ListBase *channels, ListBase
 	
 	/* find the child-strip to evaluate */
 	evaltime = (nes->strip_time * (strip->end - strip->start)) + strip->start;
-	tmp_nes = nlastrips_ctime_get_strip(NULL, &strip->strips, -1, evaltime);
+	tmp_nes = nlastrips_ctime_get_strip(depsgraph, NULL, &strip->strips, -1, evaltime);
 	
 	/* directly evaluate child strip into accumulation buffer... 
 	 * - there's no need to use a temporary buffer (as it causes issues [T40082])
 	 */
 	if (tmp_nes) {
-		nlastrip_evaluate(ptr, channels, &tmp_modifiers, tmp_nes);
+		nlastrip_evaluate(depsgraph, ptr, channels, &tmp_modifiers, t

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list