Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_primitive.c
| Show First 20 Lines • Show All 329 Lines • ▼ Show 20 Lines | static void gpencil_primitive_set_initdata(bContext *C, tGPDprimitive *tgpi) | ||||
| bGPDstroke *gps = MEM_callocN(sizeof(bGPDstroke), "Temp bGPDstroke"); | bGPDstroke *gps = MEM_callocN(sizeof(bGPDstroke), "Temp bGPDstroke"); | ||||
| gps->thickness = 2.0f; | gps->thickness = 2.0f; | ||||
| gps->fill_opacity_fac = 1.0f; | gps->fill_opacity_fac = 1.0f; | ||||
| gps->hardeness = 1.0f; | gps->hardeness = 1.0f; | ||||
| copy_v2_fl(gps->aspect_ratio, 1.0f); | copy_v2_fl(gps->aspect_ratio, 1.0f); | ||||
| gps->uv_scale = 1.0f; | gps->uv_scale = 1.0f; | ||||
| gps->inittime = 0.0f; | gps->inittime = 0.0f; | ||||
| /* Set stroke caps. */ | |||||
| gps->caps[0] = gps->caps[1] = brush->gpencil_settings->caps_type; | |||||
| /* Apply the vertex color to fill. */ | /* Apply the vertex color to fill. */ | ||||
| ED_gpencil_fill_vertex_color_set(ts, brush, gps); | ED_gpencil_fill_vertex_color_set(ts, brush, gps); | ||||
| gps->flag &= ~GP_STROKE_SELECT; | gps->flag &= ~GP_STROKE_SELECT; | ||||
| BKE_gpencil_stroke_select_index_reset(gps); | BKE_gpencil_stroke_select_index_reset(gps); | ||||
| /* the polygon must be closed, so enabled cyclic */ | /* the polygon must be closed, so enabled cyclic */ | ||||
| if (ELEM(tgpi->type, GP_STROKE_BOX, GP_STROKE_CIRCLE)) { | if (ELEM(tgpi->type, GP_STROKE_BOX, GP_STROKE_CIRCLE)) { | ||||
| gps->flag |= GP_STROKE_CYCLIC; | gps->flag |= GP_STROKE_CYCLIC; | ||||
| ▲ Show 20 Lines • Show All 1,795 Lines • Show Last 20 Lines | |||||