Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_simpledeform.c
| Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | default: | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* simple deform modifier */ | /* simple deform modifier */ | ||||
| static void SimpleDeformModifier_do( | static void SimpleDeformModifier_do( | ||||
| SimpleDeformModifierData *smd, const ModifierEvalContext *ctx, | SimpleDeformModifierData *smd, const ModifierEvalContext *UNUSED(ctx), | ||||
| struct Object *ob, struct Mesh *mesh, | struct Object *ob, struct Mesh *mesh, | ||||
| float (*vertexCos)[3], int numVerts) | float (*vertexCos)[3], int numVerts) | ||||
| { | { | ||||
| const float base_limit[2] = {0.0f, 0.0f}; | const float base_limit[2] = {0.0f, 0.0f}; | ||||
| int i; | int i; | ||||
| float smd_limit[2], smd_factor; | float smd_limit[2], smd_factor; | ||||
| SpaceTransform *transf = NULL, tmp_transf; | SpaceTransform *transf = NULL, tmp_transf; | ||||
| void (*simpleDeform_callback)(const float factor, const int axis, const float dcut[3], float co[3]) = NULL; /* Mode callback */ | void (*simpleDeform_callback)(const float factor, const int axis, const float dcut[3], float co[3]) = NULL; /* Mode callback */ | ||||
| Show All 27 Lines | static void SimpleDeformModifier_do( | ||||
| if (smd->limit[0] < 0.0f) smd->limit[0] = 0.0f; | if (smd->limit[0] < 0.0f) smd->limit[0] = 0.0f; | ||||
| if (smd->limit[0] > 1.0f) smd->limit[0] = 1.0f; | if (smd->limit[0] > 1.0f) smd->limit[0] = 1.0f; | ||||
| smd->limit[0] = min_ff(smd->limit[0], smd->limit[1]); /* Upper limit >= than lower limit */ | smd->limit[0] = min_ff(smd->limit[0], smd->limit[1]); /* Upper limit >= than lower limit */ | ||||
| /* Calculate matrixs do convert between coordinate spaces */ | /* Calculate matrixs do convert between coordinate spaces */ | ||||
| if (smd->origin != NULL) { | if (smd->origin != NULL) { | ||||
| transf = &tmp_transf; | transf = &tmp_transf; | ||||
| BLI_SPACE_TRANSFORM_SETUP(transf, ob, DEG_get_evaluated_object(ctx->depsgraph, smd->origin)); | BLI_SPACE_TRANSFORM_SETUP(transf, ob, smd->origin); | ||||
| } | } | ||||
| /* Update limits if needed */ | /* Update limits if needed */ | ||||
| int limit_axis = deform_axis; | int limit_axis = deform_axis; | ||||
| if (smd->mode == MOD_SIMPLEDEFORM_MODE_BEND) { | if (smd->mode == MOD_SIMPLEDEFORM_MODE_BEND) { | ||||
| /* Bend is a special case. */ | /* Bend is a special case. */ | ||||
| switch (deform_axis) { | switch (deform_axis) { | ||||
| case 0: | case 0: | ||||
| ▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines | |||||