[Bf-blender-cvs] [3b9700aa517] blender2.8: Remove AnimMapper: it has been left unimplemented for almost ten years.

Alexander Gavrilov noreply at git.blender.org
Mon Nov 12 17:38:55 CET 2018


Commit: 3b9700aa5171c7abb3fd14270ebb3a2b4e0e8b83
Author: Alexander Gavrilov
Date:   Mon Nov 12 19:30:25 2018 +0300
Branches: blender2.8
https://developer.blender.org/rB3b9700aa5171c7abb3fd14270ebb3a2b4e0e8b83

Remove AnimMapper: it has been left unimplemented for almost ten years.

It was supposed to be a feature for substituting RNA paths on the
fly, but has never been implemented, apart from a couple of structure
definitions and passing around some always-NULL pointers. Now it gets
in the way of refactoring NLA evaluation to use GHash for efficiency.

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

M	source/blender/blenkernel/BKE_animsys.h
M	source/blender/blenkernel/intern/action.c
M	source/blender/blenkernel/intern/anim_sys.c
M	source/blender/blenkernel/nla_private.h
M	source/blender/editors/armature/pose_lib.c
M	source/blender/editors/object/object_relations.c
M	source/blender/makesdna/DNA_anim_types.h

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

diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h
index 0b7405c64a0..394351d1df2 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -32,7 +32,6 @@
  */
 
 struct AnimData;
-struct AnimMapper;
 struct ChannelDriver;
 struct Depsgraph;
 struct FCurve;
@@ -184,7 +183,7 @@ void BKE_animsys_evaluate_animdata(struct Depsgraph *depsgraph, struct Scene *sc
 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);
+bool BKE_animsys_execute_fcurve(struct PointerRNA *ptr, struct FCurve *fcu, float curval);
 
 /* ------------ Specialized API --------------- */
 /* There are a few special tools which require these following functions. They are NOT to be used
@@ -195,10 +194,10 @@ bool BKE_animsys_execute_fcurve(struct PointerRNA *ptr, struct AnimMapper *remap
  */
 
 /* Evaluate Action (F-Curve Bag) */
-void animsys_evaluate_action(struct Depsgraph *depsgraph, struct PointerRNA *ptr, struct bAction *act, struct AnimMapper *remap, float ctime);
+void animsys_evaluate_action(struct Depsgraph *depsgraph, struct PointerRNA *ptr, struct bAction *act, float ctime);
 
 /* Evaluate Action Group */
