Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_modifier.c
| Show First 20 Lines • Show All 2,310 Lines • ▼ Show 20 Lines | static int ocean_bake_exec(bContext *C, wmOperator *op) | ||||
| 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 */ | ||||
| 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. */ | ||||
| BKE_animsys_evaluate_animdata( | /* TODO(sergey): This operates on an original data, so no flush is needed. However, baking | ||||
| CTX_data_depsgraph(C), scene, (ID *)ob, ob->adt, f, ADT_RECALC_ANIM); | * usually should happen on an evaluated objects, so this seems to be deeper issue here. */ | ||||
| BKE_animsys_evaluate_animdata(scene, (ID *)ob, ob->adt, f, 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 205 Lines • Show Last 20 Lines | |||||