Blender V2.61 - r43446
|
#include "MEM_guardedalloc.h"
#include <stdlib.h>
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_brush_types.h"
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_paint.h"
#include "BKE_main.h"
#include "ED_sculpt.h"
#include "ED_screen.h"
#include "UI_resources.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "paint_intern.h"
#include "sculpt_intern.h"
#include <string.h>
#include <stddef.h>
Go to the source code of this file.
Enumerations | |
enum | RCFlags { RC_COLOR = 1, RC_ROTATION = 2, RC_ZOOM = 4 } |
Functions | |
static int | brush_add_exec (bContext *C, wmOperator *UNUSED(op)) |
static void | BRUSH_OT_add (wmOperatorType *ot) |
static int | brush_scale_size_exec (bContext *C, wmOperator *op) |
static void | BRUSH_OT_scale_size (wmOperatorType *ot) |
static int | vertex_color_set_exec (bContext *C, wmOperator *UNUSED(op)) |
static void | PAINT_OT_vertex_color_set (wmOperatorType *ot) |
static int | brush_reset_exec (bContext *C, wmOperator *UNUSED(op)) |
static void | BRUSH_OT_reset (wmOperatorType *ot) |
static Brush * | brush_tool_cycle (Main *bmain, Brush *brush_orig, const int tool, const size_t tool_offset, const int ob_mode) |
static int | brush_generic_tool_set (Main *bmain, Paint *paint, const int tool, const size_t tool_offset, const int ob_mode) |
static int | brush_sculpt_tool_set_exec (bContext *C, wmOperator *op) |
static void | BRUSH_OT_sculpt_tool_set (wmOperatorType *ot) |
static int | brush_vertex_tool_set_exec (bContext *C, wmOperator *op) |
static void | BRUSH_OT_vertex_tool_set (wmOperatorType *ot) |
static int | brush_weight_tool_set_exec (bContext *C, wmOperator *op) |
static void | BRUSH_OT_weight_tool_set (wmOperatorType *ot) |
static int | brush_image_tool_set_exec (bContext *C, wmOperator *op) |
static void | BRUSH_OT_image_tool_set (wmOperatorType *ot) |
void | ED_operatortypes_paint (void) |
static void | ed_keymap_paint_brush_switch (wmKeyMap *keymap, const char *mode) |
static void | ed_keymap_paint_brush_size (wmKeyMap *keymap, const char *UNUSED(path)) |
static void | set_brush_rc_path (PointerRNA *ptr, const char *brush_path, const char *output_name, const char *input_name) |
static void | set_brush_rc_props (PointerRNA *ptr, const char *paint, const char *prop, const char *secondary_prop, RCFlags flags) |
static void | ed_keymap_paint_brush_radial_control (wmKeyMap *keymap, const char *paint, RCFlags flags) |
void | ED_keymap_paint (wmKeyConfig *keyconf) |
Definition in file paint_ops.c.
enum RCFlags |
Definition at line 419 of file paint_ops.c.
static int brush_add_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 59 of file paint_ops.c.
References add_brush(), copy_brush(), CTX_data_scene(), OPERATOR_FINISHED, paint_brush(), paint_brush_set(), and paint_get_active().
Referenced by BRUSH_OT_add().
static int brush_generic_tool_set | ( | Main * | bmain, |
Paint * | paint, | ||
const int | tool, | ||
const size_t | tool_offset, | ||
const int | ob_mode | ||
) | [static] |
Definition at line 226 of file paint_ops.c.
References brush_tool_cycle(), NA_EDITED, NC_BRUSH, OPERATOR_CANCELLED, OPERATOR_FINISHED, paint_brush(), paint_brush_set(), and WM_main_add_notifier().
Referenced by brush_image_tool_set_exec(), brush_sculpt_tool_set_exec(), brush_vertex_tool_set_exec(), and brush_weight_tool_set_exec().
static int brush_image_tool_set_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 317 of file paint_ops.c.
References brush_generic_tool_set(), CTX_data_main(), CTX_data_scene(), Brush::imagepaint_tool, ToolSettings::imapaint, OB_MODE_TEXTURE_PAINT, ImagePaintSettings::paint, wmOperator::ptr, RNA_enum_get(), and Scene::toolsettings.
Referenced by BRUSH_OT_image_tool_set().
static void BRUSH_OT_add | ( | wmOperatorType * | ot | ) | [static] |
Definition at line 75 of file paint_ops.c.
References brush_add_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, and OPTYPE_UNDO.
Referenced by ED_operatortypes_paint().
static void BRUSH_OT_image_tool_set | ( | wmOperatorType * | ot | ) | [static] |
Definition at line 325 of file paint_ops.c.
References brush_image_tool_items, brush_image_tool_set_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::prop, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
static void BRUSH_OT_reset | ( | wmOperatorType * | ot | ) | [static] |
Definition at line 187 of file paint_ops.c.
References brush_reset_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, and OPTYPE_UNDO.
Referenced by ED_operatortypes_paint().
static void BRUSH_OT_scale_size | ( | wmOperatorType * | ot | ) | [static] |
Definition at line 131 of file paint_ops.c.
References brush_scale_size_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, RNA_def_float(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
static void BRUSH_OT_sculpt_tool_set | ( | wmOperatorType * | ot | ) | [static] |
Definition at line 250 of file paint_ops.c.
References brush_sculpt_tool_items, brush_sculpt_tool_set_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::prop, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
static void BRUSH_OT_vertex_tool_set | ( | wmOperatorType * | ot | ) | [static] |
Definition at line 275 of file paint_ops.c.
References brush_vertex_tool_items, brush_vertex_tool_set_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::prop, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
static void BRUSH_OT_weight_tool_set | ( | wmOperatorType * | ot | ) | [static] |
Definition at line 300 of file paint_ops.c.
References brush_vertex_tool_items, brush_weight_tool_set_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::prop, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
static int brush_reset_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 172 of file paint_ops.c.
References brush_reset_sculpt(), CTX_data_active_object(), CTX_data_scene(), Object::mode, OB_MODE_SCULPT, OPERATOR_CANCELLED, OPERATOR_FINISHED, paint_brush(), and paint_get_active().
Referenced by BRUSH_OT_reset().
static int brush_scale_size_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 90 of file paint_ops.c.
References brush_set_size(), brush_set_unprojected_radius(), brush_size(), brush_unprojected_radius(), CLAMP(), CTX_data_scene(), OPERATOR_FINISHED, paint_brush(), paint_get_active(), wmOperator::ptr, RNA_float_get(), size(), and Brush::unprojected_radius.
Referenced by BRUSH_OT_scale_size().
static int brush_sculpt_tool_set_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 242 of file paint_ops.c.
References brush_generic_tool_set(), CTX_data_main(), CTX_data_scene(), OB_MODE_SCULPT, Sculpt::paint, wmOperator::ptr, RNA_enum_get(), ToolSettings::sculpt, Brush::sculpt_tool, and Scene::toolsettings.
Referenced by BRUSH_OT_sculpt_tool_set().
static Brush* brush_tool_cycle | ( | Main * | bmain, |
Brush * | brush_orig, | ||
const int | tool, | ||
const size_t | tool_offset, | ||
const int | ob_mode | ||
) | [static] |
Definition at line 202 of file paint_ops.c.
References Main::brush, ListBase::first, Brush::id, ID::next, NULL, and Brush::ob_mode.
Referenced by brush_generic_tool_set().
static int brush_vertex_tool_set_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 267 of file paint_ops.c.
References brush_generic_tool_set(), CTX_data_main(), CTX_data_scene(), OB_MODE_VERTEX_PAINT, VPaint::paint, wmOperator::ptr, RNA_enum_get(), Scene::toolsettings, Brush::vertexpaint_tool, and ToolSettings::vpaint.
Referenced by BRUSH_OT_vertex_tool_set().
static int brush_weight_tool_set_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 292 of file paint_ops.c.
References brush_generic_tool_set(), CTX_data_main(), CTX_data_scene(), OB_MODE_WEIGHT_PAINT, VPaint::paint, wmOperator::ptr, RNA_enum_get(), Scene::toolsettings, Brush::vertexpaint_tool, and ToolSettings::wpaint.
Referenced by BRUSH_OT_weight_tool_set().
void ED_keymap_paint | ( | wmKeyConfig * | keyconf | ) |
Definition at line 486 of file paint_ops.c.
References AKEY, BKEY, BRUSH_STROKE_INVERT, BRUSH_STROKE_NORMAL, BRUSH_STROKE_SMOOTH, CKEY, DKEY, ed_keymap_paint_brush_radial_control(), ed_keymap_paint_brush_size(), ed_keymap_paint_brush_switch(), EVT_TWEAK_A, facemask_paint_poll(), FALSE, GKEY, HKEY, i, IKEY, image_texture_paint_poll(), KKEY, KM_ALT, KM_ANY, KM_CTRL, KM_PRESS, KM_SHIFT, LEFTMOUSE, LKEY, MKEY, PAGEDOWNKEY, PAGEUPKEY, PKEY, wmKeyMap::poll, wmKeyMapItem::ptr, RC_COLOR, RC_ROTATION, RC_ZOOM, RIGHTMOUSE, RKEY, RNA_boolean_set(), RNA_enum_set(), RNA_int_set(), RNA_string_set(), sculpt_poll(), SCULPT_TOOL_CLAY, SCULPT_TOOL_CREASE, SCULPT_TOOL_DRAW, SCULPT_TOOL_FLATTEN, SCULPT_TOOL_GRAB, SCULPT_TOOL_INFLATE, SCULPT_TOOL_LAYER, SCULPT_TOOL_PINCH, SCULPT_TOOL_SMOOTH, SKEY, TKEY, TRUE, vert_paint_poll(), vertex_paint_mode_poll(), VKEY, weight_paint_mode_poll(), WKEY, WM_keymap_add_item(), WM_keymap_find(), WM_keymap_verify_item(), and ZEROKEY.
Referenced by ED_spacetypes_keymap().
static void ed_keymap_paint_brush_radial_control | ( | wmKeyMap * | keymap, |
const char * | paint, | ||
RCFlags | flags | ||
) | [static] |
Definition at line 469 of file paint_ops.c.
References FKEY, KM_CTRL, KM_PRESS, KM_SHIFT, NULL, wmKeyMapItem::ptr, RC_ROTATION, set_brush_rc_props(), and WM_keymap_add_item().
Referenced by ED_keymap_paint().
static void ed_keymap_paint_brush_size | ( | wmKeyMap * | keymap, |
const char * | UNUSEDpath | ||
) | [static] |
Definition at line 408 of file paint_ops.c.
References KM_PRESS, LEFTBRACKETKEY, wmKeyMapItem::ptr, RIGHTBRACKETKEY, RNA_float_set(), and WM_keymap_add_item().
Referenced by ED_keymap_paint().
static void ed_keymap_paint_brush_switch | ( | wmKeyMap * | keymap, |
const char * | mode | ||
) | [static] |
Definition at line 395 of file paint_ops.c.
References i, KM_PRESS, KM_SHIFT, wmKeyMapItem::ptr, RNA_int_set(), RNA_string_set(), WM_keymap_add_item(), and ZEROKEY.
Referenced by ED_keymap_paint().
void ED_operatortypes_paint | ( | void | ) |
Definition at line 345 of file paint_ops.c.
References BRUSH_OT_add(), BRUSH_OT_curve_preset(), BRUSH_OT_image_tool_set(), BRUSH_OT_reset(), BRUSH_OT_scale_size(), BRUSH_OT_sculpt_tool_set(), BRUSH_OT_vertex_tool_set(), BRUSH_OT_weight_tool_set(), PAINT_OT_clone_cursor_set(), PAINT_OT_face_select_all(), PAINT_OT_face_select_hide(), PAINT_OT_face_select_inverse(), PAINT_OT_face_select_linked(), PAINT_OT_face_select_linked_pick(), PAINT_OT_face_select_reveal(), PAINT_OT_grab_clone(), PAINT_OT_image_from_view(), PAINT_OT_image_paint(), PAINT_OT_project_image(), PAINT_OT_sample_color(), PAINT_OT_texture_paint_toggle(), PAINT_OT_vert_select_all(), PAINT_OT_vert_select_inverse(), PAINT_OT_vertex_color_set(), PAINT_OT_vertex_paint(), PAINT_OT_vertex_paint_toggle(), PAINT_OT_weight_from_bones(), PAINT_OT_weight_paint(), PAINT_OT_weight_paint_toggle(), PAINT_OT_weight_sample(), PAINT_OT_weight_sample_group(), PAINT_OT_weight_set(), and WM_operatortype_append().
Referenced by ED_spacetypes_init().
static void PAINT_OT_vertex_color_set | ( | wmOperatorType * | ot | ) | [static] |
Definition at line 158 of file paint_ops.c.
References wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, vertex_color_set_exec(), and vertex_paint_mode_poll().
Referenced by ED_operatortypes_paint().
static void set_brush_rc_path | ( | PointerRNA * | ptr, |
const char * | brush_path, | ||
const char * | output_name, | ||
const char * | input_name | ||
) | [static] |
Definition at line 425 of file paint_ops.c.
References BLI_sprintfN(), MEM_freeN(), and RNA_string_set().
Referenced by set_brush_rc_props().
static void set_brush_rc_props | ( | PointerRNA * | ptr, |
const char * | paint, | ||
const char * | prop, | ||
const char * | secondary_prop, | ||
RCFlags | flags | ||
) | [static] |
Definition at line 435 of file paint_ops.c.
References BLI_sprintfN(), MEM_freeN(), RC_COLOR, RC_ZOOM, RNA_string_set(), and set_brush_rc_path().
Referenced by ed_keymap_paint_brush_radial_control().
static int vertex_color_set_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 147 of file paint_ops.c.
References CTX_data_active_object(), CTX_data_scene(), CTX_wm_region(), ED_region_tag_redraw(), OPERATOR_FINISHED, Scene::toolsettings, ToolSettings::vpaint, vpaint_fill(), and vpaint_get_current_col().
Referenced by PAINT_OT_vertex_color_set().