Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/util/gizmo_utils.c
| Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | bool ED_gizmo_poll_or_unlink_delayed_from_tool_ex(const bContext *C, | ||||
| return true; | return true; | ||||
| } | } | ||||
| /** Can use this as poll function directly. */ | /** Can use this as poll function directly. */ | ||||
| bool ED_gizmo_poll_or_unlink_delayed_from_tool(const bContext *C, wmGizmoGroupType *gzgt) | bool ED_gizmo_poll_or_unlink_delayed_from_tool(const bContext *C, wmGizmoGroupType *gzgt) | ||||
| { | { | ||||
| return ED_gizmo_poll_or_unlink_delayed_from_tool_ex(C, gzgt, gzgt->idname); | return ED_gizmo_poll_or_unlink_delayed_from_tool_ex(C, gzgt, gzgt->idname); | ||||
| } | } | ||||
| bool ED_gizmo_poll_from_tool_ex(const bContext *C, const char *gzgt_idname) | |||||
| { | |||||
| bToolRef_Runtime *tref_rt = WM_toolsystem_runtime_from_context((bContext *)C); | |||||
| if ((tref_rt == NULL) || !STREQ(gzgt_idname, tref_rt->gizmo_group)) { | |||||
| return false; | |||||
| } | |||||
| return true; | |||||
| } | |||||
| bool ED_gizmo_poll_from_tool(const bContext *C, const wmGizmoGroupType *gzgt) | |||||
| { | |||||
| return ED_gizmo_poll_from_tool_ex(C, gzgt->idname); | |||||
| } | |||||
| bool ED_gizmo_poll_from_dropbox_ex(const bContext *C, const char *gzgt_idname) | |||||
| { | |||||
| return WM_drag_with_gizmogroup_find(CTX_wm_manager(C), gzgt_idname) != NULL; | |||||
| } | |||||
| bool ED_gizmo_poll_from_dropbox(const bContext *C, const wmGizmoGroupType *gzgt) | |||||
| { | |||||
| return ED_gizmo_poll_from_dropbox_ex(C, gzgt->idname); | |||||
| } | |||||