Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/MOD_gpencilshrinkwrap.c
| Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { | ||||
| BKE_scene_graph_update_for_newframe(depsgraph); | BKE_scene_graph_update_for_newframe(depsgraph); | ||||
| /* Recalculate shrinkwrap data. */ | /* Recalculate shrinkwrap data. */ | ||||
| if (mmd->cache_data) { | if (mmd->cache_data) { | ||||
| BKE_shrinkwrap_free_tree(mmd->cache_data); | BKE_shrinkwrap_free_tree(mmd->cache_data); | ||||
| MEM_SAFE_FREE(mmd->cache_data); | MEM_SAFE_FREE(mmd->cache_data); | ||||
| } | } | ||||
| Object *ob_target = DEG_get_evaluated_object(depsgraph, mmd->target); | Object *ob_target = DEG_get_evaluated_object(depsgraph, mmd->target); | ||||
| Mesh *target = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_target, false); | Mesh *target = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_target); | ||||
| mmd->cache_data = MEM_callocN(sizeof(ShrinkwrapTreeData), __func__); | mmd->cache_data = MEM_callocN(sizeof(ShrinkwrapTreeData), __func__); | ||||
| if (BKE_shrinkwrap_init_tree( | if (BKE_shrinkwrap_init_tree( | ||||
| mmd->cache_data, target, mmd->shrink_type, mmd->shrink_mode, false)) { | mmd->cache_data, target, mmd->shrink_type, mmd->shrink_mode, false)) { | ||||
| /* Compute shrinkwrap effects on this frame. */ | /* Compute shrinkwrap effects on this frame. */ | ||||
| LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { | LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { | ||||
| deformStroke(md, depsgraph, ob, gpl, gpf, gps); | deformStroke(md, depsgraph, ob, gpl, gpf, gps); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 176 Lines • Show Last 20 Lines | |||||