Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_icons.c
| Show All 40 Lines | |||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_fileops_types.h" | #include "BLI_fileops_types.h" | ||||
| #include "BLI_math_vector.h" | #include "BLI_math_vector.h" | ||||
| #include "DNA_brush_types.h" | #include "DNA_brush_types.h" | ||||
| #include "DNA_curve_types.h" | #include "DNA_curve_types.h" | ||||
| #include "DNA_dynamicpaint_types.h" | #include "DNA_dynamicpaint_types.h" | ||||
| #include "DNA_gpencil_types.h" | |||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_screen_types.h" | #include "DNA_screen_types.h" | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "DNA_workspace_types.h" | #include "DNA_workspace_types.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| ▲ Show 20 Lines • Show All 367 Lines • ▼ Show 20 Lines | #define INIT_BRUSH_ICON(icon_id, name) \ | ||||
| INIT_BRUSH_ICON(ICON_BRUSH_SUBTRACT, subtract); | INIT_BRUSH_ICON(ICON_BRUSH_SUBTRACT, subtract); | ||||
| INIT_BRUSH_ICON(ICON_BRUSH_TEXDRAW, texdraw); | INIT_BRUSH_ICON(ICON_BRUSH_TEXDRAW, texdraw); | ||||
| INIT_BRUSH_ICON(ICON_BRUSH_TEXFILL, texfill); | INIT_BRUSH_ICON(ICON_BRUSH_TEXFILL, texfill); | ||||
| INIT_BRUSH_ICON(ICON_BRUSH_TEXMASK, texmask); | INIT_BRUSH_ICON(ICON_BRUSH_TEXMASK, texmask); | ||||
| INIT_BRUSH_ICON(ICON_BRUSH_THUMB, thumb); | INIT_BRUSH_ICON(ICON_BRUSH_THUMB, thumb); | ||||
| INIT_BRUSH_ICON(ICON_BRUSH_ROTATE, twist); | INIT_BRUSH_ICON(ICON_BRUSH_ROTATE, twist); | ||||
| INIT_BRUSH_ICON(ICON_BRUSH_VERTEXDRAW, vertexdraw); | INIT_BRUSH_ICON(ICON_BRUSH_VERTEXDRAW, vertexdraw); | ||||
| /* grease pencil sculpt */ | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_SMOOTH, gp_brush_smooth); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_THICKNESS, gp_brush_thickness); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_STRENGTH, gp_brush_strength); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_GRAB, gp_brush_grab); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_PUSH, gp_brush_push); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_TWIST, gp_brush_twist); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_PINCH, gp_brush_pinch); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_RANDOMIZE, gp_brush_randomize); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_CLONE, gp_brush_clone); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_WEIGHT, gp_brush_weight); | |||||
| /* grease pencil drawing brushes */ | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_PENCIL, gp_brush_pencil); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_PEN, gp_brush_pen); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_INK, gp_brush_ink); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_INKNOISE, gp_brush_inknoise); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_BLOCK, gp_brush_block); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_MARKER, gp_brush_marker); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_FILL, gp_brush_fill); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_ERASE_SOFT, gp_brush_erase_soft); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_ERASE_HARD, gp_brush_erase_hard); | |||||
| INIT_BRUSH_ICON(ICON_GPBRUSH_ERASE_STROKE, gp_brush_erase_stroke); | |||||
| #undef INIT_BRUSH_ICON | #undef INIT_BRUSH_ICON | ||||
| } | } | ||||
| static void icon_verify_datatoc(IconImage *iimg) | static void icon_verify_datatoc(IconImage *iimg) | ||||
| { | { | ||||
| /* if it has own rect, things are all OK */ | /* if it has own rect, things are all OK */ | ||||
| if (iimg->rect) | if (iimg->rect) | ||||
| return; | return; | ||||
| ▲ Show 20 Lines • Show All 959 Lines • ▼ Show 20 Lines | else if (space_type == SPACE_IMAGE) { | ||||
| } | } | ||||
| if (sima_mode == SI_MODE_PAINT) { | if (sima_mode == SI_MODE_PAINT) { | ||||
| mode = OB_MODE_TEXTURE_PAINT; | mode = OB_MODE_TEXTURE_PAINT; | ||||
| } | } | ||||
| } | } | ||||
| /* reset the icon */ | /* reset the icon */ | ||||
| if (mode == OB_MODE_SCULPT) { | if (ob->mode & OB_MODE_GPENCIL_PAINT) { | ||||
| switch (br->gpencil_settings->icon_id) { | |||||
| case GP_BRUSH_ICON_PENCIL: | |||||
| br->id.icon_id = ICON_GPBRUSH_PENCIL; | |||||
| break; | |||||
| case GP_BRUSH_ICON_PEN: | |||||
| br->id.icon_id = ICON_GPBRUSH_PEN; | |||||
| break; | |||||
| case GP_BRUSH_ICON_INK: | |||||
| br->id.icon_id = ICON_GPBRUSH_INK; | |||||
| break; | |||||
| case GP_BRUSH_ICON_INKNOISE: | |||||
| br->id.icon_id = ICON_GPBRUSH_INKNOISE; | |||||
| break; | |||||
| case GP_BRUSH_ICON_BLOCK: | |||||
| br->id.icon_id = ICON_GPBRUSH_BLOCK; | |||||
| break; | |||||
| case GP_BRUSH_ICON_MARKER: | |||||
| br->id.icon_id = ICON_GPBRUSH_MARKER; | |||||
| break; | |||||
| case GP_BRUSH_ICON_FILL: | |||||
| br->id.icon_id = ICON_GPBRUSH_FILL; | |||||
| break; | |||||
| case GP_BRUSH_ICON_ERASE_SOFT: | |||||
| br->id.icon_id = ICON_GPBRUSH_ERASE_SOFT; | |||||
| break; | |||||
| case GP_BRUSH_ICON_ERASE_HARD: | |||||
| br->id.icon_id = ICON_GPBRUSH_ERASE_HARD; | |||||
| break; | |||||
| case GP_BRUSH_ICON_ERASE_STROKE: | |||||
| br->id.icon_id = ICON_GPBRUSH_ERASE_STROKE; | |||||
| break; | |||||
| default: | |||||
| br->id.icon_id = ICON_GPBRUSH_PEN; | |||||
| break; | |||||
| } | |||||
| return id->icon_id; | |||||
| } | |||||
| else if (mode == OB_MODE_SCULPT) { | |||||
| items = rna_enum_brush_sculpt_tool_items; | items = rna_enum_brush_sculpt_tool_items; | ||||
| tool = br->sculpt_tool; | tool = br->sculpt_tool; | ||||
| } | } | ||||
| else if (mode == OB_MODE_VERTEX_PAINT) { | else if (mode == OB_MODE_VERTEX_PAINT) { | ||||
| items = rna_enum_brush_vertex_tool_items; | items = rna_enum_brush_vertex_tool_items; | ||||
| tool = br->vertexpaint_tool; | tool = br->vertexpaint_tool; | ||||
| } | } | ||||
| else if (mode == OB_MODE_TEXTURE_PAINT) { | else if (mode == OB_MODE_TEXTURE_PAINT) { | ||||
| ▲ Show 20 Lines • Show All 209 Lines • Show Last 20 Lines | |||||