Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_merge.c
| Show All 29 Lines | |||||
| #include "BLI_ghash.h" | #include "BLI_ghash.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "DNA_gpencil_types.h" | #include "DNA_gpencil_types.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_main.h" | |||||
| #include "BKE_material.h" | #include "BKE_material.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | for (int i = 0; i < totpoints; i++) { | ||||
| pt_dst->uv_fac = 1.0f; | pt_dst->uv_fac = 1.0f; | ||||
| pt_dst->uv_rot = 0; | pt_dst->uv_rot = 0; | ||||
| pt_dst->flag |= GP_SPOINT_SELECT; | pt_dst->flag |= GP_SPOINT_SELECT; | ||||
| } | } | ||||
| } | } | ||||
| static bGPDstroke *gpencil_prepare_stroke(bContext *C, wmOperator *op, int totpoints) | static bGPDstroke *gpencil_prepare_stroke(bContext *C, wmOperator *op, int totpoints) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | |||||
| ToolSettings *ts = CTX_data_tool_settings(C); | ToolSettings *ts = CTX_data_tool_settings(C); | ||||
| Object *ob = CTX_data_active_object(C); | Object *ob = CTX_data_active_object(C); | ||||
| bGPDlayer *gpl = CTX_data_active_gpencil_layer(C); | bGPDlayer *gpl = CTX_data_active_gpencil_layer(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| const bool back = RNA_boolean_get(op->ptr, "back"); | const bool back = RNA_boolean_get(op->ptr, "back"); | ||||
| const bool additive = RNA_boolean_get(op->ptr, "additive"); | const bool additive = RNA_boolean_get(op->ptr, "additive"); | ||||
| const bool cyclic = RNA_boolean_get(op->ptr, "cyclic"); | const bool cyclic = RNA_boolean_get(op->ptr, "cyclic"); | ||||
| Paint *paint = &ts->gp_paint->paint; | Paint *paint = &ts->gp_paint->paint; | ||||
| /* if not exist, create a new one */ | /* if not exist, create a new one */ | ||||
| if ((paint->brush == NULL) || (paint->brush->gpencil_settings == NULL)) { | if ((paint->brush == NULL) || (paint->brush->gpencil_settings == NULL)) { | ||||
| /* create new brushes */ | /* create new brushes */ | ||||
| BKE_brush_gpencil_presets(C); | BKE_brush_gpencil_presets(bmain, ts); | ||||
| } | } | ||||
| Brush *brush = paint->brush; | Brush *brush = paint->brush; | ||||
| /* frame */ | /* frame */ | ||||
| short add_frame_mode; | short add_frame_mode; | ||||
| if (additive) { | if (additive) { | ||||
| add_frame_mode = GP_GETFRAME_ADD_COPY; | add_frame_mode = GP_GETFRAME_ADD_COPY; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 447 Lines • Show Last 20 Lines | |||||