diff options
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_utils.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index cc13f667e48..7d814b43196 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -900,7 +900,7 @@ void ED_gpencil_drawing_reference_get(const Scene *scene, } else { /* use object location */ - copy_v3_v3(r_vec, ob->obmat[3]); + copy_v3_v3(r_vec, ob->object_to_world[3]); /* Apply layer offset. */ bGPdata *gpd = ob->data; bGPDlayer *gpl = BKE_gpencil_layer_active_get(gpd); @@ -984,7 +984,7 @@ void ED_gpencil_project_stroke_to_plane(const Scene *scene, /* if object, apply object rotation */ if (ob && (ob->type == OB_GPENCIL)) { float mat[4][4]; - copy_m4_m4(mat, ob->obmat); + copy_m4_m4(mat, ob->object_to_world); /* move origin to cursor */ if ((ts->gpencil_v3d_align & GP_PROJECT_CURSOR) == 0) { @@ -1206,7 +1206,7 @@ void ED_gpencil_project_point_to_plane(const Scene *scene, /* if object, apply object rotation */ if (ob && (ob->type == OB_GPENCIL)) { float mat[4][4]; - copy_m4_m4(mat, ob->obmat); + copy_m4_m4(mat, ob->object_to_world); if ((ts->gpencil_v3d_align & GP_PROJECT_CURSOR) == 0) { if (gpl != NULL) { add_v3_v3(mat[3], gpl->location); @@ -1233,7 +1233,7 @@ void ED_gpencil_project_point_to_plane(const Scene *scene, /* move origin to object */ if ((ts->gpencil_v3d_align & GP_PROJECT_CURSOR) == 0) { - copy_v3_v3(mat[3], ob->obmat[3]); + copy_v3_v3(mat[3], ob->object_to_world[3]); } mul_mat3_m4_v3(mat, plane_normal); @@ -1365,16 +1365,16 @@ void ED_gpencil_reset_layers_parent(Depsgraph *depsgraph, Object *obact, bGPdata if (gpl->parent != NULL) { /* calculate new matrix */ if (ELEM(gpl->partype, PAROBJECT, PARSKEL)) { - invert_m4_m4(cur_mat, gpl->parent->obmat); - copy_v3_v3(gpl_loc, obact->obmat[3]); + invert_m4_m4(cur_mat, gpl->parent->object_to_world); + copy_v3_v3(gpl_loc, obact->object_to_world[3]); } else if (gpl->partype == PARBONE) { bPoseChannel *pchan = BKE_pose_channel_find_name(gpl->parent->pose, gpl->parsubstr); if (pchan) { float tmp_mat[4][4]; - mul_m4_m4m4(tmp_mat, gpl->parent->obmat, pchan->pose_mat); + mul_m4_m4m4(tmp_mat, gpl->parent->object_to_world, pchan->pose_mat); invert_m4_m4(cur_mat, tmp_mat); - copy_v3_v3(gpl_loc, obact->obmat[3]); + copy_v3_v3(gpl_loc, obact->object_to_world[3]); } } |