Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_edit.c
| Show First 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | void GPENCIL_OT_editmode_toggle(wmOperatorType *ot) | ||||
| RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); | ||||
| } | } | ||||
| /* set select mode */ | /* set select mode */ | ||||
| static int gpencil_selectmode_toggle_exec(bContext *C, wmOperator *op) | static int gpencil_selectmode_toggle_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ToolSettings *ts = CTX_data_tool_settings(C); | ToolSettings *ts = CTX_data_tool_settings(C); | ||||
| Object *ob = CTX_data_active_object(C); | |||||
| const int mode = RNA_int_get(op->ptr, "mode"); | const int mode = RNA_int_get(op->ptr, "mode"); | ||||
| /* Just set mode */ | /* Just set mode */ | ||||
| ts->gpencil_selectmode = mode; | if (ob != NULL) { | ||||
| switch (ob->mode) { | |||||
| case OB_MODE_EDIT_GPENCIL: { | |||||
| ts->gpencil_selectmode_edit = mode; | |||||
| break; | |||||
| } | |||||
| case OB_MODE_SCULPT_GPENCIL: { | |||||
| ts->gpencil_selectmode_sculpt = mode; | |||||
| break; | |||||
| } | |||||
| default: { | |||||
| break; | |||||
| } | |||||
| } | |||||
| } | |||||
| WM_main_add_notifier(NC_SCENE | ND_TOOLSETTINGS, NULL); | WM_main_add_notifier(NC_SCENE | ND_TOOLSETTINGS, NULL); | ||||
| DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void GPENCIL_OT_selectmode_toggle(wmOperatorType *ot) | void GPENCIL_OT_selectmode_toggle(wmOperatorType *ot) | ||||
| ▲ Show 20 Lines • Show All 4,406 Lines • Show Last 20 Lines | |||||