[Bf-blender-cvs] [4165a57a667] blender2.8: Fix broken auto-keying after copy/paste of poses.

Bastien Montagne noreply at git.blender.org
Wed Jun 6 17:19:37 CEST 2018


Commit: 4165a57a66724b9b0f7e696a9d0ef75ee29a6af8
Author: Bastien Montagne
Date:   Wed Jun 6 17:17:08 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB4165a57a66724b9b0f7e696a9d0ef75ee29a6af8

Fix broken auto-keying after copy/paste of poses.

That bug was also likely affecting other cases - basically it was making
auto-keying always key from evaluated ('visual') values, never base,
data values... Added a flag, in some cases we do want evaluated values
here, obviously.

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

M	source/blender/editors/animation/keyframing.c

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

diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 25b3b4f58fa..e6f2f087ede 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -616,12 +616,14 @@ static short new_key_needed(FCurve *fcu, float cFrame, float nValue)
 /* ------------------ RNA Data-Access Functions ------------------ */
 
 /* Try to read value using RNA-properties obtained already */
-static float setting_get_rna_value(Depsgraph *depsgraph, PointerRNA *ptr, PropertyRNA *prop, int index)
+static float setting_get_rna_value(Depsgraph *depsgraph, PointerRNA *ptr, PropertyRNA *prop, int index, const bool get_evaluated)
 {
-	PointerRNA ptr_eval;
+	PointerRNA ptr_eval = *ptr;
 	float value = 0.0f;
 
-	DEG_get_evaluated_rna_pointer(depsgraph, ptr, &ptr_eval);
+	if (get_evaluated) {
+		DEG_get_evaluated_rna_pointer(depsgraph, ptr, &ptr_eval);
+	}
 
 	switch (RNA_property_type(prop)) {
 		case PROP_BOOLEAN:
@@ -847,7 +849,7 @@ static float visualkey_get_value(Depsgraph *depsgraph, PointerRNA *ptr, Property
 		}
 	}
 	else {
-		return setting_get_rna_value(depsgraph, ptr, prop, array_index);
+		return setting_get_rna_value(depsgraph, ptr, prop, array_index, true);
 	}
 
 	/* Rot/Scale code are common! */
@@ -885,7 +887,7 @@ static float visualkey_get_value(Depsgraph *depsgraph, PointerRNA *ptr, Property
 	}
 
 	/* as the function hasn't returned yet, read value from system in the default way */
-	return setting_get_rna_value(depsgraph, ptr, prop, array_index);
+	return setting_get_rna_value(depsgraph, ptr, prop, array_index, true);
 }
 
 /* ------------------------- Insert Key API ------------------------- */
@@ -970,7 +972,7 @@ bool insert_keyframe_direct(Depsgraph *depsgraph, ReportList *reports, PointerRN
 	}
 	else {
 		/* read value from system */
-		curval = setting_get_rna_value(depsgraph, &ptr, prop, fcu->array_index);
+		curval = setting_get_rna_value(depsgraph, &ptr, prop, fcu->array_index, false);
 	}
 
 	/* only insert keyframes where they are needed */



More information about the Bf-blender-cvs mailing list