Blender V2.61 - r43446
|
#include <math.h>
#include <stdlib.h>
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_brush_types.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_DerivedMesh.h"
#include "BKE_paint.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "RE_shader_ext.h"
#include "ED_view3d.h"
#include "ED_screen.h"
#include "BLO_sys_types.h"
#include "ED_mesh.h"
#include "WM_api.h"
#include "WM_types.h"
#include "paint_intern.h"
Go to the source code of this file.
Definition in file paint_utils.c.
static int brush_curve_preset_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 355 of file paint_utils.c.
References brush_curve_preset(), CTX_data_scene(), OPERATOR_FINISHED, paint_brush(), paint_get_active(), wmOperator::ptr, and RNA_enum_get().
Referenced by BRUSH_OT_curve_preset().
static int brush_curve_preset_poll | ( | bContext * | C | ) | [static] |
Definition at line 363 of file paint_utils.c.
References CTX_data_scene(), Brush::curve, paint_brush(), and paint_get_active().
Referenced by BRUSH_OT_curve_preset().
void BRUSH_OT_curve_preset | ( | wmOperatorType * | ot | ) |
Definition at line 370 of file paint_utils.c.
References brush_curve_preset_exec(), brush_curve_preset_poll(), CURVE_PRESET_LINE, CURVE_PRESET_MAX, CURVE_PRESET_ROOT, CURVE_PRESET_ROUND, CURVE_PRESET_SHARP, CURVE_PRESET_SMOOTH, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
static int face_select_all_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 437 of file paint_utils.c.
References CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), OPERATOR_FINISHED, paintface_deselect_all_visible(), wmOperator::ptr, RNA_enum_get(), and TRUE.
Referenced by PAINT_OT_face_select_all().
static int face_select_hide_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 524 of file paint_utils.c.
References CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), OPERATOR_FINISHED, paintface_hide(), wmOperator::ptr, and RNA_boolean_get().
Referenced by PAINT_OT_face_select_hide().
static int face_select_inverse_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 503 of file paint_utils.c.
References CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), OPERATOR_FINISHED, paintface_deselect_all_visible(), SEL_INVERT, and TRUE.
Referenced by PAINT_OT_face_select_inverse().
static int face_select_reveal_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 547 of file paint_utils.c.
References CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), OPERATOR_FINISHED, and paintface_reveal().
Referenced by PAINT_OT_face_select_reveal().
int imapaint_pick_face | ( | ViewContext * | vc, |
Mesh * | me, | ||
const int | mval[2], | ||
unsigned int * | index | ||
) |
* returns 0 if not found, otherwise 1 */
Definition at line 316 of file paint_utils.c.
References Mesh::totface, and view3d_sample_backbuf().
Referenced by imapaint_paint_stroke().
void imapaint_pick_uv | ( | Scene * | scene, |
Object * | ob, | ||
unsigned int | faceindex, | ||
const int | xy[2], | ||
float | uv[2] | ||
) |
Definition at line 250 of file paint_utils.c.
References CD_MASK_BAREMESH, CD_MTFACE, CD_ORIGINDEX, co, fabs(), DerivedMesh::getFace, DerivedMesh::getFaceDataArray, DerivedMesh::getNumFaces, DerivedMesh::getVert, imapaint_tri_weights(), mesh_get_derived_final(), p, DerivedMesh::release, MFace::v1, MFace::v2, MFace::v3, MFace::v4, and simple_enum_gen::w.
Referenced by imapaint_paint_stroke().
static void imapaint_project | ( | Object * | ob, |
float * | model, | ||
float * | proj, | ||
float * | co, | ||
float * | pco | ||
) | [static] |
Definition at line 197 of file paint_utils.c.
References copy_v3_v3(), mul_m4_v3(), mul_m4_v4(), and Object::obmat.
Referenced by imapaint_tri_weights().
static void imapaint_tri_weights | ( | Object * | ob, |
float * | v1, | ||
float * | v2, | ||
float * | v3, | ||
float * | co, | ||
float * | w | ||
) | [static] |
Definition at line 207 of file paint_utils.c.
References copy_v3_v3(), imapaint_project(), invert_m3_m3(), mul_m3_v3(), and mul_v3_fl().
Referenced by imapaint_pick_uv().
float paint_calc_object_space_radius | ( | ViewContext * | vc, |
const float | center[3], | ||
float | pixel_radius | ||
) |
Definition at line 155 of file paint_utils.c.
References ViewContext::ar, ED_view3d_win_to_delta(), fabsf, initgrabz(), len_v3(), mat4_to_scale(), mul_v3_m4v3(), ViewContext::obact, Object::obmat, and ViewContext::rv3d.
Referenced by paint_cursor_on_hit(), and sculpt_update_cache_variants().
void paint_calc_redraw_planes | ( | float | planes[4][4], |
const ARegion * | ar, | ||
RegionView3D * | rv3d, | ||
Object * | ob, | ||
const rcti * | screen_rect | ||
) |
Definition at line 118 of file paint_utils.c.
References ED_view3d_calc_clipping(), mul_m4_fl(), view3d_get_transformation(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
int paint_convert_bb_to_rect | ( | rcti * | rect, |
const float | bb_min[3], | ||
const float | bb_max[3], | ||
const ARegion * | ar, | ||
RegionView3D * | rv3d, | ||
Object * | ob | ||
) |
Definition at line 73 of file paint_utils.c.
References ED_view3d_ob_project_mat_get(), ED_view3d_project_float(), i, MAX2, MIN2, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
float paint_get_tex_pixel | ( | Brush * | br, |
float | u, | ||
float | v | ||
) |
Definition at line 176 of file paint_utils.c.
References co, Brush::mtex, multitex_ext(), NULL, TexResult::ta, TexResult::tb, MTex::tex, TEX_RGB, TexResult::tg, TexResult::tin, and TexResult::tr.
Referenced by load_tex(), and tex_strength().
void PAINT_OT_face_select_all | ( | wmOperatorType * | ot | ) |
Definition at line 446 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, face_select_all_exec(), facemask_paint_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and WM_operator_properties_select_all().
Referenced by ED_operatortypes_paint().
void PAINT_OT_face_select_hide | ( | wmOperatorType * | ot | ) |
Definition at line 533 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, face_select_hide_exec(), facemask_paint_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
void PAINT_OT_face_select_inverse | ( | wmOperatorType * | ot | ) |
Definition at line 512 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, face_select_inverse_exec(), facemask_paint_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
void PAINT_OT_face_select_linked | ( | wmOperatorType * | ot | ) |
Definition at line 402 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, facemask_paint_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, paint_select_linked_exec(), and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
void PAINT_OT_face_select_linked_pick | ( | wmOperatorType * | ot | ) |
Definition at line 422 of file paint_utils.c.
References wmOperatorType::description, facemask_paint_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, paint_select_linked_pick_invoke(), wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
void PAINT_OT_face_select_reveal | ( | wmOperatorType * | ot | ) |
Definition at line 555 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, face_select_reveal_exec(), facemask_paint_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
void PAINT_OT_vert_select_all | ( | wmOperatorType * | ot | ) |
Definition at line 470 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, vert_paint_poll(), vert_select_all_exec(), and WM_operator_properties_select_all().
Referenced by ED_operatortypes_paint().
void PAINT_OT_vert_select_inverse | ( | wmOperatorType * | ot | ) |
Definition at line 492 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, vert_paint_poll(), and vert_select_inverse_exec().
Referenced by ED_operatortypes_paint().
Definition at line 333 of file paint_utils.c.
References CLAMP(), paint_brush(), paint_get_active(), Brush::rgb, ARegion::winrct, ARegion::winx, ARegion::winy, rcti::xmin, and rcti::ymin.
Referenced by sample_color_exec().
static int paint_select_linked_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 395 of file paint_utils.c.
References CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), NULL, OPERATOR_FINISHED, and paintface_select_linked().
Referenced by PAINT_OT_face_select_linked().
static int paint_select_linked_pick_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 414 of file paint_utils.c.
References CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), wmEvent::mval, OPERATOR_FINISHED, paintface_select_linked(), wmOperator::ptr, and RNA_boolean_get().
Referenced by PAINT_OT_face_select_linked_pick().
void projectf | ( | bglMats * | mats, |
const float | v[3], | ||
float | p[2] | ||
) |
Definition at line 145 of file paint_utils.c.
References bglMats::modelview, bglMats::projection, and bglMats::viewport.
Referenced by project_brush_radius().
static int vert_select_all_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 461 of file paint_utils.c.
References CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), OPERATOR_FINISHED, paintvert_deselect_all_visible(), wmOperator::ptr, RNA_enum_get(), and TRUE.
Referenced by PAINT_OT_vert_select_all().
static int vert_select_inverse_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 484 of file paint_utils.c.
References CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), OPERATOR_FINISHED, paintvert_deselect_all_visible(), SEL_INVERT, and TRUE.
Referenced by PAINT_OT_vert_select_inverse().