62 const char *default_tool);
85 if (
area->runtime.is_tool_set) {
101 if ((tref->space_type == tkey->
space_type) && (tref->mode == tkey->
mode)) {
179 const int value = items[i].
value;
198 const int slot_index = items[i].
value;
263 if (tref->tag == 0) {
294 if (tref->
tag == 0) {
320 if (tref_rt != tref->
runtime) {
326 bool use_fallback_keymap =
false;
333 use_fallback_keymap =
true;
338 if (use_fallback_keymap ==
false) {
402 if (paint && paint->
brush && items) {
408 const char *name = items[i].
name;
456 switch (space_type) {
493 space_type =
area->spacetype;
522 int space_type_mask_handled = 0;
525 const int space_type_mask = (1 <<
area->spacetype);
527 ((space_type_mask_handled & space_type_mask) == 0)) {
528 space_type_mask_handled |= space_type_mask;
534 if (tref !=
area->runtime.tool) {
560 area->runtime.is_tool_set =
true;
563 if (tref->space_type ==
area->spacetype) {
564 if (tref->mode == mode) {
565 area->runtime.tool = tref;
580 space_type_has_tools[tref->space_type] =
true;
586 area->runtime.is_tool_set =
true;
587 if (space_type_has_tools[
area->spacetype]) {
608 if (mode == tref->
mode) {
609 area->runtime.tool = tref;
610 area->runtime.is_tool_set =
true;
674 switch (tkey->
mode) {
681 return "builtin_brush.Draw";
683 return "builtin_brush.Push";
685 return "builtin_brush.Weight";
687 return "builtin_brush.Draw";
691 return "builtin_brush.Comb";
693 return "builtin.cursor";
697 switch (tkey->
mode) {
699 return "builtin_brush.Draw";
703 return "builtin.select_box";
706 switch (tkey->
mode) {
708 return "builtin.select";
710 return "builtin.sample";
712 return "builtin.select";
714 return "builtin.select_box";
718 return "builtin.select_box";
727 const char *default_tool)
731 if (default_tool ==
NULL) {
765 if (win != win_prev) {
767 if (workspace_iter != workspace) {
802 return tref_rt && (tref_rt->
data_block[0] !=
'\0');
819 }
while ((win = win->
next));
850 return (prop !=
NULL);
#define BKE_brush_tool_set(brush, p, tool)
#define BKE_brush_tool_get(brush, p)
struct Brush * BKE_brush_add(struct Main *bmain, const char *name, const eObjectMode ob_mode)
struct WorkSpace * CTX_wm_workspace(const bContext *C)
struct ScrArea * CTX_wm_area(const bContext *C)
void CTX_wm_region_set(bContext *C, struct ARegion *region)
@ CTX_MODE_WEIGHT_GPENCIL
@ CTX_MODE_VERTEX_GPENCIL
@ CTX_MODE_SCULPT_GPENCIL
struct ViewLayer * CTX_data_view_layer(const bContext *C)
void CTX_wm_window_set(bContext *C, struct wmWindow *win)
enum eContextObjectMode CTX_data_mode_enum_ex(const struct Object *obedit, const struct Object *ob, const eObjectMode object_mode)
struct wmMsgBus * CTX_wm_message_bus(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
void CTX_wm_area_set(bContext *C, struct ScrArea *area)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
void IDP_ReplaceInGroup_ex(struct IDProperty *group, struct IDProperty *prop, struct IDProperty *prop_exist)
struct IDProperty * IDP_GetPropertyFromGroup(const struct IDProperty *prop, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void IDP_MergeGroup(struct IDProperty *dest, const struct IDProperty *src, const bool do_overwrite) ATTR_NONNULL()
struct IDProperty * IDP_New(const char type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct IDProperty * IDP_CopyProperty(const struct IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct ID * BKE_libblock_find_name(struct Main *bmain, const short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BKE_paint_brush_set(struct Paint *paint, struct Brush *br)
struct Paint * BKE_paint_get_active_from_paintmode(struct Scene *sce, ePaintMode mode)
struct Brush * BKE_paint_toolslots_brush_get(struct Paint *paint, int slot_index)
const struct EnumPropertyItem * BKE_paint_get_tool_enum_from_paintmode(ePaintMode mode)
bool BKE_paint_ensure_from_paintmode(struct Scene *sce, ePaintMode mode)
ePaintMode BKE_paintmode_get_from_tool(const struct bToolRef *tref)
void BKE_workspace_id_tag_all_visible(struct Main *bmain, int tag) ATTR_NONNULL()
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
#define CLOG_WARN(clg_ref,...)
ID and Library types, which are fundamental for sdna.
Object is a sort of wrapper for general info.
#define OBEDIT_FROM_OBACT(ob)
#define OBACT(_view_layer)
@ SEQ_VIEW_SEQUENCE_PREVIEW
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
@ WM_GIZMOGROUPTYPE_TOOL_INIT
@ WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP
struct CLG_LogRef * WM_LOG_TOOLS
void *(* MEM_callocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
int RNA_enum_from_identifier(const EnumPropertyItem *item, const char *identifier)
int RNA_enum_from_value(const EnumPropertyItem *item, const int value)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
const EnumPropertyItem rna_enum_particle_edit_hair_brush_items[]
struct Paint_Runtime runtime
struct ToolSettings * toolsettings
eWM_GizmoFlagGroupTypeFlag flag
struct wmGizmoMapType_Params gzmap_params
int WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, short context, PointerRNA *properties)
bool WM_gizmo_group_type_ensure_ptr(wmGizmoGroupType *gzgt)
void WM_gizmo_group_remove_by_tool(bContext *C, Main *bmain, const wmGizmoGroupType *gzgt, const bToolRef *tref)
wmGizmoGroupType * WM_gizmogrouptype_find(const char *idname, bool quiet)
wmGizmoMapType * WM_gizmomaptype_ensure(const struct wmGizmoMapType_Params *gzmap_params)
void WM_gizmoconfig_update_tag_group_type_init(wmGizmoMapType *gzmap_type, wmGizmoGroupType *gzgt)
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_free(PointerRNA *ptr)
bScreen * WM_window_get_active_screen(const wmWindow *win)
ViewLayer * WM_window_get_active_view_layer(const wmWindow *win)
WorkSpace * WM_window_get_active_workspace(const wmWindow *win)
Scene * WM_window_get_active_scene(const wmWindow *win)