diff options
Diffstat (limited to 'source/blender/gpencil_modifiers/intern')
12 files changed, 32 insertions, 32 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilarray.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilarray.c index 8bb61136cc2..e51fe8832f0 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilarray.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilarray.c @@ -104,9 +104,9 @@ static void BKE_gpencil_instance_modifier_instance_tfm(Object *ob, if (mmd->flag & GP_ARRAY_USE_OFFSET) { add_v3_v3(mat_offset[3], mmd->offset); } - invert_m4_m4(obinv, ob->obmat); + invert_m4_m4(obinv, ob->object_to_world); - mul_m4_series(r_offset, mat_offset, obinv, mmd->object->obmat); + mul_m4_series(r_offset, mat_offset, obinv, mmd->object->object_to_world); copy_m4_m4(mat_offset, r_offset); /* clear r_mat locations to avoid double transform */ diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c index 3c971ec6af0..49ac3275c82 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c @@ -303,8 +303,8 @@ static void build_sequential(Object *ob, /* Compute distance to control object if set, and build according to that order. */ if (mmd->object) { float sv1[3], sv2[3]; - mul_v3_m4v3(sv1, ob->obmat, &gps->points[0].x); - mul_v3_m4v3(sv2, ob->obmat, &gps->points[gps->totpoints - 1].x); + mul_v3_m4v3(sv1, ob->object_to_world, &gps->points[0].x); + mul_v3_m4v3(sv2, ob->object_to_world, &gps->points[gps->totpoints - 1].x); float dist_l = len_v3v3(sv1, mmd->object->loc); float dist_r = len_v3v3(sv2, mmd->object->loc); if (dist_r < dist_l) { diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c index 1a2bfebdc55..e3b4e1c5e02 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c @@ -234,14 +234,14 @@ static void deformStroke(GpencilModifierData *md, /* get world-space matrix of target, corrected for the space the verts are in */ if (mmd->subtarget[0] && pchan) { /* bone target if there's a matching pose-channel */ - mul_m4_m4m4(dmat, mmd->object->obmat, pchan->pose_mat); + mul_m4_m4m4(dmat, mmd->object->object_to_world, pchan->pose_mat); } else { /* just object target */ - copy_m4_m4(dmat, mmd->object->obmat); + copy_m4_m4(dmat, mmd->object->object_to_world); } - invert_m4_m4(ob->imat, ob->obmat); - mul_m4_series(tData.mat, ob->imat, dmat, mmd->parentinv); + invert_m4_m4(ob->world_to_object, ob->object_to_world); + mul_m4_series(tData.mat, ob->world_to_object, dmat, mmd->parentinv); /* loop points and apply deform */ for (int i = 0; i < gps->totpoints; i++) { diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c index 326e86091c5..bc91094e80e 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c @@ -81,8 +81,8 @@ static void update_mirror_object(Object *ob, float tmp[4][4]; float itmp[4][4]; - invert_m4_m4(tmp, mmd->object->obmat); - mul_m4_m4m4(tmp, tmp, ob->obmat); + invert_m4_m4(tmp, mmd->object->object_to_world); + mul_m4_m4m4(tmp, tmp, ob->object_to_world); invert_m4_m4(itmp, tmp); mul_m4_series(mtx, itmp, mtx, tmp); diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c index 1cf11a694ac..cb4a7893080 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c @@ -109,7 +109,7 @@ static void duplicateStroke(Object *ob, float opacity_factor; /* Apply object scale to offset distance. */ - offset *= mat4_to_scale(ob->obmat); + offset *= mat4_to_scale(ob->object_to_world); BKE_gpencil_stroke_normal(gps, stroke_normal); if (len_v3(stroke_normal) < FLT_EPSILON) { diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciloutline.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciloutline.c index 387e3c2d5ce..455d8b0b528 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpenciloutline.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciloutline.c @@ -116,7 +116,7 @@ static void convert_stroke(GpencilModifierData *md, /* Apply layer thickness change. */ gps_duplicate->thickness += gpl->line_change; /* Apply object scale to thickness. */ - gps_duplicate->thickness *= mat4_to_scale(ob->obmat); + gps_duplicate->thickness *= mat4_to_scale(ob->object_to_world); CLAMP_MIN(gps_duplicate->thickness, 1.0f); /* Stroke. */ @@ -197,7 +197,7 @@ static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Objec } Object *cam_ob = scene->camera; float viewmat[4][4]; - invert_m4_m4(viewmat, cam_ob->obmat); + invert_m4_m4(viewmat, cam_ob->object_to_world); LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { bGPDframe *gpf = BKE_gpencil_frame_retime_get(depsgraph, scene, ob, gpl); @@ -240,7 +240,7 @@ static void bakeModifier(Main *UNUSED(bmain), BKE_scene_graph_update_for_newframe(depsgraph); /* Ensure the camera is the right one. */ BKE_scene_camera_switch_update(scene); - invert_m4_m4(viewmat, cam_ob->obmat); + invert_m4_m4(viewmat, cam_ob->object_to_world); /* Prepare transform matrix. */ float diff_mat[4][4]; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c index 94d8cb98290..8331188fbd8 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c @@ -144,7 +144,7 @@ static void deformStroke(GpencilModifierData *md, float coba_res[4]; float matrix[4][4]; if (is_gradient) { - mul_m4_m4m4(matrix, mmd->object->imat, ob->obmat); + mul_m4_m4m4(matrix, mmd->object->world_to_object, ob->object_to_world); } /* loop points and apply color. */ diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_angle.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_angle.c index 3ecff4bf447..e9761732614 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_angle.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_angle.c @@ -97,7 +97,7 @@ static void deformStroke(GpencilModifierData *md, /* Apply the rotation of the object. */ if (mmd->space == GP_SPACE_LOCAL) { - mul_mat3_m4_v3(ob->obmat, vec_ref); + mul_mat3_m4_v3(ob->object_to_world, vec_ref); } /* Ensure there is a vertex group. */ @@ -122,8 +122,8 @@ static void deformStroke(GpencilModifierData *md, bGPDspoint *pt1 = (i > 0) ? &gps->points[i] : &gps->points[i + 1]; bGPDspoint *pt2 = (i > 0) ? &gps->points[i - 1] : &gps->points[i]; float fpt1[3], fpt2[3]; - mul_v3_m4v3(fpt1, ob->obmat, &pt1->x); - mul_v3_m4v3(fpt2, ob->obmat, &pt2->x); + mul_v3_m4v3(fpt1, ob->object_to_world, &pt1->x); + mul_v3_m4v3(fpt2, ob->object_to_world, &pt2->x); float vec[3]; sub_v3_v3v3(vec, fpt1, fpt2); diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c index f64c83443d8..ddf852bcd11 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c @@ -64,8 +64,8 @@ static float calc_point_weight_by_distance(Object *ob, { float weight; float gvert[3]; - mul_v3_m4v3(gvert, ob->obmat, &pt->x); - float dist = len_v3v3(mmd->object->obmat[3], gvert); + mul_v3_m4v3(gvert, ob->object_to_world, &pt->x); + float dist = len_v3v3(mmd->object->object_to_world[3], gvert); if (dist > dist_max) { weight = 1.0f; diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c index c1e71bde254..4b5c40c0e38 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c @@ -2633,7 +2633,7 @@ void lineart_main_load_geometries(Depsgraph *depsgraph, scene, eval_ob, eval_ob, - eval_ob->obmat, + eval_ob->object_to_world, is_render, olti, thread_count, @@ -3589,11 +3589,11 @@ static LineartData *lineart_create_render_buffer(Scene *scene, clipping_offset = 0.0001; } - copy_v3db_v3fl(ld->conf.camera_pos, camera->obmat[3]); + copy_v3db_v3fl(ld->conf.camera_pos, camera->object_to_world[3]); if (active_camera) { - copy_v3db_v3fl(ld->conf.active_camera_pos, active_camera->obmat[3]); + copy_v3db_v3fl(ld->conf.active_camera_pos, active_camera->object_to_world[3]); } - copy_m4_m4(ld->conf.cam_obmat, camera->obmat); + copy_m4_m4(ld->conf.cam_obmat, camera->object_to_world); ld->conf.cam_is_persp = (c->type == CAM_PERSP); ld->conf.near_clip = c->clip_start + clipping_offset; @@ -3620,8 +3620,8 @@ static LineartData *lineart_create_render_buffer(Scene *scene, if (lmd->light_contour_object) { Object *light_obj = lmd->light_contour_object; - copy_v3db_v3fl(ld->conf.camera_pos_secondary, light_obj->obmat[3]); - copy_m4_m4(ld->conf.cam_obmat_secondary, light_obj->obmat); + copy_v3db_v3fl(ld->conf.camera_pos_secondary, light_obj->object_to_world[3]); + copy_m4_m4(ld->conf.cam_obmat_secondary, light_obj->object_to_world); ld->conf.light_reference_available = true; if (light_obj->type == OB_LAMP) { ld->conf.cam_is_persp_secondary = ((Light *)light_obj->data)->type != LA_SUN; @@ -5418,7 +5418,7 @@ void MOD_lineart_gpencil_generate(LineartCache *cache, } float gp_obmat_inverse[4][4]; - invert_m4_m4(gp_obmat_inverse, ob->obmat); + invert_m4_m4(gp_obmat_inverse, ob->object_to_world); lineart_gpencil_generate(cache, depsgraph, ob, diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c index 80517979f30..6f44cc68a19 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c @@ -154,7 +154,7 @@ static bool bake_strokes(Object *ob, typedef struct LineartBakeJob { wmWindowManager *wm; void *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; /* C or ob must have one != NULL. */ @@ -218,8 +218,8 @@ static void lineart_gpencil_guard_modifiers(LineartBakeJob *bj) } static void lineart_gpencil_bake_startjob(void *customdata, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { LineartBakeJob *bj = (LineartBakeJob *)customdata; @@ -337,7 +337,7 @@ static int lineart_gpencil_bake_common(bContext *C, } float pseduo_progress; - short pseduo_do_update; + bool pseduo_do_update; lineart_gpencil_bake_startjob(bj, NULL, &pseduo_do_update, &pseduo_progress); BLI_linklist_free(bj->objects, NULL); diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c index e34e6fc43ea..edea052e728 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c @@ -1167,7 +1167,7 @@ bool lineart_main_try_generate_shadow(Depsgraph *depsgraph, copy_v3_v3_db(ld->conf.camera_pos_secondary, ld->conf.camera_pos); copy_m4_m4(ld->conf.cam_obmat_secondary, ld->conf.cam_obmat); - copy_m4_m4(ld->conf.cam_obmat, lmd->light_contour_object->obmat); + copy_m4_m4(ld->conf.cam_obmat, lmd->light_contour_object->object_to_world); copy_v3db_v3fl(ld->conf.camera_pos, ld->conf.cam_obmat[3]); ld->conf.cam_is_persp_secondary = ld->conf.cam_is_persp; ld->conf.cam_is_persp = is_persp; |