Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gizmo_library/gizmo_library_presets.c
| Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | void ED_gizmo_draw_preset_circle(const struct wmGizmo *gz, | ||||
| float mat_rotate[4][4]; | float mat_rotate[4][4]; | ||||
| single_axis_convert(OB_POSZ, mat, axis, mat_rotate); | single_axis_convert(OB_POSZ, mat, axis, mat_rotate); | ||||
| ed_gizmo_draw_preset_geometry(gz, mat_rotate, select_id, &wm_gizmo_geom_data_dial); | ed_gizmo_draw_preset_geometry(gz, mat_rotate, select_id, &wm_gizmo_geom_data_dial); | ||||
| } | } | ||||
| void ED_gizmo_draw_preset_facemap( | void ED_gizmo_draw_preset_facemap( | ||||
| const bContext *C, const struct wmGizmo *gz, Object *ob, const int facemap, int select_id) | const bContext *C, const struct wmGizmo *gz, Object *ob, const int facemap, int select_id) | ||||
| { | { | ||||
| /* Dependency graph is supposed to be evaluated prior to draw. */ | |||||
| Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C); | |||||
| const bool is_select = (select_id != -1); | const bool is_select = (select_id != -1); | ||||
| const bool is_highlight = is_select && (gz->state & WM_GIZMO_STATE_HIGHLIGHT) != 0; | const bool is_highlight = is_select && (gz->state & WM_GIZMO_STATE_HIGHLIGHT) != 0; | ||||
| float color[4]; | float color[4]; | ||||
| gizmo_color_get(gz, is_highlight, color); | gizmo_color_get(gz, is_highlight, color); | ||||
| if (is_select) { | if (is_select) { | ||||
| GPU_select_load_id(select_id); | GPU_select_load_id(select_id); | ||||
| } | } | ||||
| GPU_matrix_push(); | GPU_matrix_push(); | ||||
| GPU_matrix_mul(ob->obmat); | GPU_matrix_mul(ob->obmat); | ||||
| ED_draw_object_facemap(CTX_data_depsgraph(C), ob, color, facemap); | ED_draw_object_facemap(depsgraph, ob, color, facemap); | ||||
| GPU_matrix_pop(); | GPU_matrix_pop(); | ||||
| if (is_select) { | if (is_select) { | ||||
| GPU_select_load_id(-1); | GPU_select_load_id(-1); | ||||
| } | } | ||||
| } | } | ||||