Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_utils.c
| Show First 20 Lines • Show All 743 Lines • ▼ Show 20 Lines | void PAINT_OT_face_select_hide(wmOperatorType *ot) | ||||
| ot->poll = facemask_paint_poll; | ot->poll = facemask_paint_poll; | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| RNA_def_boolean( | RNA_def_boolean( | ||||
| ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects"); | ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects"); | ||||
| } | } | ||||
| static int face_select_reveal_exec(bContext *C, wmOperator *op) | static int vert_select_hide_exec(bContext *C, wmOperator *op) | ||||
| { | |||||
| const bool unselected = RNA_boolean_get(op->ptr, "unselected"); | |||||
| Object *ob = CTX_data_active_object(C); | |||||
| paintvert_hide(C, ob, unselected); | |||||
| ED_region_tag_redraw(CTX_wm_region(C)); | |||||
| return OPERATOR_FINISHED; | |||||
| } | |||||
| void PAINT_OT_vert_select_hide(wmOperatorType *ot) | |||||
| { | |||||
| ot->name = "Vertex Select Hide"; | |||||
sybren: That's not really a friendly name, and it suggests that it selects as well as hides. How about… | |||||
Done Inline ActionsThe meaning is "Vertex Select: Hide", i.e. hide operating in Vertex Select mode. Also, I did not design this naming scheme, it is direct copy & paste of Face Select Hide. angavrilov: The meaning is "Vertex Select: Hide", i.e. hide operating in Vertex Select mode. Also, I did… | |||||
| ot->description = "Hide selected vertices"; | |||||
| ot->idname = "PAINT_OT_vert_select_hide"; | |||||
| ot->exec = vert_select_hide_exec; | |||||
| ot->poll = vert_paint_poll; | |||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | |||||
| RNA_def_boolean( | |||||
| ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected vertices"); | |||||
Not Done Inline Actionsobjects → vertices sybren: objects → vertices | |||||
Done Inline ActionsSame, this is verbatim copy & paste. angavrilov: Same, this is verbatim copy & paste. | |||||
| } | |||||
| static int face_vert_reveal_exec(bContext *C, wmOperator *op) | |||||
| { | { | ||||
| const bool select = RNA_boolean_get(op->ptr, "select"); | const bool select = RNA_boolean_get(op->ptr, "select"); | ||||
| Object *ob = CTX_data_active_object(C); | Object *ob = CTX_data_active_object(C); | ||||
| if (BKE_paint_select_vert_test(ob)) { | |||||
| paintvert_reveal(C, ob, select); | |||||
| } | |||||
| else { | |||||
Not Done Inline ActionsCode style. sybren: Code style. | |||||
| paintface_reveal(C, ob, select); | paintface_reveal(C, ob, select); | ||||
| } | |||||
| ED_region_tag_redraw(CTX_wm_region(C)); | ED_region_tag_redraw(CTX_wm_region(C)); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void PAINT_OT_face_select_reveal(wmOperatorType *ot) | static bool face_vert_reveal_poll(bContext *C) | ||||
| { | { | ||||
| ot->name = "Face Select Reveal"; | Object *ob = CTX_data_active_object(C); | ||||
| ot->description = "Reveal hidden faces"; | |||||
| ot->idname = "PAINT_OT_face_select_reveal"; | |||||
| ot->exec = face_select_reveal_exec; | /* Allow using this operator when no selection is enabled but hiding is applied. */ | ||||
| ot->poll = facemask_paint_poll; | return BKE_paint_select_elem_test(ob) || BKE_paint_always_hide_test(ob); | ||||
| } | |||||
| void PAINT_OT_face_vert_reveal(wmOperatorType *ot) | |||||
| { | |||||
| ot->name = "Reveal Faces/Vertices"; | |||||
Not Done Inline ActionsSame as above, not really a friendly name. "Reveal Faces/Vertices" is better IMO. sybren: Same as above, not really a friendly name. "Reveal Faces/Vertices" is better IMO. | |||||
Done Inline ActionsThe naming scheme is not my idea, I only added "Vertex". angavrilov: The naming scheme is not my idea, I only added "Vertex". | |||||
| ot->description = "Reveal hidden faces and vertices"; | |||||
| ot->idname = "PAINT_OT_face_vert_reveal"; | |||||
| ot->exec = face_vert_reveal_exec; | |||||
| ot->poll = face_vert_reveal_poll; | |||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| RNA_def_boolean(ot->srna, "select", true, "Select", ""); | RNA_def_boolean(ot->srna, | ||||
| "select", | |||||
| true, | |||||
| "Select", | |||||
| "Specifies whether the newly revealed geometry should be selected"); | |||||
Not Done Inline ActionsThis should get some explanation, either here or in the operator description. Does this replace the current selection? Add to the selection? Something else? sybren: This should get some explanation, either here or in the operator description. Does this replace… | |||||
Done Inline ActionsI did not change this code. angavrilov: I did not change this code. | |||||
| } | } | ||||
That's not really a friendly name, and it suggests that it selects as well as hides. How about "Hide Vertices"?
The fact that this operates on selected vertices by default is so common that I feel it's fine to remove the "select" out of the name.