-void animsys_evaluate_action_group(struct PointerRNA *ptr, struct bAction *act, struct bActionGroup *agrp, struct AnimMapper *remap, float ctime);
+void animsys_evaluate_action_group(struct PointerRNA *ptr, struct bAction *act, struct bActionGroup *agrp, float ctime);
 
 /* ************************************* */
 
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 68029ea72f6..115ed29818a 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -1447,7 +1447,7 @@ void what_does_obaction(Object *ob, Object *workob, bPose *pose, bAction *act, c
 		RNA_id_pointer_create(&workob->id, &id_ptr);
 
 		/* execute action for this group only */
-		animsys_evaluate_action_group(&id_ptr, act, agrp, NULL, cframe);
+		animsys_evaluate_action_group(&id_ptr, act, agrp, cframe);
 	}
 	else {
 		AnimData adt = {NULL};
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 17940b947cb..d4355546c19 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1468,34 +1468,14 @@ void BKE_keyingsets_free(ListBase *list)
 /* ***************************************** */
 /* Evaluation Data-Setting Backend */
 
-/* Retrieve string to act as RNA-path, adjusted using mapping-table if provided
- * It returns whether the string needs to be freed (i.e. if it was a temp remapped one)
- * // FIXME: maybe it would be faster if we didn't have to alloc/free strings like this all the time, but for now it's safer
- *
- *	- remap: remapping table to use
- *	- path: original path string (as stored in F-Curve data)
- *	- dst: destination string to write data to
- */
-static bool animsys_remap_path(AnimMapper *UNUSED(remap), char *path, char **dst)
-{
-	/* nothing suitable found, so just set dst to look at path (i.e. no alloc/free needed) */
-	*dst = path;
-	return false;
-}
-
 static bool animsys_store_rna_setting(
-        PointerRNA *ptr, AnimMapper *remap,
+        PointerRNA *ptr,
         /* typically 'fcu->rna_path', 'fcu->array_index' */
         const char *rna_path, const int array_index,
         PathResolvedRNA *r_result)
 {
 	bool success = false;
-
-	char *path = NULL;
-	bool free_path;
-
-	/* get path, remapped as appropriate to work in its new environment */
-	free_path = animsys_remap_path(remap, (char *)rna_path, &path);
+	const char *path = rna_path;
 
 	/* write value to setting */
 	if (path) {
@@ -1529,11 +1509,6 @@ static bool animsys_store_rna_setting(
 		}
 	}
 
-	/* free temp path-info */
-	if (free_path) {
-		MEM_freeN((void *)path);
-	}
-
 	return success;
 }
 
@@ -1678,12 +1653,12 @@ static bool animsys_write_rna_setting(PathResolvedRNA *anim_rna, const float val
 }
 
 /* Simple replacement based data-setting of the FCurve using RNA */
-bool BKE_animsys_execute_fcurve(PointerRNA *ptr, AnimMapper *remap, FCurve *fcu, float curval)
+bool BKE_animsys_execute_fcurve(PointerRNA *ptr, FCurve *fcu, float curval)
 {
 	PathResolvedRNA anim_rna;
 	bool ok = false;
 
-	if (animsys_store_rna_setting(ptr, remap, fcu->rna_path, fcu->array_index, &anim_rna)) {
+	if (animsys_store_rna_setting(ptr, fcu->rna_path, fcu->array_index, &anim_rna)) {
 		ok = animsys_write_rna_setting(&anim_rna, curval);
 	}
 
@@ -1693,7 +1668,6 @@ bool BKE_animsys_execute_fcurve(PointerRNA *ptr, AnimMapper *remap, FCurve *fcu,
 
 static void animsys_write_orig_anim_rna(
         PointerRNA *ptr,
-        AnimMapper *remap,
         const char *rna_path,
         int array_index,
         float value)
@@ -1711,7 +1685,7 @@ static void animsys_write_orig_anim_rna(
 	orig_ptr.data = orig_ptr.id.data;
 	PathResolvedRNA orig_anim_rna;
 	/* TODO(sergey): Is there a faster way to get anim_rna of original ID? */
-	if (animsys_store_rna_setting(&orig_ptr, remap, rna_path, array_index, &orig_anim_rna)) {
+	if (animsys_store_rna_setting(&orig_ptr, rna_path, array_index, &orig_anim_rna)) {
 		animsys_write_rna_setting(&orig_anim_rna, value);
 	}
 }
@@ -1720,7 +1694,7 @@ static void animsys_write_orig_anim_rna(
  * This performs a set of standard checks. If extra checks are required, separate code should be used
  */
 static void animsys_evaluate_fcurves(
-        Depsgraph *depsgraph, PointerRNA *ptr, ListBase *list, AnimMapper *remap, float ctime)
+        Depsgraph *depsgraph, PointerRNA *ptr, ListBase *list, float ctime)
 {
 	const bool is_active_depsgraph = DEG_is_active(depsgraph);
 	/* Calculate then execute each curve. */
@@ -1734,11 +1708,11 @@ static void animsys_evaluate_fcurves(
 			continue;
 		}
 		PathResolvedRNA anim_rna;
-		if (animsys_store_rna_setting(ptr, remap, fcu->rna_path, fcu->array_index, &anim_rna)) {
+		if (animsys_store_rna_setting(ptr, fcu->rna_path, fcu->array_index, &anim_rna)) {
 			const float curval = calculate_fcurve(&anim_rna, fcu, ctime);
 			animsys_write_rna_setting(&anim_rna, curval);
 			if (is_active_depsgraph) {
-				animsys_write_orig_anim_rna(ptr, remap, fcu->rna_path, fcu->array_index, curval);
+				animsys_write_orig_anim_rna(ptr, fcu->rna_path, fcu->array_index, curval);
 			}
 		}
 	}
@@ -1769,7 +1743,7 @@ static void animsys_evaluate_drivers(PointerRNA *ptr, AnimData *adt, float ctime
 				 *       new to only be done when drivers only changed */
 
 				PathResolvedRNA anim_rna;
-				if (animsys_store_rna_setting(ptr, NULL, fcu->rna_path, fcu->array_index, &anim_rna)) {
+				if (animsys_store_rna_setting(ptr, fcu->rna_path, fcu->array_index, &anim_rna)) {
 					const float curval = calculate_fcurve(&anim_rna, fcu, ctime);
 					ok = animsys_write_rna_setting(&anim_rna, curval);
 				}
@@ -1822,13 +1796,12 @@ static void action_idcode_patch_check(ID *id, bAction *act)
 /* ----------------------------------------- */
 
 /* Evaluate Action Group */
-void animsys_evaluate_action_group(PointerRNA *ptr, bAction *act, bActionGroup *agrp, AnimMapper *remap, float ctime)
+void animsys_evaluate_action_group(PointerRNA *ptr, bAction *act, bActionGroup *agrp, float ctime)
 {
 	FCurve *fcu;
 
 	/* check if mapper is appropriate for use here (we set to NULL if it's inappropriate) */
 	if (ELEM(NULL, act, agrp)) return;
-	if ((remap) && (remap->target != act)) remap = NULL;
 
 	action_idcode_patch_check(ptr->id.data, act);
 
@@ -1841,7 +1814,7 @@ void animsys_evaluate_action_group(PointerRNA *ptr, bAction *act, bActionGroup *
 		/* check if this curve should be skipped */
 		if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED)) == 0) {
 			PathResolvedRNA anim_rna;
-			if (animsys_store_rna_setting(ptr, remap, fcu->rna_path, fcu->array_index, &anim_rna)) {
+			if (animsys_store_rna_setting(ptr, fcu->rna_path, fcu->array_index, &anim_rna)) {
 				const float curval = calculate_fcurve(&anim_rna, fcu, ctime);
 				animsys_write_rna_setting(&anim_rna, curval);
 			}
@@ -1851,21 +1824,20 @@ void animsys_evaluate_action_group(PointerRNA *ptr, bAction *act, bActionGroup *
 
 /* Evaluate Action (F-Curve Bag) */
 static void animsys_evaluate_action_ex(
-        Depsgraph *depsgraph, PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime)
+        Depsgraph *depsgraph, PointerRNA *ptr, bAction *act, float ctime)
 {
 	/* check if mapper is appropriate for use here (we set to NULL if it's inappropriate) */
 	if (act == NULL) return;
-	if ((remap) && (remap->target != act)) remap = NULL;
 
 	action_idcode_patch_check(ptr->id.data, act);
 
 	/* calculate then execute each curve */
-	animsys_evaluate_fcurves(depsgraph, ptr, &act->curves, remap, ctime);
+	animsys_evaluate_fcurves(depsgraph, ptr, &act->curves, ctime);
 }
 
-void animsys_evaluate_action(Depsgraph *depsgraph, PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime)
+void animsys_evaluate_action(Depsgraph *depsgraph, PointerRNA *ptr, bAction *act, float ctime)
 {
-	animsys_evaluate_action_ex(depsgraph, ptr, act, remap, ctime);
+	animsys_evaluate_action_ex(depsgraph, ptr, act, ctime);
 }
 
 /* ***************************************** */
@@ -1904,7 +1876,7 @@ static void nlastrip_evaluate_controls(Depsgraph *depsgraph, NlaStrip *strip, fl
 		RNA_pointer_create(NULL, &RNA_NlaStrip, strip, &strip_ptr);
 
 		/* execute these settings as per normal */
-		animsys_evaluate_fcurves(depsgraph, &strip_ptr, &strip->fcurves, NULL, ctime);
+		animsys_evaluate_fcurves(depsgraph, &strip_ptr, &strip->fcurves, ctime);
 	}
 
 	/* analytically generate values for influence and time (if applicable)
@@ -2104,10 +2076,9 @@ static float nlaevalchan_init_value(PathResolvedRNA *rna)
 }
 
 /* verify that an appropriate NlaEvalChannel for this F-Curve exists */
-static NlaEvalChannel *nlaevalchan_verify(PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes, FCurve *fcu, bool *newChan)
+static NlaEvalChannel *nlaevalchan_verify(

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list