Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_edit.c
| Show First 20 Lines • Show All 3,980 Lines • ▼ Show 20 Lines | if (changed) { | ||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | ||||
| } | } | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void GPENCIL_OT_reproject(wmOperatorType *ot) | void GPENCIL_OT_reproject(wmOperatorType *ot) | ||||
| { | { | ||||
| PropertyRNA *prop; | |||||
| static const EnumPropertyItem reproject_type[] = { | static const EnumPropertyItem reproject_type[] = { | ||||
| {GP_REPROJECT_FRONT, "FRONT", 0, "Front", "Reproject the strokes using the X-Z plane"}, | {GP_REPROJECT_FRONT, "FRONT", 0, "Front", "Reproject the strokes using the X-Z plane"}, | ||||
| {GP_REPROJECT_SIDE, "SIDE", 0, "Side", "Reproject the strokes using the Y-Z plane"}, | {GP_REPROJECT_SIDE, "SIDE", 0, "Side", "Reproject the strokes using the Y-Z plane"}, | ||||
| {GP_REPROJECT_TOP, "TOP", 0, "Top", "Reproject the strokes using the X-Y plane"}, | {GP_REPROJECT_TOP, "TOP", 0, "Top", "Reproject the strokes using the X-Y plane"}, | ||||
| {GP_REPROJECT_VIEW, | {GP_REPROJECT_VIEW, | ||||
| "VIEW", | "VIEW", | ||||
| 0, | 0, | ||||
| "View", | "View", | ||||
| Show All 29 Lines | void GPENCIL_OT_reproject(wmOperatorType *ot) | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| /* properties */ | /* properties */ | ||||
| ot->prop = RNA_def_enum( | ot->prop = RNA_def_enum( | ||||
| ot->srna, "type", reproject_type, GP_REPROJECT_VIEW, "Projection Type", ""); | ot->srna, "type", reproject_type, GP_REPROJECT_VIEW, "Projection Type", ""); | ||||
| RNA_def_boolean( | prop = RNA_def_boolean( | ||||
| ot->srna, | ot->srna, | ||||
| "keep_original", | "keep_original", | ||||
| 0, | 0, | ||||
| "Keep Original", | "Keep Original", | ||||
| "Keep original strokes and create a copy before reprojecting instead of reproject them"); | "Keep original strokes and create a copy before reprojecting instead of reproject them"); | ||||
| RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_MOVIECLIP); | |||||
| } | } | ||||
| static int gpencil_recalc_geometry_exec(bContext *C, wmOperator *UNUSED(op)) | static int gpencil_recalc_geometry_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| Object *ob = CTX_data_active_object(C); | Object *ob = CTX_data_active_object(C); | ||||
| if ((ob == NULL) || (ob->type != OB_GPENCIL)) { | if ((ob == NULL) || (ob->type != OB_GPENCIL)) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,951 Lines • Show Last 20 Lines | |||||