Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_utils.c
| Show All 40 Lines | |||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_screen_types.h" | #include "DNA_screen_types.h" | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "DNA_view3d_types.h" | #include "DNA_view3d_types.h" | ||||
| #include "BKE_action.h" | #include "BKE_action.h" | ||||
| #include "BKE_colortools.h" | #include "BKE_colortools.h" | ||||
| #include "BKE_collection.h" | |||||
| #include "BKE_deform.h" | #include "BKE_deform.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_brush.h" | #include "BKE_brush.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_gpencil.h" | #include "BKE_gpencil.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_material.h" | #include "BKE_material.h" | ||||
| #include "BKE_tracking.h" | #include "BKE_tracking.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | |||||
| #include "WM_toolsystem.h" | #include "WM_toolsystem.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "UI_view2d.h" | #include "UI_view2d.h" | ||||
| ▲ Show 20 Lines • Show All 2,486 Lines • ▼ Show 20 Lines | if (clear) { | ||||
| *buffer_used = 0; | *buffer_used = 0; | ||||
| if (buffer_array != NULL) { | if (buffer_array != NULL) { | ||||
| memset(buffer_array, 0, sizeof(tGPspoint) * *buffer_size); | memset(buffer_array, 0, sizeof(tGPspoint) * *buffer_size); | ||||
| } | } | ||||
| } | } | ||||
| return buffer_array; | return buffer_array; | ||||
| } | } | ||||
| /* Tag all scene grease pencil object to update. */ | |||||
| void ED_gpencil_tag_scene_gpencil(Scene *scene) | |||||
| { | |||||
| /* mark all grease pencil datablocks of the scene */ | |||||
| FOREACH_SCENE_COLLECTION_BEGIN (scene, collection) { | |||||
| FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (collection, ob) { | |||||
| if (ob->type == OB_GPENCIL) { | |||||
| bGPdata *gpd = (bGPdata *)ob->data; | |||||
| gpd->flag |= GP_DATA_CACHE_IS_DIRTY; | |||||
| DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | |||||
| } | |||||
| } | |||||
| FOREACH_COLLECTION_OBJECT_RECURSIVE_END; | |||||
| } | |||||
| FOREACH_SCENE_COLLECTION_END; | |||||
| DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); | |||||
| WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL); | |||||
| } | |||||