Blender V2.61 - r43446
|
Go to the source code of this file.
Typedefs | |
typedef struct BrushPainter | BrushPainter |
typedef int(* | BrushFunc )(void *user, struct ImBuf *ibuf, float *lastpos, float *pos) |
Functions | |
struct Brush * | add_brush (const char *name) |
struct Brush * | copy_brush (struct Brush *brush) |
void | make_local_brush (struct Brush *brush) |
void | free_brush (struct Brush *brush) |
void | brush_reset_sculpt (struct Brush *brush) |
struct ImBuf * | get_brush_icon (struct Brush *brush) |
int | brush_delete (struct Brush **current_brush) |
int | brush_texture_set_nr (struct Brush *brush, int nr) |
int | brush_texture_delete (struct Brush *brush) |
int | brush_clone_image_set_nr (struct Brush *brush, int nr) |
int | brush_clone_image_delete (struct Brush *brush) |
void | brush_jitter_pos (const struct Scene *scene, struct Brush *brush, float *pos, float *jitterpos) |
void | brush_curve_preset (struct Brush *b, int preset) |
float | brush_curve_strength_clamp (struct Brush *br, float p, const float len) |
float | brush_curve_strength (struct Brush *br, float p, const float len) |
void | brush_sample_tex (const struct Scene *scene, struct Brush *brush, const float xy[2], float rgba[4], const int thread) |
void | brush_imbuf_new (const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size, struct ImBuf **imbuf, int use_color_correction) |
BrushPainter * | brush_painter_new (struct Scene *scene, struct Brush *brush) |
void | brush_painter_require_imbuf (BrushPainter *painter, short flt, short texonly, int size) |
int | brush_painter_paint (BrushPainter *painter, BrushFunc func, float *pos, double time, float pressure, void *user, int use_color_correction) |
void | brush_painter_break_stroke (BrushPainter *painter) |
void | brush_painter_free (BrushPainter *painter) |
unsigned int * | brush_gen_texture_cache (struct Brush *br, int half_side) |
struct ImBuf * | brush_gen_radial_control_imbuf (struct Brush *br) |
int | brush_size (const struct Scene *scene, struct Brush *brush) |
void | brush_set_size (struct Scene *scene, struct Brush *brush, int value) |
float | brush_unprojected_radius (const struct Scene *scene, struct Brush *brush) |
void | brush_set_unprojected_radius (struct Scene *scene, struct Brush *brush, float value) |
float | brush_alpha (const struct Scene *scene, struct Brush *brush) |
int | brush_use_locked_size (const struct Scene *scene, struct Brush *brush) |
int | brush_use_alpha_pressure (const struct Scene *scene, struct Brush *brush) |
int | brush_use_size_pressure (const struct Scene *scene, struct Brush *brush) |
void | brush_scale_unprojected_radius (float *unprojected_radius, int new_brush_size, int old_brush_size) |
void | brush_scale_size (int *brush_size, float new_unprojected_radius, float old_unprojected_radius) |
void | brush_debug_print_state (struct Brush *br) |
Definition in file BKE_brush.h.
Definition at line 78 of file BKE_brush.h.
typedef struct BrushPainter BrushPainter |
Definition at line 77 of file BKE_brush.h.
struct Brush* add_brush | ( | const char * | name | ) | [read] |
Definition at line 124 of file brush.c.
References alloc_libblock(), brush_curve_preset(), brush_set_defaults(), CURVE_PRESET_SMOOTH, ID::flag, G, Brush::id, ID_BR, LIB_FAKEUSER, Brush::sculpt_tool, and SCULPT_TOOL_DRAW.
Referenced by brush_add_exec(), and paint_init().
int brush_clone_image_delete | ( | struct Brush * | brush | ) |
Definition at line 478 of file brush.c.
References Brush::clone, Image::id, BrushClone::image, NULL, and ID::us.
Referenced by brush_clone_image_set_nr().
int brush_clone_image_set_nr | ( | struct Brush * | brush, |
int | nr | ||
) |
Definition at line 460 of file brush.c.
References BLI_findlink(), brush_clone_image_delete(), Brush::clone, G, Image::id, id_us_plus(), BrushClone::image, and BrushClone::offset.
void brush_curve_preset | ( | struct Brush * | b, |
int | preset | ||
) |
Definition at line 413 of file brush.c.
References CurveMapping::clipr, CurveMapping::cm, CUMA_EXTEND_EXTRAPOLATE, Brush::curve, curvemap_reset(), CURVEMAP_SLOPE_NEGATIVE, curvemapping_add(), curvemapping_changed(), CurveMap::flag, NULL, and CurveMapping::preset.
Referenced by add_brush(), brush_curve_preset_exec(), brush_reset_sculpt(), and direct_link_brush().
float brush_curve_strength | ( | struct Brush * | br, |
float | p, | ||
const float | len | ||
) |
Definition at line 1249 of file brush.c.
References Brush::curve, curvemapping_evaluateF(), and len().
Referenced by brush_imbuf_new(), load_tex(), overlapped_curve(), and tex_strength().
float brush_curve_strength_clamp | ( | struct Brush * | br, |
float | p, | ||
const float | len | ||
) |
Definition at line 1237 of file brush.c.
References Brush::curve, curvemapping_evaluateF(), len(), and p.
Referenced by brush_gen_radial_control_imbuf(), brush_imbuf_new(), calc_vp_strength_dl(), and do_projectpaint_thread().
void brush_debug_print_state | ( | struct Brush * | br | ) |
Definition at line 244 of file brush.c.
References blend(), BR_TEST, BR_TEST_FLAG, BRUSH_ACCUMULATE, BRUSH_ADAPTIVE_SPACE, BRUSH_AIRBRUSH, BRUSH_ALPHA_PRESSURE, BRUSH_ANCHORED, BRUSH_CUSTOM_ICON, BRUSH_DIR_IN, BRUSH_EDGE_TO_EDGE, BRUSH_FIXED_TEX, BRUSH_FRONTFACE, BRUSH_INVERSE_SMOOTH_PRESSURE, BRUSH_JITTER_PRESSURE, BRUSH_LOCK_ALPHA, BRUSH_LOCK_SIZE, BRUSH_OFFSET_PRESSURE, BRUSH_ORIGINAL_NORMAL, BRUSH_PERSISTENT, BRUSH_PLANE_TRIM, BRUSH_RAKE, BRUSH_RANDOM_ROTATION, BRUSH_RESTORE_MESH, brush_set_defaults(), BRUSH_SIZE_PRESSURE, BRUSH_SMOOTH_STROKE, BRUSH_SPACE, BRUSH_SPACE_ATTEN, BRUSH_SPACING_PRESSURE, BRUSH_TEXTURE_OVERLAY, BRUSH_TORUS, simple_enum_gen::d, NULL, plane_trim(), and size().
int brush_delete | ( | struct Brush ** | current_brush | ) |
Definition at line 1306 of file brush.c.
References brush_curve_strength_clamp(), brush_gen_texture_cache(), i, MEM_callocN(), MEM_freeN(), pow(), ImBuf::rect_float, sqrt(), ImBuf::x, and ImBuf::y.
Referenced by radial_control_set_tex().
unsigned int* brush_gen_texture_cache | ( | struct Brush * | br, |
int | half_side | ||
) |
Definition at line 1260 of file brush.c.
References BKE_image_get_ibuf(), co, Tex::ima, MEM_callocN(), Brush::mtex, multitex_ext(), NULL, step(), TexResult::tb, MTex::tex, TEX_RGB, TexResult::tg, TexResult::tin, and TexResult::tr.
Referenced by brush_gen_radial_control_imbuf(), and sculpt_update_tex().
void brush_imbuf_new | ( | const struct Scene * | scene, |
struct Brush * | brush, | ||
short | flt, | ||
short | texfalloff, | ||
int | size, | ||
struct ImBuf ** | imbuf, | ||
int | use_color_correction | ||
) |
Referenced by brush_painter_refresh_cache().
void brush_jitter_pos | ( | const struct Scene * | scene, |
struct Brush * | brush, | ||
float * | pos, | ||
float * | jitterpos | ||
) |
Referenced by brush_painter_paint(), and paint_brush_stroke_add_step().
void brush_painter_break_stroke | ( | BrushPainter * | painter | ) |
Definition at line 1035 of file brush.c.
References BrushPainter::firsttouch.
Referenced by imapaint_paint_stroke().
void brush_painter_free | ( | BrushPainter * | painter | ) |
Definition at line 825 of file brush.c.
References BrushPainter::brush, brush_set_alpha(), brush_set_size(), BrushPainter::cache, BrushPainterCache::ibuf, IMB_freeImBuf(), Brush::jitter, BrushPainterCache::maskibuf, MEM_freeN(), BrushPainter::scene, Brush::spacing, BrushPainter::startalpha, BrushPainter::startjitter, BrushPainter::startsize, BrushPainter::startspacing, and BrushPainterCache::texibuf.
Referenced by paint_exit().
BrushPainter* brush_painter_new | ( | struct Scene * | scene, |
struct Brush * | brush | ||
) |
Definition at line 786 of file brush.c.
References BrushPainter::brush, brush_alpha(), brush_size(), BrushPainter::cache, BrushPainter::firsttouch, Brush::jitter, BrushPainterCache::lastsize, MEM_callocN(), BrushPainter::scene, Brush::spacing, BrushPainter::startalpha, BrushPainter::startjitter, BrushPainter::startsize, and BrushPainter::startspacing.
Referenced by texture_paint_init().
int brush_painter_paint | ( | BrushPainter * | painter, |
BrushFunc | func, | ||
float * | pos, | ||
double | time, | ||
float | pressure, | ||
void * | user, | ||
int | use_color_correction | ||
) |
Definition at line 1079 of file brush.c.
References BrushPainter::accumdistance, BrushPainter::accumtime, BrushPainter::brush, BRUSH_AIRBRUSH, brush_apply_pressure(), brush_jitter_pos(), brush_painter_refresh_cache(), brush_set_alpha(), brush_set_size(), brush_size(), BRUSH_SPACE, BrushPainter::cache, BrushPainterCache::enabled, BrushPainter::firsttouch, Brush::flag, BrushPainterCache::ibuf, Brush::jitter, BrushPainter::lastmousepos, BrushPainter::lastpaintpos, BrushPainter::lastpressure, BrushPainter::lasttime, len(), MAX2, normalize_v2(), Brush::rate, BrushPainter::scene, Brush::spacing, BrushPainter::startalpha, BrushPainter::startjitter, BrushPainter::startpaintpos, BrushPainter::startsize, BrushPainter::startspacing, step(), and sub_v2_v2v2().
Referenced by imapaint_paint_sub_stroke(), and project_paint_sub_stroke().
void brush_painter_require_imbuf | ( | BrushPainter * | painter, |
short | flt, | ||
short | texonly, | ||
int | size | ||
) |
Definition at line 803 of file brush.c.
References BrushPainter::cache, BrushPainterCache::enabled, BrushPainterCache::flt, BrushPainterCache::ibuf, IMB_freeImBuf(), BrushPainterCache::lastsize, BrushPainterCache::maskibuf, NULL, BrushPainterCache::size, size(), BrushPainterCache::texibuf, and BrushPainterCache::texonly.
Referenced by imapaint_paint_sub_stroke().
void brush_reset_sculpt | ( | struct Brush * | brush | ) |
Definition at line 331 of file brush.c.
References Brush::add_col, Brush::alpha, BRUSH_ALPHA_PRESSURE, brush_curve_preset(), BRUSH_DIR_IN, BRUSH_FRONTFACE, brush_set_defaults(), BRUSH_SPACE, BRUSH_SPACE_ATTEN, CURVE_PRESET_SMOOTH, Brush::flag, Brush::sculpt_tool, SCULPT_TOOL_CLAY, SCULPT_TOOL_CREASE, SCULPT_TOOL_FILL, SCULPT_TOOL_FLATTEN, SCULPT_TOOL_GRAB, SCULPT_TOOL_INFLATE, SCULPT_TOOL_NUDGE, SCULPT_TOOL_PINCH, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SCRAPE, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_SNAKE_HOOK, SCULPT_TOOL_THUMB, Brush::size, Brush::spacing, and Brush::sub_col.
Referenced by brush_reset_exec().
void brush_sample_tex | ( | const struct Scene * | scene, |
struct Brush * | brush, | ||
const float | xy[2], | ||
float | rgba[4], | ||
const int | thread | ||
) |
Referenced by brush_imbuf_new(), brush_painter_do_partial(), and do_projectpaint_thread().
void brush_scale_size | ( | int * | brush_size, |
float | new_unprojected_radius, | ||
float | old_unprojected_radius | ||
) |
void brush_scale_unprojected_radius | ( | float * | unprojected_radius, |
int | new_brush_size, | ||
int | old_brush_size | ||
) |
Definition at line 639 of file brush.c.
References UnifiedPaintSettings::flag, UnifiedPaintSettings::size, size(), Brush::size, Scene::toolsettings, ToolSettings::unified_paint_settings, and UNIFIED_PAINT_SIZE.
Referenced by brush_apply_pressure(), brush_painter_free(), brush_painter_paint(), brush_scale_size_exec(), paint_draw_cursor(), paint_exit(), texture_paint_camera_project_exec(), and texture_paint_init().
Definition at line 683 of file brush.c.
References UnifiedPaintSettings::flag, Scene::toolsettings, ToolSettings::unified_paint_settings, UNIFIED_PAINT_SIZE, UnifiedPaintSettings::unprojected_radius, and Brush::unprojected_radius.
Referenced by brush_scale_size_exec(), paint_cursor_on_hit(), and sculpt_update_cache_variants().
Referenced by brush_drawcursor(), brush_imbuf_new(), brush_jitter_pos(), brush_painter_do_partial(), brush_painter_fixed_tex_partial_update(), brush_painter_new(), brush_painter_paint(), brush_painter_refresh_cache(), brush_sample_tex(), brush_scale_size_exec(), do_projectpaint_thread(), load_tex(), make_snap(), paint_cursor_on_hit(), paint_draw_alpha_overlay(), paint_draw_cursor(), paint_space_stroke(), project_bucket_iter_init(), project_bucket_iter_next(), project_paint_begin(), same_snap(), sculpt_get_brush_geometry(), sculpt_update_cache_variants(), sculpt_update_tex(), tex_strength(), texture_paint_camera_project_exec(), texture_paint_init(), vpaint_stroke_update_step(), and wpaint_stroke_update_step().
int brush_texture_delete | ( | struct Brush * | brush | ) |
Definition at line 452 of file brush.c.
References Tex::id, Brush::mtex, MTex::tex, and ID::us.
Referenced by brush_texture_set_nr().
int brush_texture_set_nr | ( | struct Brush * | brush, |
int | nr | ||
) |
Definition at line 428 of file brush.c.
References add_texture(), BLI_findlink(), brush_texture_delete(), copy_texture(), G, id_us_plus(), Brush::mtex, NULL, MTex::tex, and ID::us.
Referenced by brush_scale_size_exec(), sculpt_get_brush_geometry(), and sculpt_update_cache_variants().
Referenced by paint_cursor_on_hit(), paint_draw_cursor(), and sculpt_update_cache_variants().
Definition at line 143 of file brush.c.
References copy_libblock(), Brush::curve, curvemapping_copy(), ID::flag, Brush::icon_imbuf, Brush::id, id_us_plus(), IMB_dupImBuf(), LIB_FAKEUSER, Brush::mtex, NULL, Brush::preview, MTex::tex, and ID::us.
Referenced by brush_add_exec(), id_copy(), and make_local_brush().
void free_brush | ( | struct Brush * | brush | ) |
Definition at line 169 of file brush.c.
References BKE_previewimg_free(), Brush::curve, curvemapping_free(), Brush::icon_imbuf, Tex::id, IMB_freeImBuf(), Brush::mtex, Brush::preview, MTex::tex, and ID::us.
Referenced by free_libblock().
Definition at line 103 of file render_preview.c.
References BKE_icon_changed(), BKE_icon_getid(), BLENDER_DATAFILES, BLI_get_folder(), BLI_make_file_string(), BLI_path_abs(), BLI_strncpy(), BRUSH_CUSTOM_ICON, FILE_MAX, Brush::flag, G, IB_metadata, IB_multilayer, IB_rect, Brush::icon_filepath, ID::icon_id, Brush::icon_imbuf, Brush::id, and IMB_loadiffname().
Referenced by icon_preview_startjob().
void make_local_brush | ( | struct Brush * | brush | ) |
Definition at line 188 of file brush.c.
References BKE_id_lib_local_paths(), Brush::clone, copy_brush(), ELEM, extern_local_brush(), FALSE, ListBase::first, ID::flag, G, Scene::id, Brush::id, Image::id, id_clear_lib_data(), BrushClone::image, ToolSettings::imapaint, ID::lib, LIB_FAKEUSER, ID::next, NULL, ImagePaintSettings::paint, paint_brush(), paint_brush_set(), Main::scene, bContext::scene, Scene::toolsettings, TRUE, and ID::us.
Referenced by id_make_local().