Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_mesh.c
| Show First 20 Lines • Show All 240 Lines • ▼ Show 20 Lines | for (int i = frame_start; i < frame_end + 1; i++) { | ||||
| key++; | key++; | ||||
| /* Jump if not step limit but include last frame always. */ | /* Jump if not step limit but include last frame always. */ | ||||
| if ((key % step != 0) && (i != frame_end)) { | if ((key % step != 0) && (i != frame_end)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* Move scene to new frame. */ | /* Move scene to new frame. */ | ||||
| CFRA = i; | CFRA = i; | ||||
| BKE_scene_graph_update_for_newframe(depsgraph, bmain); | BKE_scene_graph_update_for_newframe(depsgraph); | ||||
| /* Loop all objects in the list. */ | /* Loop all objects in the list. */ | ||||
| LISTBASE_FOREACH (GpBakeOb *, elem, &list) { | LISTBASE_FOREACH (GpBakeOb *, elem, &list) { | ||||
| Object *ob_eval = (Object *)DEG_get_evaluated_object(depsgraph, elem->ob); | Object *ob_eval = (Object *)DEG_get_evaluated_object(depsgraph, elem->ob); | ||||
| /* Generate strokes. */ | /* Generate strokes. */ | ||||
| BKE_gpencil_convert_mesh(bmain, | BKE_gpencil_convert_mesh(bmain, | ||||
| depsgraph, | depsgraph, | ||||
| Show All 24 Lines | LISTBASE_FOREACH (GpBakeOb *, elem, &list) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Return scene frame state and DB to original state. */ | /* Return scene frame state and DB to original state. */ | ||||
| CFRA = oldframe; | CFRA = oldframe; | ||||
| BKE_scene_graph_update_for_newframe(depsgraph, bmain); | BKE_scene_graph_update_for_newframe(depsgraph); | ||||
| /* Remove unused materials. */ | /* Remove unused materials. */ | ||||
| int actcol = ob_gpencil->actcol; | int actcol = ob_gpencil->actcol; | ||||
| for (int slot = 1; slot <= ob_gpencil->totcol; slot++) { | for (int slot = 1; slot <= ob_gpencil->totcol; slot++) { | ||||
| while (slot <= ob_gpencil->totcol && !BKE_object_material_slot_used(ob_gpencil->data, slot)) { | while (slot <= ob_gpencil->totcol && !BKE_object_material_slot_used(ob_gpencil->data, slot)) { | ||||
| ob_gpencil->actcol = slot; | ob_gpencil->actcol = slot; | ||||
| BKE_object_material_slot_remove(CTX_data_main(C), ob_gpencil); | BKE_object_material_slot_remove(CTX_data_main(C), ob_gpencil); | ||||
| ▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines | |||||