Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_constraint.c
| Show First 20 Lines • Show All 864 Lines • ▼ Show 20 Lines | |||||
| static void child_get_inverse_matrix_owner_bone( | static void child_get_inverse_matrix_owner_bone( | ||||
| const bContext *C, wmOperator *op, Scene *scene, Object *ob, float invmat[4][4]) | const bContext *C, wmOperator *op, Scene *scene, Object *ob, float invmat[4][4]) | ||||
| { | { | ||||
| /* For bone owner we want to do this in evaluated domain. | /* For bone owner we want to do this in evaluated domain. | ||||
| * BKE_pose_where_is / BKE_pose_where_is_bone relies on (re)evaluating parts of the scene | * BKE_pose_where_is / BKE_pose_where_is_bone relies on (re)evaluating parts of the scene | ||||
| * and copying new evaluated stuff back to original. | * and copying new evaluated stuff back to original. | ||||
| */ | */ | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
brecht: Make depsgraph a parameter of this function and get it at the start of… | |||||
| Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); | Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); | ||||
| bConstraint *con_eval = edit_constraint_property_get(op, ob_eval, CONSTRAINT_TYPE_CHILDOF); | bConstraint *con_eval = edit_constraint_property_get(op, ob_eval, CONSTRAINT_TYPE_CHILDOF); | ||||
| /* nullify inverse matrix first */ | /* nullify inverse matrix first */ | ||||
| unit_m4(invmat); | unit_m4(invmat); | ||||
| bPoseChannel *pchan_eval = BKE_pose_channel_active(ob_eval); | bPoseChannel *pchan_eval = BKE_pose_channel_active(ob_eval); | ||||
| ▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | if (ob_eval && ob_eval->pose && pchan_eval) { | ||||
| + if we leave this in, we have to click "Set Inverse" twice to see updates... | + if we leave this in, we have to click "Set Inverse" twice to see updates... | ||||
| BKE_pose_where_is(depsgraph, scene, ob_eval); */ | BKE_pose_where_is(depsgraph, scene, ob_eval); */ | ||||
| } | } | ||||
| } | } | ||||
| static void child_get_inverse_matrix_owner_object( | static void child_get_inverse_matrix_owner_object( | ||||
| const bContext *C, Scene *scene, Object *ob, bConstraint *con, float invmat[4][4]) | const bContext *C, Scene *scene, Object *ob, bConstraint *con, float invmat[4][4]) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
brechtUnsubmitted Done Inline ActionsSame comment. brecht: Same comment. | |||||
| /* nullify inverse matrix first */ | /* nullify inverse matrix first */ | ||||
| unit_m4(invmat); | unit_m4(invmat); | ||||
| if (ob) { | if (ob) { | ||||
| Object workob; | Object workob; | ||||
| /* make sure we passed the correct constraint */ | /* make sure we passed the correct constraint */ | ||||
| ▲ Show 20 Lines • Show All 1,351 Lines • Show Last 20 Lines | |||||
Make depsgraph a parameter of this function and get it at the start of childof_set_inverse_exec. Things are not obvious if this happens in deeper functions.