Fix T46320: New Depsgraph: Auto-IK doesn't work

The issue is caused by transform tool temporary affecting on the pose
constraints, which actually changes the way how pose is to be evaluated.

This isn't ideal patch from the performance point of view, but only
limited to the new depsgraph, so we've got some time to work on partial
graph updates.
This commit is contained in:
Sergey Sharybin 2015-11-12 20:19:30 +05:00
parent 8ef68bf989
commit 03e8202b7b
Notes: blender-bot 2023-02-14 08:35:46 +01:00
Referenced by issue #66870, AutoIK-Len stops working after releasing the mouse
Referenced by issue #46320, New Depsgraph: Auto-IK doesn't work.
3 changed files with 21 additions and 1 deletions

View File

@ -30,6 +30,7 @@ set(INC
../../makesdna
../../makesrna
../../windowmanager
../../depsgraph
../../../../intern/guardedalloc
../../../../intern/glew-mx
)

View File

@ -44,6 +44,7 @@ incs = [
'../../makesdna',
'../../makesrna',
'../../windowmanager',
'../../depsgraph',
]
defs = []

View File

@ -117,6 +117,8 @@
#include "RNA_access.h"
#include "DEG_depsgraph.h"
#include "transform.h"
#include "bmesh.h"
@ -845,6 +847,14 @@ static void pose_grab_with_ik_clear(Object *ob)
}
}
}
#ifdef WITH_LEGACY_DEPSGRAPH
if (!DEG_depsgraph_use_legacy())
#endif
{
/* TODO(sergey): Consuder doing partial update only. */
DAG_relations_tag_update(G.main);
}
}
/* adds the IK to pchan - returns if added */
@ -995,8 +1005,16 @@ static short pose_grab_with_ik(Object *ob)
}
/* iTaSC needs clear for new IK constraints */
if (tot_ik)
if (tot_ik) {
BIK_clear_data(ob->pose);
#ifdef WITH_LEGACY_DEPSGRAPH
if (!DEG_depsgraph_use_legacy())
#endif
{
/* TODO(sergey): Consuder doing partial update only. */
DAG_relations_tag_update(G.main);
}
}
return (tot_ik) ? 1 : 0;
}