Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_surfacedeform.c
| Show First 20 Lines • Show All 1,118 Lines • ▼ Show 20 Lines | for (int j = 0; j < data->bind_verts[index].numbinds; j++, sdbind++) { | ||||
| madd_v3_v3fl(temp, norm, sdbind->normal_dist); | madd_v3_v3fl(temp, norm, sdbind->normal_dist); | ||||
| madd_v3_v3fl(vertexCos, temp, sdbind->influence); | madd_v3_v3fl(vertexCos, temp, sdbind->influence); | ||||
| } | } | ||||
| } | } | ||||
| static void surfacedeformModifier_do( | static void surfacedeformModifier_do( | ||||
| ModifierData *md, | ModifierData *md, | ||||
| const ModifierEvalContext *ctx, | const ModifierEvalContext *UNUSED(ctx), | ||||
| float (*vertexCos)[3], unsigned int numverts, Object *ob) | float (*vertexCos)[3], unsigned int numverts, Object *ob) | ||||
| { | { | ||||
| SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md; | SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md; | ||||
| Mesh *target; | Mesh *target; | ||||
| unsigned int tnumverts, tnumpoly; | unsigned int tnumverts, tnumpoly; | ||||
| /* Exit function if bind flag is not set (free bind data if any). */ | /* Exit function if bind flag is not set (free bind data if any). */ | ||||
| if (!(smd->flags & MOD_SDEF_BIND)) { | if (!(smd->flags & MOD_SDEF_BIND)) { | ||||
| /* Note: with new CoW system, we expect unbinding to be done by a special call from main thread, | /* Note: with new CoW system, we expect unbinding to be done by a special call from main thread, | ||||
| * outside of depsgraph evaluation (see object_force_modifier_update_for_bind() in object_modifier.c). */ | * outside of depsgraph evaluation (see object_force_modifier_update_for_bind() in object_modifier.c). */ | ||||
| if (smd->verts != NULL) { | if (smd->verts != NULL) { | ||||
| if (ob != DEG_get_original_object(ob)) { | if (ob != DEG_get_original_object(ob)) { | ||||
| BLI_assert(!"Trying to unbind inside of depsgraph evaluation"); | BLI_assert(!"Trying to unbind inside of depsgraph evaluation"); | ||||
| modifier_setError(md, "Trying to unbind inside of depsgraph evaluation"); | modifier_setError(md, "Trying to unbind inside of depsgraph evaluation"); | ||||
| } | } | ||||
| else { | else { | ||||
| freeData(md); | freeData(md); | ||||
| } | } | ||||
| } | } | ||||
| return; | return; | ||||
| } | } | ||||
| Object *ob_target = DEG_get_evaluated_object(ctx->depsgraph, smd->target); | Object *ob_target = smd->target; | ||||
| target = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_target, false); | target = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_target, false); | ||||
| #if 0 /* Should not be needed anymore since we always get that mesh from eval object ? */ | #if 0 /* Should not be needed anymore since we always get that mesh from eval object ? */ | ||||
| if (target == NULL && smd->verts == NULL && ob == DEG_get_original_object(ob)) { | if (target == NULL && smd->verts == NULL && ob == DEG_get_original_object(ob)) { | ||||
| /* Special case, binding happens outside of depsgraph evaluation, so we can build our own | /* Special case, binding happens outside of depsgraph evaluation, so we can build our own | ||||
| * target mesh if needed. */ | * target mesh if needed. */ | ||||
| target = mesh_create_eval_final_view(ctx->depsgraph, DEG_get_input_scene(ctx->depsgraph), smd->target, CD_MASK_BAREMESH); | target = mesh_create_eval_final_view(ctx->depsgraph, DEG_get_input_scene(ctx->depsgraph), smd->target, CD_MASK_BAREMESH); | ||||
| free_target = target != NULL; | free_target = target != NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines | |||||