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:
authorJoshua Leung <aligorith@gmail.com>2011-03-13 15:22:57 +0300
committerJoshua Leung <aligorith@gmail.com>2011-03-13 15:22:57 +0300
commit2144b23f514005958e5ec962528599d6623bf15b (patch)
treeedad887fa16628cf41d2ad425fb4db711305a27a /source/blender/blenkernel/intern/action.c
parent4cfa5d55e60b4b51e64da347d51991a8713e26b6 (diff)
Pose Sliding Tools - Custom Property Support + Other bugfixes
- Custom properties are now affected by the Pose Sliding tools too. This is now more important to support, given that modern rigs use these a lot for facial expressions/posing. By and large, this should work fine, though discrete integer values may experience a bit of trouble - Fixed potential bugs with the code which detects which F-Curves are relevant to a PoseBone's transforms (+ custom props). This was prone to being tricked by certain setups if the names of the bones contained some of the keywords these were searching for. - Shuffled some code around: moved bulk of logic out of vec3 case into new function for single-value, since it was really doing per axis already
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r--source/blender/blenkernel/intern/action.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 1c0091cff74..4c5b7f5fcaf 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -973,6 +973,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
@@ -981,8 +986,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)
@@ -992,8 +997,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)
@@ -1003,8 +1008,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)
@@ -1012,6 +1017,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;
+ }
+ }
}
}