Blender V2.61 - r43446
Functions

paint_utils.c File Reference

#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.

Functions

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)
void paint_calc_redraw_planes (float planes[4][4], const ARegion *ar, RegionView3D *rv3d, Object *ob, const rcti *screen_rect)
void projectf (bglMats *mats, const float v[3], float p[2])
float paint_calc_object_space_radius (ViewContext *vc, const float center[3], float pixel_radius)
float paint_get_tex_pixel (Brush *br, float u, float v)
static void imapaint_project (Object *ob, float *model, float *proj, float *co, float *pco)
static void imapaint_tri_weights (Object *ob, float *v1, float *v2, float *v3, float *co, float *w)
void imapaint_pick_uv (Scene *scene, Object *ob, unsigned int faceindex, const int xy[2], float uv[2])
int imapaint_pick_face (ViewContext *vc, Mesh *me, const int mval[2], unsigned int *index)
 * returns 0 if not found, otherwise 1 */
void paint_sample_color (Scene *scene, ARegion *ar, int x, int y)
static int brush_curve_preset_exec (bContext *C, wmOperator *op)
static int brush_curve_preset_poll (bContext *C)
void BRUSH_OT_curve_preset (wmOperatorType *ot)
static int paint_select_linked_exec (bContext *C, wmOperator *UNUSED(op))
void PAINT_OT_face_select_linked (wmOperatorType *ot)
static int paint_select_linked_pick_invoke (bContext *C, wmOperator *op, wmEvent *event)
void PAINT_OT_face_select_linked_pick (wmOperatorType *ot)
static int face_select_all_exec (bContext *C, wmOperator *op)
void PAINT_OT_face_select_all (wmOperatorType *ot)
static int vert_select_all_exec (bContext *C, wmOperator *op)
void PAINT_OT_vert_select_all (wmOperatorType *ot)
static int vert_select_inverse_exec (bContext *C, wmOperator *UNUSED(op))
void PAINT_OT_vert_select_inverse (wmOperatorType *ot)
static int face_select_inverse_exec (bContext *C, wmOperator *UNUSED(op))
void PAINT_OT_face_select_inverse (wmOperatorType *ot)
static int face_select_hide_exec (bContext *C, wmOperator *op)
void PAINT_OT_face_select_hide (wmOperatorType *ot)
static int face_select_reveal_exec (bContext *C, wmOperator *UNUSED(op))
void PAINT_OT_face_select_reveal (wmOperatorType *ot)

Detailed Description

Definition in file paint_utils.c.


Function Documentation

static int brush_curve_preset_exec ( bContext C,
wmOperator op 
) [static]
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)
static int face_select_all_exec ( bContext C,
wmOperator op 
) [static]
static int face_select_hide_exec ( bContext C,
wmOperator op 
) [static]
static int face_select_inverse_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int face_select_reveal_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
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] 
)
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 
)
void paint_calc_redraw_planes ( float  planes[4][4],
const ARegion ar,
RegionView3D rv3d,
Object ob,
const rcti screen_rect 
)
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 
)
float paint_get_tex_pixel ( Brush br,
float  u,
float  v 
)
void PAINT_OT_face_select_all ( wmOperatorType ot)
void PAINT_OT_face_select_hide ( wmOperatorType ot)
void PAINT_OT_face_select_inverse ( wmOperatorType ot)
void PAINT_OT_face_select_linked ( wmOperatorType ot)
void PAINT_OT_face_select_linked_pick ( wmOperatorType ot)
void PAINT_OT_face_select_reveal ( wmOperatorType ot)
void PAINT_OT_vert_select_all ( wmOperatorType ot)
void PAINT_OT_vert_select_inverse ( wmOperatorType ot)
void paint_sample_color ( Scene scene,
ARegion ar,
int  x,
int  y 
)
static int paint_select_linked_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int paint_select_linked_pick_invoke ( bContext C,
wmOperator op,
wmEvent event 
) [static]
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]
static int vert_select_inverse_exec ( bContext C,
wmOperator UNUSEDop 
) [static]