Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_gizmo_empty.c
| Show All 13 Lines | |||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DNA_light_types.h" | #include "DNA_light_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "ED_gizmo_library.h" | #include "ED_gizmo_library.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_undo.h" | |||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| ▲ Show 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | static void WIDGETGROUP_empty_image_refresh(const bContext *C, wmGizmoGroup *gzgroup) | ||||
| WM_gizmo_target_property_def_func(gz, | WM_gizmo_target_property_def_func(gz, | ||||
| "matrix", | "matrix", | ||||
| &(const struct wmGizmoPropertyFnParams){ | &(const struct wmGizmoPropertyFnParams){ | ||||
| .value_get_fn = gizmo_empty_image_prop_matrix_get, | .value_get_fn = gizmo_empty_image_prop_matrix_get, | ||||
| .value_set_fn = gizmo_empty_image_prop_matrix_set, | .value_set_fn = gizmo_empty_image_prop_matrix_set, | ||||
| .range_get_fn = NULL, | .range_get_fn = NULL, | ||||
| .user_data = igzgroup, | .user_data = igzgroup, | ||||
| }); | }); | ||||
| wmWindow *win = CTX_wm_window(C); | |||||
| if (gz->highlight_part == -1 && win->eventstate->val == KM_RELEASE) { | |||||
| ED_undo_push(C, "Interactive Image Gizmo"); | |||||
| } | |||||
| } | } | ||||
| void VIEW3D_GGT_empty_image(wmGizmoGroupType *gzgt) | void VIEW3D_GGT_empty_image(wmGizmoGroupType *gzgt) | ||||
| { | { | ||||
| gzgt->name = "Area Light Widgets"; | gzgt->name = "Area Light Widgets"; | ||||
| gzgt->idname = "VIEW3D_GGT_empty_image"; | gzgt->idname = "VIEW3D_GGT_empty_image"; | ||||
| gzgt->flag |= (WM_GIZMOGROUPTYPE_PERSISTENT | WM_GIZMOGROUPTYPE_3D | WM_GIZMOGROUPTYPE_DEPTH_3D); | gzgt->flag |= (WM_GIZMOGROUPTYPE_PERSISTENT | WM_GIZMOGROUPTYPE_3D | WM_GIZMOGROUPTYPE_DEPTH_3D); | ||||
| gzgt->poll = WIDGETGROUP_empty_image_poll; | gzgt->poll = WIDGETGROUP_empty_image_poll; | ||||
| gzgt->setup = WIDGETGROUP_empty_image_setup; | gzgt->setup = WIDGETGROUP_empty_image_setup; | ||||
| gzgt->setup_keymap = WM_gizmogroup_setup_keymap_generic_maybe_drag; | gzgt->setup_keymap = WM_gizmogroup_setup_keymap_generic_maybe_drag; | ||||
| gzgt->refresh = WIDGETGROUP_empty_image_refresh; | gzgt->refresh = WIDGETGROUP_empty_image_refresh; | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||