Constraints: Child-Of, set inverse matrix upon creation

Set the inverse matrix when the Child Of constraint is created. This
prevents the bone/object from jumping away when the constraint is added,
improving usability.

Reviewed by: sybren

Differential Revision: https://developer.blender.org/D8851
This commit is contained in:
Joseph Brandenburg 2020-09-11 15:05:36 +02:00 committed by Sybren A. Stüvel
parent f3224bbc0f
commit ad70d4b095
Notes: blender-bot 2023-02-14 06:19:41 +01:00
Referenced by issue #81949, Child Of Constraint does not allow to set inverse matrix via python API
1 changed files with 2 additions and 1 deletions

View File

@ -845,7 +845,8 @@ static void childof_new_data(void *cdata)
bChildOfConstraint *data = (bChildOfConstraint *)cdata;
data->flag = (CHILDOF_LOCX | CHILDOF_LOCY | CHILDOF_LOCZ | CHILDOF_ROTX | CHILDOF_ROTY |
CHILDOF_ROTZ | CHILDOF_SIZEX | CHILDOF_SIZEY | CHILDOF_SIZEZ);
CHILDOF_ROTZ | CHILDOF_SIZEX | CHILDOF_SIZEY | CHILDOF_SIZEZ |
CHILDOF_SET_INVERSE);
unit_m4(data->invmat);
}