|
Blender
V2.59
|
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 (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 (struct Brush *brush, float *xy, float *rgba, const int thread) |
| void | brush_imbuf_new (struct Brush *brush, short flt, short texfalloff, int size, struct ImBuf **imbuf, int use_color_correction) |
| BrushPainter * | brush_painter_new (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 (struct Brush *brush) |
| void | brush_set_size (struct Brush *brush, int value) |
| int | brush_use_locked_size (struct Brush *brush) |
| void | brush_set_use_locked_size (struct Brush *brush, int value) |
| int | brush_use_alpha_pressure (struct Brush *brush) |
| void | brush_set_use_alpha_pressure (struct Brush *brush, int value) |
| int | brush_use_size_pressure (struct Brush *brush) |
| void | brush_set_use_size_pressure (struct Brush *brush, int value) |
| float | brush_unprojected_radius (struct Brush *brush) |
| void | brush_set_unprojected_radius (struct Brush *brush, float value) |
| float | brush_alpha (struct Brush *brush) |
| void | brush_set_alpha (struct Brush *brush, float value) |
| void | brush_debug_print_state (struct Brush *br) |
Definition in file BKE_brush.h.
Definition at line 79 of file BKE_brush.h.
| typedef struct BrushPainter BrushPainter |
Definition at line 78 of file BKE_brush.h.
| struct Brush* add_brush | ( | const char * | name | ) | [read] |
Definition at line 125 of file brush.c.
References alloc_libblock(), Main::brush, brush_curve_preset(), brush_set_defaults(), CURVE_PRESET_SMOOTH, ID::flag, G, Brush::id, ID_BR, LIB_FAKEUSER, Global::main, Brush::sculpt_tool, and SCULPT_TOOL_DRAW.
Referenced by brush_add_exec(), and paint_init().
| float brush_alpha | ( | struct Brush * | brush | ) |
Definition at line 1469 of file brush.c.
References Brush::alpha, SCULPT_PAINT_USE_UNIFIED_ALPHA, unified_alpha(), and unified_settings().
Referenced by brush_imbuf_new(), brush_painter_new(), brush_painter_refresh_cache(), brush_strength(), calc_vp_alpha_dl(), do_crease_brush(), do_projectpaint_thread(), paint_draw_cursor(), vpaint_blend(), and wpaint_blend().
| int brush_clone_image_delete | ( | struct Brush * | brush | ) |
Definition at line 477 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 459 of file brush.c.
References BLI_findlink(), brush_clone_image_delete(), Brush::clone, G, Image::id, id_us_plus(), BrushClone::image, Main::image, Global::main, and BrushClone::offset.
| void brush_curve_preset | ( | struct Brush * | b, |
| int | preset | ||
| ) |
Definition at line 412 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 1125 of file brush.c.
References Brush::curve, and curvemapping_evaluateF().
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 1113 of file brush.c.
References Brush::curve, curvemapping_evaluateF(), and p.
Referenced by brush_gen_radial_control_imbuf(), brush_imbuf_new(), calc_vp_alpha_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 1182 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 1136 of file brush.c.
References BKE_image_get_ibuf(), co, Tex::ima, MEM_callocN(), Brush::mtex, multitex_ext(), NULL, 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 | ( | struct Brush * | brush, |
| short | flt, | ||
| short | texfalloff, | ||
| int | size, | ||
| struct ImBuf ** | imbuf, | ||
| int | use_color_correction | ||
| ) |
Definition at line 522 of file brush.c.
References brush_alpha(), brush_curve_strength(), brush_curve_strength_clamp(), brush_sample_tex(), brush_size(), copy_v3_v3(), FTOCHAR, IB_rect, IB_rectfloat, IMB_allocImBuf(), mul_v3_v3v3(), ImBuf::rect, ImBuf::rect_float, Brush::rgb, sqrt(), srgb_to_linearrgb_v3_v3(), VECCOPY, ImBuf::x, and ImBuf::y.
Referenced by brush_painter_refresh_cache().
| void brush_jitter_pos | ( | struct Brush * | brush, |
| float * | pos, | ||
| float * | jitterpos | ||
| ) |
Definition at line 929 of file brush.c.
References BLI_frand(), BRUSH_ANCHORED, BRUSH_RESTORE_MESH, brush_size(), Brush::flag, Brush::jitter, len_v2(), and VECCOPY2D.
Referenced by brush_painter_paint(), and paint_brush_stroke_add_step().
| void brush_painter_break_stroke | ( | BrushPainter * | painter | ) |
Definition at line 912 of file brush.c.
References BrushPainter::firsttouch.
Referenced by imapaint_paint_stroke().
| void brush_painter_free | ( | BrushPainter * | painter | ) |
Definition at line 705 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(), Brush::spacing, BrushPainter::startalpha, BrushPainter::startjitter, BrushPainter::startsize, BrushPainter::startspacing, and BrushPainterCache::texibuf.
Referenced by paint_exit().
| BrushPainter* brush_painter_new | ( | struct Brush * | brush | ) |
Definition at line 667 of file brush.c.
References BrushPainter::brush, brush_alpha(), brush_size(), BrushPainter::cache, BrushPainter::firsttouch, Brush::jitter, BrushPainterCache::lastsize, MEM_callocN(), 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 956 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, MAX2, normalize_v2(), Brush::rate, Brush::spacing, BrushPainter::startalpha, BrushPainter::startjitter, BrushPainter::startpaintpos, BrushPainter::startsize, BrushPainter::startspacing, 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 683 of file brush.c.
References BrushPainter::cache, BrushPainterCache::enabled, BrushPainterCache::flt, BrushPainterCache::ibuf, IMB_freeImBuf(), BrushPainterCache::lastsize, BrushPainterCache::maskibuf, NULL, size(), BrushPainterCache::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 | ( | struct Brush * | brush, |
| float * | xy, | ||
| float * | rgba, | ||
| const int | thread | ||
| ) |
Definition at line 489 of file brush.c.
References brush_size(), co, externtex(), Brush::mtex, and MTex::tex.
Referenced by brush_imbuf_new(), brush_painter_do_partial(), and do_projectpaint_thread().
| void brush_set_alpha | ( | struct Brush * | brush, |
| float | value | ||
| ) |
Definition at line 1459 of file brush.c.
References Brush::alpha, SCULPT_PAINT_USE_UNIFIED_ALPHA, set_unified_alpha(), and unified_settings().
Referenced by brush_apply_pressure(), brush_painter_free(), and brush_painter_paint().
| void brush_set_size | ( | struct Brush * | brush, |
| int | value | ||
| ) |
Definition at line 1369 of file brush.c.
References SCULPT_PAINT_USE_UNIFIED_SIZE, set_unified_size(), size(), Brush::size, and unified_settings().
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().
| void brush_set_unprojected_radius | ( | struct Brush * | brush, |
| float | value | ||
| ) |
Definition at line 1444 of file brush.c.
References SCULPT_PAINT_USE_UNIFIED_SIZE, set_unified_unprojected_radius(), unified_settings(), and Brush::unprojected_radius.
Referenced by brush_scale_size_exec(), paint_cursor_on_hit(), and sculpt_update_cache_variants().
| void brush_set_use_alpha_pressure | ( | struct Brush * | brush, |
| int | value | ||
| ) |
Definition at line 1424 of file brush.c.
References BRUSH_ALPHA_PRESSURE, Brush::flag, SCULPT_PAINT_UNIFIED_ALPHA_PRESSURE, SCULPT_PAINT_USE_UNIFIED_ALPHA, set_unified_settings(), and unified_settings().
| void brush_set_use_locked_size | ( | struct Brush * | brush, |
| int | value | ||
| ) |
Definition at line 1384 of file brush.c.
References BRUSH_LOCK_SIZE, Brush::flag, SCULPT_PAINT_UNIFIED_LOCK_BRUSH_SIZE, SCULPT_PAINT_USE_UNIFIED_SIZE, set_unified_settings(), and unified_settings().
| void brush_set_use_size_pressure | ( | struct Brush * | brush, |
| int | value | ||
| ) |
Definition at line 1404 of file brush.c.
References BRUSH_SIZE_PRESSURE, Brush::flag, SCULPT_PAINT_UNIFIED_SIZE_PRESSURE, SCULPT_PAINT_USE_UNIFIED_SIZE, set_unified_settings(), and unified_settings().
| int brush_size | ( | struct Brush * | brush | ) |
Definition at line 1379 of file brush.c.
References SCULPT_PAINT_USE_UNIFIED_SIZE, Brush::size, unified_settings(), and unified_size().
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(), calc_vp_alpha_dl(), 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 451 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 427 of file brush.c.
References add_texture(), BLI_findlink(), brush_texture_delete(), copy_texture(), G, id_us_plus(), Global::main, Brush::mtex, NULL, MTex::tex, Main::tex, and ID::us.
| float brush_unprojected_radius | ( | struct Brush * | brush | ) |
Definition at line 1454 of file brush.c.
References SCULPT_PAINT_USE_UNIFIED_SIZE, unified_settings(), unified_unprojected_radius(), and Brush::unprojected_radius.
Referenced by brush_scale_size_exec(), sculpt_get_brush_geometry(), and sculpt_update_cache_variants().
| int brush_use_alpha_pressure | ( | struct Brush * | brush | ) |
Definition at line 1439 of file brush.c.
References BRUSH_ALPHA_PRESSURE, Brush::flag, SCULPT_PAINT_UNIFIED_ALPHA_PRESSURE, SCULPT_PAINT_USE_UNIFIED_ALPHA, and unified_settings().
Referenced by brush_apply_pressure(), brush_strength(), calc_vp_alpha_dl(), paint_apply_event(), and paint_cursor_on_hit().
| int brush_use_locked_size | ( | struct Brush * | brush | ) |
Definition at line 1399 of file brush.c.
References BRUSH_LOCK_SIZE, Brush::flag, SCULPT_PAINT_UNIFIED_LOCK_BRUSH_SIZE, SCULPT_PAINT_USE_UNIFIED_SIZE, and unified_settings().
Referenced by paint_cursor_on_hit(), paint_draw_cursor(), and sculpt_update_cache_variants().
| int brush_use_size_pressure | ( | struct Brush * | brush | ) |
Definition at line 1419 of file brush.c.
References BRUSH_SIZE_PRESSURE, Brush::flag, SCULPT_PAINT_UNIFIED_SIZE_PRESSURE, SCULPT_PAINT_USE_UNIFIED_SIZE, and unified_settings().
Referenced by brush_apply_pressure(), calc_vp_alpha_dl(), paint_apply_event(), paint_cursor_on_hit(), paint_draw_alpha_overlay(), paint_space_stroke(), sculpt_restore_mesh(), and sculpt_update_cache_variants().
Definition at line 144 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 170 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 102 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, Brush::flag, G, IB_metadata, IB_multilayer, IB_rect, Brush::icon_filepath, ID::icon_id, Brush::icon_imbuf, Brush::id, IMB_loadiffname(), Global::main, and Main::name.
Referenced by icon_preview_startjob().
| void make_local_brush | ( | struct Brush * | brush | ) |
Definition at line 188 of file brush.c.
References Main::brush, Brush::clone, copy_brush(), ELEM, extern_local_brush(), ListBase::first, ID::flag, G, Brush::id, Image::id, Scene::id, BrushClone::image, ToolSettings::imapaint, ID::lib, LIB_FAKEUSER, LIB_LOCAL, Global::main, new_id(), ID::next, NULL, ImagePaintSettings::paint, paint_brush(), paint_brush_set(), Main::scene, bContext::scene, Scene::toolsettings, and ID::us.
Referenced by id_make_local().