diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_lattice.h | 63 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/anim_path.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 20 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lattice.c | 39 | ||||
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c | 20 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_armature.c | 80 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_curve.c | 18 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_lattice.c | 16 |
8 files changed, 134 insertions, 124 deletions
diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h index 3cd8c69a263..9679d105363 100644 --- a/source/blender/blenkernel/BKE_lattice.h +++ b/source/blender/blenkernel/BKE_lattice.h @@ -53,39 +53,48 @@ void end_latt_deform(struct LatticeDeformData *lattice_deform_data); bool object_deform_mball(struct Object *ob, struct ListBase *dispbase); void outside_lattice(struct Lattice *lt); -void curve_deform_verts(struct Object *cuOb, - struct Object *target, - float (*vert_coords)[3], - int numVerts, - struct MDeformVert *dvert, - const int defgrp_index, - short flag, - short defaxis); -void curve_deform_vector(struct Object *cuOb, +/* -------------------------------------------------------------------- */ +/** \name Deform 3D Coordinates by Object Data + * + * Used by modifiers (odd location for this API, for now keep these related functions together). + * \{ */ + +void BKE_curve_deform_coords(struct Object *cuOb, + struct Object *target, + float (*vert_coords)[3], + int numVerts, + struct MDeformVert *dvert, + const int defgrp_index, + short flag, + short defaxis); +void BKE_curve_deform_co(struct Object *cuOb, struct Object *target, float orco[3], float vec[3], float mat[3][3], int no_rot_axis); -void lattice_deform_verts(struct Object *laOb, - struct Object *target, - struct Mesh *mesh, - float (*vert_coords)[3], - int numVerts, - short flag, - const char *vgroup, - float influence); -void armature_deform_verts(struct Object *armOb, - struct Object *target, - const struct Mesh *mesh, - float (*vert_coords)[3], - float (*defMats)[3][3], - int numVerts, - int deformflag, - float (*prevCos)[3], - const char *defgrp_name, - struct bGPDstroke *gps); +void BKE_lattice_deform_coords(struct Object *laOb, + struct Object *target, + struct Mesh *mesh, + float (*vert_coords)[3], + int numVerts, + short flag, + const char *vgroup, + float influence); + +void BKE_armature_deform_coords(struct Object *armOb, + struct Object *target, + const struct Mesh *mesh, + float (*vert_coords)[3], + float (*defMats)[3][3], + int numVerts, + int deformflag, + float (*prevCos)[3], + const char *defgrp_name, + struct bGPDstroke *gps); + +/** \} */ float (*BKE_lattice_vert_coords_alloc(const struct Lattice *lt, int *r_vert_len))[3]; void BKE_lattice_vert_coords_get(const struct Lattice *lt, float (*vert_coords)[3]); diff --git a/source/blender/blenkernel/intern/anim_path.c b/source/blender/blenkernel/intern/anim_path.c index e073bd6fc82..e94f0d6ff85 100644 --- a/source/blender/blenkernel/intern/anim_path.c +++ b/source/blender/blenkernel/intern/anim_path.c @@ -262,7 +262,7 @@ int where_on_path(Object *ob, /* NOTE: commented out for follow constraint * - * If it's ever be uncommented watch out for curve_deform_verts() + * If it's ever be uncommented watch out for BKE_curve_deform_coords() * which used to temporary set CU_FOLLOW flag for the curve and no * longer does it (because of threading issues of such a thing. */ diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 36921bd2662..b382426d11c 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1697,16 +1697,16 @@ static void armature_vert_task(void *__restrict userdata, } } -void armature_deform_verts(Object *armOb, - Object *target, - const Mesh *mesh, - float (*vertexCos)[3], - float (*defMats)[3][3], - int numVerts, - int deformflag, - float (*prevCos)[3], - const char *defgrp_name, - bGPDstroke *gps) +void BKE_armature_deform_coords(Object *armOb, + Object *target, + const Mesh *mesh, + float (*vertexCos)[3], + float (*defMats)[3][3], + int numVerts, + int deformflag, + float (*prevCos)[3], + const char *defgrp_name, + bGPDstroke *gps) { bArmature *arm = armOb->data; bPoseChannel **defnrToPC = NULL; diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index e7a2421a625..4e0e3baff57 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -299,7 +299,7 @@ void BKE_lattice_resize(Lattice *lt, int uNew, int vNew, int wNew, Object *ltOb) copy_m4_m4(mat, ltOb->obmat); unit_m4(ltOb->obmat); - lattice_deform_verts(ltOb, NULL, NULL, vert_coords, uNew * vNew * wNew, 0, NULL, 1.0f); + BKE_lattice_deform_coords(ltOb, NULL, NULL, vert_coords, uNew * vNew * wNew, 0, NULL, 1.0f); copy_m4_m4(ltOb->obmat, mat); lt->typeu = typeu; @@ -759,14 +759,14 @@ static bool calc_curve_deform( return false; } -void curve_deform_verts(Object *cuOb, - Object *target, - float (*vert_coords)[3], - int numVerts, - MDeformVert *dvert, - const int defgrp_index, - short flag, - short defaxis) +void BKE_curve_deform_coords(Object *cuOb, + Object *target, + float (*vert_coords)[3], + int numVerts, + MDeformVert *dvert, + const int defgrp_index, + short flag, + short defaxis) { Curve *cu; int a; @@ -870,7 +870,7 @@ void curve_deform_verts(Object *cuOb, /* input vec and orco = local coord in armature space */ /* orco is original not-animated or deformed reference point */ /* result written in vec and mat */ -void curve_deform_vector( +void BKE_curve_deform_co( Object *cuOb, Object *target, float orco[3], float vec[3], float mat[3][3], int no_rot_axis) { CurveDeform cd; @@ -931,14 +931,14 @@ static void lattice_deform_vert_task(void *__restrict userdata, } } -void lattice_deform_verts(Object *laOb, - Object *target, - Mesh *mesh, - float (*vert_coords)[3], - int numVerts, - short flag, - const char *vgroup, - float fac) +void BKE_lattice_deform_coords(Object *laOb, + Object *target, + Mesh *mesh, + float (*vert_coords)[3], + int numVerts, + short flag, + const char *vgroup, + float fac) { LatticeDeformData *lattice_deform_data; MDeformVert *dvert = NULL; @@ -993,7 +993,8 @@ bool object_deform_mball(Object *ob, ListBase *dispbase) DispList *dl; for (dl = dispbase->first; dl; dl = dl->next) { - lattice_deform_verts(ob->parent, ob, NULL, (float(*)[3])dl->verts, dl->nr, 0, NULL, 1.0f); + BKE_lattice_deform_coords( + ob->parent, ob, NULL, (float(*)[3])dl->verts, dl->nr, 0, NULL, 1.0f); } return true; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c index 2d5e01ced94..a6c071e7103 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilarmature.c @@ -83,16 +83,16 @@ static void gpencil_deform_verts(ArmatureGpencilModifierData *mmd, Object *targe } /* deform verts */ - armature_deform_verts(mmd->object, - target, - NULL, - (float(*)[3])all_vert_coords, - NULL, - gps->totpoints, - mmd->deformflag, - (float(*)[3])mmd->prevCos, - mmd->vgname, - gps); + BKE_armature_deform_coords(mmd->object, + target, + NULL, + (float(*)[3])all_vert_coords, + NULL, + gps->totpoints, + mmd->deformflag, + (float(*)[3])mmd->prevCos, + mmd->vgname, + gps); /* Apply deformed coordinates */ pt = gps->points; diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index ad8d6ac8b8a..e394c30bbb8 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -146,16 +146,16 @@ static void deformVerts(ModifierData *md, MOD_previous_vcos_store(md, vertexCos); /* if next modifier needs original vertices */ - armature_deform_verts(amd->object, - ctx->object, - mesh, - vertexCos, - NULL, - numVerts, - amd->deformflag, - (float(*)[3])amd->prevCos, - amd->defgrp_name, - NULL); + BKE_armature_deform_coords(amd->object, + ctx->object, + mesh, + vertexCos, + NULL, + numVerts, + amd->deformflag, + (float(*)[3])amd->prevCos, + amd->defgrp_name, + NULL); /* free cache */ if (amd->prevCos) { @@ -181,16 +181,16 @@ static void deformVertsEM(ModifierData *md, MOD_previous_vcos_store(md, vertexCos); /* if next modifier needs original vertices */ - armature_deform_verts(amd->object, - ctx->object, - mesh_src, - vertexCos, - NULL, - numVerts, - amd->deformflag, - (float(*)[3])amd->prevCos, - amd->defgrp_name, - NULL); + BKE_armature_deform_coords(amd->object, + ctx->object, + mesh_src, + vertexCos, + NULL, + numVerts, + amd->deformflag, + (float(*)[3])amd->prevCos, + amd->defgrp_name, + NULL); /* free cache */ if (amd->prevCos) { @@ -214,16 +214,16 @@ static void deformMatricesEM(ModifierData *md, ArmatureModifierData *amd = (ArmatureModifierData *)md; Mesh *mesh_src = MOD_deform_mesh_eval_get(ctx->object, em, mesh, NULL, numVerts, false, false); - armature_deform_verts(amd->object, - ctx->object, - mesh_src, - vertexCos, - defMats, - numVerts, - amd->deformflag, - NULL, - amd->defgrp_name, - NULL); + BKE_armature_deform_coords(amd->object, + ctx->object, + mesh_src, + vertexCos, + defMats, + numVerts, + amd->deformflag, + NULL, + amd->defgrp_name, + NULL); if (mesh_src != mesh) { BKE_id_free(NULL, mesh_src); @@ -240,16 +240,16 @@ static void deformMatrices(ModifierData *md, ArmatureModifierData *amd = (ArmatureModifierData *)md; Mesh *mesh_src = MOD_deform_mesh_eval_get(ctx->object, NULL, mesh, NULL, numVerts, false, false); - armature_deform_verts(amd->object, - ctx->object, - mesh_src, - vertexCos, - defMats, - numVerts, - amd->deformflag, - NULL, - amd->defgrp_name, - NULL); + BKE_armature_deform_coords(amd->object, + ctx->object, + mesh_src, + vertexCos, + defMats, + numVerts, + amd->deformflag, + NULL, + amd->defgrp_name, + NULL); if (!ELEM(mesh_src, NULL, mesh)) { BKE_id_free(NULL, mesh_src); diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c index a2348539779..a081612e063 100644 --- a/source/blender/modifiers/intern/MOD_curve.c +++ b/source/blender/modifiers/intern/MOD_curve.c @@ -129,16 +129,16 @@ static void deformVerts(ModifierData *md, int defgrp_index = -1; MOD_get_vgroup(ctx->object, mesh_src, cmd->name, &dvert, &defgrp_index); - /* silly that defaxis and curve_deform_verts are off by 1 + /* silly that defaxis and BKE_curve_deform_coords are off by 1 * but leave for now to save having to call do_versions */ - curve_deform_verts(cmd->object, - ctx->object, - vertexCos, - numVerts, - dvert, - defgrp_index, - cmd->flag, - cmd->defaxis - 1); + BKE_curve_deform_coords(cmd->object, + ctx->object, + vertexCos, + numVerts, + dvert, + defgrp_index, + cmd->flag, + cmd->defaxis - 1); if (!ELEM(mesh_src, NULL, mesh)) { BKE_id_free(NULL, mesh_src); diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c index 4d96638fc83..27f556397be 100644 --- a/source/blender/modifiers/intern/MOD_lattice.c +++ b/source/blender/modifiers/intern/MOD_lattice.c @@ -113,14 +113,14 @@ static void deformVerts(ModifierData *md, MOD_previous_vcos_store(md, vertexCos); /* if next modifier needs original vertices */ - lattice_deform_verts(lmd->object, - ctx->object, - mesh_src, - vertexCos, - numVerts, - lmd->flag, - lmd->name, - lmd->strength); + BKE_lattice_deform_coords(lmd->object, + ctx->object, + mesh_src, + vertexCos, + numVerts, + lmd->flag, + lmd->name, + lmd->strength); if (!ELEM(mesh_src, NULL, mesh)) { BKE_id_free(NULL, mesh_src); |