diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-15 06:58:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-15 06:58:06 +0400 |
commit | e6e265b2b59e02cc7816a2ed43471eca8bca0a62 (patch) | |
tree | e312d2c2f6cb1aaf79148648e5725902ab23d34e /source/blender/ikplugin/intern/itasc_plugin.cpp | |
parent | e59ab6486f9e7285815671044b785c28365d5165 (diff) | |
parent | 3442c16c09b31a23f45b23be72e6eb5ba02c7bbf (diff) |
svn merge -r41779:41847 ^/trunk/blender
Diffstat (limited to 'source/blender/ikplugin/intern/itasc_plugin.cpp')
-rw-r--r-- | source/blender/ikplugin/intern/itasc_plugin.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp index 2cb3a32ae3e..f4720b7fc41 100644 --- a/source/blender/ikplugin/intern/itasc_plugin.cpp +++ b/source/blender/ikplugin/intern/itasc_plugin.cpp @@ -326,11 +326,19 @@ static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *co break; for(; a<size && t<tree->totchannel && tree->pchan[t]==chanlist[segcount-a-1]; a++, t++); } - parent= a-1; + segcount= segcount-a; target->tip= tree->totchannel + segcount - 1; if (segcount > 0) { + for(parent = a - 1; parent < tree->totchannel; parent++) + if(tree->pchan[parent] == chanlist[segcount-1]->parent) + break; + + /* shouldn't happen, but could with dependency cycles */ + if(parent == tree->totchannel) + parent = a - 1; + /* resize array */ newsize= tree->totchannel + segcount; oldchan= tree->pchan; |