Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/effect.c
| Show First 20 Lines • Show All 309 Lines • ▼ Show 20 Lines | for (EffectorRelation *relation = relations->first; relation; relation = relation->next) { | ||||
| else { | else { | ||||
| /* Object effector. */ | /* Object effector. */ | ||||
| if (ob == ob_src) { | if (ob == ob_src) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| else if (weights->weight[ob->pd->forcefield] == 0.0f) { | else if (weights->weight[ob->pd->forcefield] == 0.0f) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| else if (ob->pd->shape == PFIELD_SHAPE_POINTS && ob->runtime.mesh_eval == NULL) { | else if (ob->pd->shape == PFIELD_SHAPE_POINTS && BKE_object_get_evaluated_mesh(ob) == NULL) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| add_effector_evaluation(&effectors, depsgraph, scene, ob, NULL, ob->pd); | add_effector_evaluation(&effectors, depsgraph, scene, ob, NULL, ob->pd); | ||||
| } | } | ||||
| } | } | ||||
| return effectors; | return effectors; | ||||
| ▲ Show 20 Lines • Show All 324 Lines • ▼ Show 20 Lines | if (eff->pd && eff->pd->shape == PFIELD_SHAPE_SURFACE && eff->surmd && eff->surmd->bvhtree) { | ||||
| add_v3_v3(vec, point->loc); | add_v3_v3(vec, point->loc); | ||||
| ret = closest_point_on_surface( | ret = closest_point_on_surface( | ||||
| eff->surmd, vec, efd->loc, efd->nor, real_velocity ? efd->vel : NULL); | eff->surmd, vec, efd->loc, efd->nor, real_velocity ? efd->vel : NULL); | ||||
| efd->size = 0.0f; | efd->size = 0.0f; | ||||
| } | } | ||||
| else if (eff->pd && eff->pd->shape == PFIELD_SHAPE_POINTS) { | else if (eff->pd && eff->pd->shape == PFIELD_SHAPE_POINTS) { | ||||
| Mesh *me_eval = eff->ob->runtime.mesh_eval; | Mesh *me_eval = BKE_object_get_evaluated_mesh(eff->ob); | ||||
| if (me_eval != NULL) { | if (me_eval != NULL) { | ||||
| copy_v3_v3(efd->loc, me_eval->mvert[*efd->index].co); | copy_v3_v3(efd->loc, me_eval->mvert[*efd->index].co); | ||||
| normal_short_to_float_v3(efd->nor, me_eval->mvert[*efd->index].no); | normal_short_to_float_v3(efd->nor, me_eval->mvert[*efd->index].no); | ||||
| mul_m4_v3(eff->ob->obmat, efd->loc); | mul_m4_v3(eff->ob->obmat, efd->loc); | ||||
| mul_mat3_m4_v3(eff->ob->obmat, efd->nor); | mul_mat3_m4_v3(eff->ob->obmat, efd->nor); | ||||
| normalize_v3(efd->nor); | normalize_v3(efd->nor); | ||||
| ▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void get_effector_tot( | static void get_effector_tot( | ||||
| EffectorCache *eff, EffectorData *efd, EffectedPoint *point, int *tot, int *p, int *step) | EffectorCache *eff, EffectorData *efd, EffectedPoint *point, int *tot, int *p, int *step) | ||||
| { | { | ||||
| *p = 0; | *p = 0; | ||||
| efd->index = p; | efd->index = p; | ||||
| if (eff->pd->shape == PFIELD_SHAPE_POINTS) { | if (eff->pd->shape == PFIELD_SHAPE_POINTS) { | ||||
| Mesh *me_eval = eff->ob->runtime.mesh_eval; | Mesh *me_eval = BKE_object_get_evaluated_mesh(eff->ob); | ||||
| *tot = me_eval != NULL ? me_eval->totvert : 1; | *tot = me_eval != NULL ? me_eval->totvert : 1; | ||||
| if (*tot && eff->pd->forcefield == PFIELD_HARMONIC && point->index >= 0) { | if (*tot && eff->pd->forcefield == PFIELD_HARMONIC && point->index >= 0) { | ||||
| *p = point->index % *tot; | *p = point->index % *tot; | ||||
| *tot = *p + 1; | *tot = *p + 1; | ||||
| } | } | ||||
| } | } | ||||
| else if (eff->psys) { | else if (eff->psys) { | ||||
| ▲ Show 20 Lines • Show All 565 Lines • Show Last 20 Lines | |||||