Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_modifier.c
| Show First 20 Lines • Show All 2,682 Lines • ▼ Show 20 Lines | och = BKE_ocean_init_cache(omd->cachepath, | ||||
| omd->foam_fade, | omd->foam_fade, | ||||
| omd->resolution); | omd->resolution); | ||||
| och->time = MEM_mallocN(och->duration * sizeof(float), "foam bake time"); | och->time = MEM_mallocN(och->duration * sizeof(float), "foam bake time"); | ||||
| cfra = scene->r.cfra; | cfra = scene->r.cfra; | ||||
| /* precalculate time variable before baking */ | /* precalculate time variable before baking */ | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); | |||||
| for (f = omd->bakestart; f <= omd->bakeend; f++) { | for (f = omd->bakestart; f <= omd->bakeend; f++) { | ||||
| /* For now only simple animation of time value is supported, nothing else. | /* For now only simple animation of time value is supported, nothing else. | ||||
| * No drivers or other modifier parameters. */ | * No drivers or other modifier parameters. */ | ||||
| /* TODO(sergey): This operates on an original data, so no flush is needed. However, baking | /* TODO(sergey): This operates on an original data, so no flush is needed. However, baking | ||||
| * usually should happen on an evaluated objects, so this seems to be deeper issue here. */ | * usually should happen on an evaluated objects, so this seems to be deeper issue here. */ | ||||
| BKE_animsys_evaluate_animdata((ID *)ob, ob->adt, f, ADT_RECALC_ANIM, false); | |||||
| const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context(depsgraph, f); | |||||
| BKE_animsys_evaluate_animdata((ID *)ob, ob->adt, &anim_eval_context, ADT_RECALC_ANIM, false); | |||||
| och->time[i] = omd->time; | och->time[i] = omd->time; | ||||
| i++; | i++; | ||||
| } | } | ||||
| /* make a copy of ocean to use for baking - threadsafety */ | /* make a copy of ocean to use for baking - threadsafety */ | ||||
| ocean = BKE_ocean_add(); | ocean = BKE_ocean_add(); | ||||
| BKE_ocean_init_from_modifier(ocean, omd); | BKE_ocean_init_from_modifier(ocean, omd); | ||||
| ▲ Show 20 Lines • Show All 215 Lines • Show Last 20 Lines | |||||