Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r--source/blender/blenkernel/intern/action.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 14a0f71f824..5b42948072f 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -26,6 +26,11 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blender/blenkernel/intern/action.c
+ * \ingroup bke
+ */
+
+
#include <string.h>
#include <math.h>
#include <stdlib.h>
@@ -862,7 +867,8 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
float nmin, nmax;
/* get extents for this curve */
- calc_fcurve_range(fcu, &nmin, &nmax);
+ // TODO: allow enabling/disabling this?
+ calc_fcurve_range(fcu, &nmin, &nmax, FALSE);
/* compare to the running tally */
min= MIN2(min, nmin);
@@ -968,6 +974,11 @@ short action_get_item_transforms (bAction *act, Object *ob, bPoseChannel *pchan,
bPtr= strstr(fcu->rna_path, basePath);
if (bPtr) {
+ /* we must add len(basePath) bytes to the match so that we are at the end of the
+ * base path so that we don't get false positives with these strings in the names
+ */
+ bPtr += strlen(basePath);
+
/* step 2: check for some property with transforms
* - to speed things up, only check for the ones not yet found
* unless we're getting the curves too
@@ -976,8 +987,8 @@ short action_get_item_transforms (bAction *act, Object *ob, bPoseChannel *pchan,
* - once a match has been found, the curve cannot possibly be any other one
*/
if ((curves) || (flags & ACT_TRANS_LOC) == 0) {
- pPtr= strstr(fcu->rna_path, "location");
- if ((pPtr) && (pPtr >= bPtr)) {
+ pPtr= strstr(bPtr, "location");
+ if (pPtr) {
flags |= ACT_TRANS_LOC;
if (curves)
@@ -987,8 +998,8 @@ short action_get_item_transforms (bAction *act, Object *ob, bPoseChannel *pchan,
}
if ((curves) || (flags & ACT_TRANS_SCALE) == 0) {
- pPtr= strstr(fcu->rna_path, "scale");
- if ((pPtr) && (pPtr >= bPtr)) {
+ pPtr= strstr(bPtr, "scale");
+ if (pPtr) {
flags |= ACT_TRANS_SCALE;
if (curves)
@@ -998,8 +1009,8 @@ short action_get_item_transforms (bAction *act, Object *ob, bPoseChannel *pchan,
}
if ((curves) || (flags & ACT_TRANS_ROT) == 0) {
- pPtr= strstr(fcu->rna_path, "rotation");
- if ((pPtr) && (pPtr >= bPtr)) {
+ pPtr= strstr(bPtr, "rotation");
+ if (pPtr) {
flags |= ACT_TRANS_ROT;
if (curves)
@@ -1007,6 +1018,18 @@ short action_get_item_transforms (bAction *act, Object *ob, bPoseChannel *pchan,
continue;
}
}
+
+ if ((curves) || (flags & ACT_TRANS_PROP) == 0) {
+ /* custom properties only */
+ pPtr= strstr(bPtr, "[\""); /* extra '"' comment here to keep my texteditor functionlist working :) */
+ if (pPtr) {
+ flags |= ACT_TRANS_PROP;
+
+ if (curves)
+ BLI_addtail(curves, BLI_genericNodeN(fcu));
+ continue;
+ }
+ }
}
}
@@ -1066,7 +1089,7 @@ void copy_pose_result(bPose *to, bPose *from)
bPoseChannel *pchanto, *pchanfrom;
if(to==NULL || from==NULL) {
- printf("pose result copy error to:%p from:%p\n", to, from); // debug temp
+ printf("pose result copy error to:%p from:%p\n", (void *)to, (void *)from); // debug temp
return;
}