Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/effect.c
| Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | static void precalculate_effector(struct Depsgraph *depsgraph, EffectorCache *eff) | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_rng_srandom(eff->pd->rng, eff->pd->seed + cfra); | BLI_rng_srandom(eff->pd->rng, eff->pd->seed + cfra); | ||||
| } | } | ||||
| if (eff->pd->forcefield == PFIELD_GUIDE && eff->ob->type == OB_CURVE) { | if (eff->pd->forcefield == PFIELD_GUIDE && eff->ob->type == OB_CURVE) { | ||||
| Curve *cu = eff->ob->data; | Curve *cu = eff->ob->data; | ||||
| if (cu->flag & CU_PATH) { | if (cu->flag & CU_PATH) { | ||||
| if (eff->ob->runtime.curve_cache == NULL || eff->ob->runtime.curve_cache->path == NULL || | if (eff->ob->runtime.curve_cache == NULL || | ||||
| eff->ob->runtime.curve_cache->path->data == NULL) { | eff->ob->runtime.curve_cache->anim_path_accum_length == NULL) { | ||||
| BKE_displist_make_curveTypes(depsgraph, eff->scene, eff->ob, false, false); | BKE_displist_make_curveTypes(depsgraph, eff->scene, eff->ob, false, false); | ||||
| } | } | ||||
| if (eff->ob->runtime.curve_cache->path && eff->ob->runtime.curve_cache->path->data) { | if (eff->ob->runtime.curve_cache->anim_path_accum_length) { | ||||
| where_on_path( | BKE_where_on_path( | ||||
| eff->ob, 0.0, eff->guide_loc, eff->guide_dir, NULL, &eff->guide_radius, NULL); | eff->ob, 0.0, eff->guide_loc, eff->guide_dir, NULL, &eff->guide_radius, NULL); | ||||
| mul_m4_v3(eff->ob->obmat, eff->guide_loc); | mul_m4_v3(eff->ob->obmat, eff->guide_loc); | ||||
| mul_mat3_m4_v3(eff->ob->obmat, eff->guide_dir); | mul_mat3_m4_v3(eff->ob->obmat, eff->guide_dir); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| else if (eff->pd->shape == PFIELD_SHAPE_SURFACE) { | else if (eff->pd->shape == PFIELD_SHAPE_SURFACE) { | ||||
| eff->surmd = (SurfaceModifierData *)BKE_modifiers_findby_type(eff->ob, eModifierType_Surface); | eff->surmd = (SurfaceModifierData *)BKE_modifiers_findby_type(eff->ob, eModifierType_Surface); | ||||
| ▲ Show 20 Lines • Show All 1,237 Lines • Show Last 20 Lines | |||||