48 const char *default_tool);
71 if (
area->runtime.is_tool_set) {
87 if ((tref->space_type == tkey->
space_type) && (tref->mode == tkey->
mode)) {
165 const int value = items[i].
value;
184 const int slot_index = items[i].
value;
253 if (tref->tag == 0) {
284 if (tref->
tag == 0) {
310 if (tref_rt != tref->
runtime) {
316 bool use_fallback_keymap =
false;
320 use_fallback_keymap =
true;
326 use_fallback_keymap =
true;
331 if (use_fallback_keymap ==
false) {
389 if (paint && paint->
brush && items) {
395 const char *name = items[i].
name;
443 switch (space_type) {
480 space_type =
area->spacetype;
501 } context_prev = {0};
509 int space_type_mask_handled = 0;
512 const int space_type_mask = (1 <<
area->spacetype);
514 ((space_type_mask_handled & space_type_mask) == 0)) {
515 space_type_mask_handled |= space_type_mask;
521 if (tref !=
area->runtime.tool) {
522 if (context_prev.is_set ==
false) {
526 context_prev.is_set =
true;
539 if (context_prev.is_set) {
563 area->runtime.is_tool_set =
true;
566 if (tref->space_type ==
area->spacetype) {
567 if (tref->mode == mode) {
568 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]) {
616 if (mode == tref->
mode) {
617 area->runtime.tool = tref;
618 area->runtime.is_tool_set =
true;
693 switch (tkey->
mode) {
700 return "builtin_brush.Draw";
702 return "builtin_brush.Push";
704 return "builtin_brush.Weight";
706 return "builtin_brush.Draw";
708 return "builtin_brush.density";
712 return "builtin_brush.Comb";
714 return "builtin.cursor";
718 switch (tkey->
mode) {
720 return "builtin_brush.Draw";
724 return "builtin.select_box";
727 switch (tkey->
mode) {
729 return "builtin.select";
731 return "builtin.sample";
733 return "builtin.select";
735 return "builtin.select_box";
739 return "builtin.select_box";
748 const char *default_tool)
752 if (default_tool ==
NULL) {
786 if (win != win_prev) {
788 if (workspace_iter != workspace) {
820 return tref_rt && (tref_rt->
data_block[0] !=
'\0');
836 }
while ((win = win->
next));
888 return (prop !=
NULL);
struct Brush * BKE_brush_add(struct Main *bmain, const char *name, eObjectMode ob_mode)
#define BKE_brush_tool_set(brush, p, tool)
void BKE_brush_sculpt_reset(struct Brush *brush)
#define BKE_brush_tool_get(brush, p)
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)
enum eContextObjectMode CTX_data_mode_enum_ex(const struct Object *obedit, const struct Object *ob, eObjectMode object_mode)
@ 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)
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)
struct IDProperty * IDP_New(char type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void IDP_ReplaceInGroup_ex(struct IDProperty *group, struct IDProperty *prop, struct IDProperty *prop_exist)
void IDP_MergeGroup(struct IDProperty *dest, const struct IDProperty *src, bool do_overwrite) ATTR_NONNULL()
struct IDProperty * IDP_GetPropertyFromGroup(const struct IDProperty *prop, 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, 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
@ TOOLREF_FLAG_FALLBACK_KEYMAP
_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, wmOperatorCallContext context, PointerRNA *properties, const wmEvent *event)
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)