41 #include "RNA_prototypes.h"
69 const float bb_min[3],
70 const float bb_max[3],
75 float projection_mat[4][4];
81 if (bb_min[0] > bb_max[0] || bb_min[1] > bb_max[1] || bb_min[2] > bb_max[2]) {
87 for (i = 0; i < 2; i++) {
88 for (j = 0; j < 2; j++) {
89 for (k = 0; k < 2; k++) {
90 float vec[3], proj[2];
92 vec[0] = i ? bb_min[0] : bb_max[0];
93 vec[1] = j ? bb_min[1] : bb_max[1];
94 vec[2] = k ? bb_min[2] : bb_max[2];
115 const rcti *screen_rect)
133 float delta[3], scale, loc[3];
134 const float xy_delta[2] = {pixel_radius, 0.0f};
142 scale = (scale == 0.0f) ? 1.0f : scale;
144 return len_v3(delta) / scale;
151 const float co[3] = {u,
v, 0.0f};
164 bool convert_to_linear,
167 const float co[3] = {u,
v, 0.0f};
179 if (convert_to_linear) {
196 "Invert action of brush for duration of stroke"},
201 "Switch brush to smooth mode for duration of stroke"},
215 "Action taken when a paint stroke is made");
236 float pv1[4], pv2[4], pv3[4], h[3], divw;
237 float wmat[3][3], invwmat[3][3];
247 h[0] = (co[0] -
view[0]) * 2.0f /
view[2] - 1.0f;
248 h[1] = (co[1] -
view[1]) * 2.0f /
view[3] - 1.0f;
270 divw =
w[0] +
w[1] +
w[2];
281 float p[2],
w[3], absw, minabsw;
282 float matrix[4][4], proj[4][4];
307 for (i = 0; i < tottri; i++, lt++) {
308 findex = index_mp_to_orig ? index_mp_to_orig[lt->
poly] : lt->
poly;
310 if (findex == faceindex) {
316 for (
int j = 3; j--;) {
327 if (!(slot && slot->
uvname &&
336 tri_uv[0] = &mloopuv[lt->
tri[0]];
337 tri_uv[1] = &mloopuv[lt->
tri[1]];
338 tri_uv[2] = &mloopuv[lt->
tri[2]];
345 if (absw < minabsw) {
346 uv[0] = tri_uv[0]->
uv[0] *
w[0] + tri_uv[1]->
uv[0] *
w[1] + tri_uv[2]->
uv[0] *
w[2];
347 uv[1] = tri_uv[0]->
uv[1] *
w[0] + tri_uv[1]->
uv[1] *
w[1] + tri_uv[2]->
uv[1] *
w[2];
365 if ((*r_index) == 0 || (*r_index) > (
uint)totpoly) {
400 if (v3d && texpaint_proj) {
415 const int mval[2] = {
x,
y};
430 MPoly *mp = me_eval->mpoly + faceindex;
464 u =
fmodf(uv[0], 1.0f);
524 else if (sima !=
NULL) {
577 return br && br->
curve;
595 ot->
idname =
"BRUSH_OT_curve_preset";
615 ot->
name =
"Select Linked";
617 ot->
idname =
"PAINT_OT_face_select_linked";
636 ot->
name =
"Select Linked Pick";
638 ot->
idname =
"PAINT_OT_face_select_linked_pick";
660 ot->
name =
"(De)select All";
662 ot->
idname =
"PAINT_OT_face_select_all";
683 ot->
name =
"(De)select All";
685 ot->
idname =
"PAINT_OT_vert_select_all";
714 ot->
name =
"Select Ungrouped";
715 ot->
idname =
"PAINT_OT_vert_select_ungrouped";
739 ot->
name =
"Face Select Hide";
741 ot->
idname =
"PAINT_OT_face_select_hide";
749 ot->
srna,
"unselected", 0,
"Unselected",
"Hide unselected rather than selected objects");
763 ot->
name =
"Vertex Select Hide";
765 ot->
idname =
"PAINT_OT_vert_select_hide";
773 ot->
srna,
"unselected", 0,
"Unselected",
"Hide unselected rather than selected vertices");
802 ot->
name =
"Reveal Faces/Vertices";
804 ot->
idname =
"PAINT_OT_face_vert_reveal";
815 "Specifies whether the newly revealed geometry should be selected");
void BKE_brush_curve_preset(struct Brush *b, enum eCurveMappingPreset preset)
void BKE_brush_color_set(struct Scene *scene, struct Brush *brush, const float color[3])
struct Scene * CTX_data_scene(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct SpaceImage * CTX_wm_space_image(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
bool CustomData_has_layer(const struct CustomData *data, int type)
const CustomData_MeshMasks CD_MASK_BAREMESH
void * CustomData_get_layer_named(const struct CustomData *data, int type, const char *name)
void * CustomData_get_layer(const struct CustomData *data, int type)
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
int BKE_image_get_tile_from_pos(struct Image *ima, const float uv[2], float r_uv[2], float r_ofs[2])
void BKE_imageuser_default(struct ImageUser *iuser)
General operations, lookup, etc. for materials.
struct Material * BKE_object_material_get(struct Object *ob, short act)
void BKE_texpaint_slot_refresh_cache(struct Scene *scene, struct Material *ma, const struct Object *ob)
const struct MLoopTri * BKE_mesh_runtime_looptri_ensure(const struct Mesh *mesh)
struct Mesh * mesh_get_eval_final(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, const struct CustomData_MeshMasks *dataMask)
struct Palette * BKE_paint_palette(struct Paint *paint)
struct Palette * BKE_palette_add(struct Main *bmain, const char *name)
void BKE_paint_invalidate_cursor_overlay(struct Scene *scene, struct ViewLayer *view_layer, struct CurveMapping *curve)
bool BKE_paint_select_elem_test(struct Object *ob)
struct Brush * BKE_paint_brush(struct Paint *paint)
void BKE_paint_palette_set(struct Paint *p, struct Palette *palette)
struct Paint * BKE_paint_get_active_from_context(const struct bContext *C)
bool BKE_paint_select_vert_test(struct Object *ob)
struct PaletteColor * BKE_palette_color_add(struct Palette *palette)
bool BKE_paint_always_hide_test(struct Object *ob)
void BKE_report(ReportList *reports, eReportType type, const char *message)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE void straight_to_premul_v4(float color[4])
MINLINE void linearrgb_to_srgb_v3_v3(float srgb[3], const float linear[3])
void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3])
void mul_m3_v3(const float M[3][3], float r[3])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void mul_m4_v4(const float M[4][4], float r[4])
bool invert_m3_m3(float R[3][3], const float A[3][3])
float mat4_to_scale(const float M[4][4])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
MINLINE void clamp_v4(float vec[4], float min, float max)
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void BLI_rcti_init_minmax(struct rcti *rect)
void BLI_rcti_do_minmax_v(struct rcti *rect, const int xy[2])
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
struct Depsgraph Depsgraph
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
#define CD_MASK_ORIGINDEX
#define SHD_INTERP_CLOSEST
#define SHD_INTERP_LINEAR
Object is a sort of wrapper for general info.
#define IMAGEPAINT_MODE_MATERIAL
#define OBACT(_view_layer)
@ PAINT_CANVAS_SOURCE_MATERIAL
uint DRW_select_buffer_sample_point(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int center[2])
bool ED_space_image_color_sample(struct SpaceImage *sima, struct ARegion *region, const int mval[2], float r_col[3], bool *r_is_data)
void paintface_reveal(struct bContext *C, struct Object *ob, bool select)
bool paintvert_deselect_all_visible(struct Object *ob, int action, bool flush_flags)
bool paintface_deselect_all_visible(struct bContext *C, struct Object *ob, int action, bool flush_flags)
void paintface_select_linked(struct bContext *C, struct Object *ob, const int mval[2], bool select)
void paintvert_hide(struct bContext *C, struct Object *ob, bool unselected)
void paintface_hide(struct bContext *C, struct Object *ob, bool unselected)
void paintvert_reveal(struct bContext *C, struct Object *ob, bool select)
void paintvert_tag_select_update(struct bContext *C, struct Object *ob)
void paintvert_select_ungrouped(struct Object *ob, bool extend, bool flush_flags)
void ED_region_tag_redraw(struct ARegion *region)
void ED_view3d_win_to_delta(const struct ARegion *region, const float xy_delta[2], float zfac, float r_out[3])
void ED_view3d_viewcontext_init(struct bContext *C, struct ViewContext *vc, struct Depsgraph *depsgraph)
void ED_view3d_ob_project_mat_get(const struct RegionView3D *v3d, const struct Object *ob, float r_pmat[4][4])
void ED_view3d_select_id_validate(struct ViewContext *vc)
void ED_view3d_project_float_v2_m4(const struct ARegion *region, const float co[3], float r_co[2], const float mat[4][4])
float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3])
void ED_view3d_clipping_calc(struct BoundBox *bb, float planes[4][4], const struct ARegion *region, const struct Object *ob, const struct rcti *rect)
void view3d_operator_needs_opengl(const struct bContext *C)
NSNotificationCenter * center
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
#define GPU_matrix_model_view_get(x)
#define GPU_matrix_projection_get(x)
void GPU_viewport_size_get_i(int coords[4])
void IMB_colormanagement_colorspace_to_scene_linear_v3(float pixel[3], struct ColorSpace *colorspace)
void nearest_interpolation_color_wrap(const struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v)
void bilinear_interpolation_color_wrap(const struct ImBuf *in, unsigned char outI[4], float outF[4], float u, float v)
Contains defines and structs used throughout the imbuf module.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
const Depsgraph * depsgraph
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
void GPU_frontbuffer_read_pixels(int x, int y, int w, int h, int channels, eGPUDataFormat format, void *data)
ccl_device_inline float2 interp(const float2 &a, const float2 &b, float t)
static const pxr::TfToken rgba("rgba", pxr::TfToken::Immortal)
bool vert_paint_poll(bContext *C)
bool facemask_paint_poll(bContext *C)
void paint_sample_color(bContext *C, ARegion *region, int x, int y, bool texpaint_proj, bool use_palette)
static bool brush_curve_preset_poll(bContext *C)
void paint_get_tex_pixel_col(const MTex *mtex, float u, float v, float rgba[4], struct ImagePool *pool, int thread, bool convert_to_linear, struct ColorSpace *colorspace)
static int face_vert_reveal_exec(bContext *C, wmOperator *op)
void PAINT_OT_face_select_hide(wmOperatorType *ot)
static int brush_curve_preset_exec(bContext *C, wmOperator *op)
float paint_calc_object_space_radius(ViewContext *vc, const float center[3], float pixel_radius)
void PAINT_OT_face_select_linked_pick(wmOperatorType *ot)
static int vert_select_hide_exec(bContext *C, wmOperator *op)
void PAINT_OT_vert_select_ungrouped(wmOperatorType *ot)
float paint_get_tex_pixel(const MTex *mtex, float u, float v, struct ImagePool *pool, int thread)
void BRUSH_OT_curve_preset(wmOperatorType *ot)
void PAINT_OT_vert_select_all(wmOperatorType *ot)
static int face_select_hide_exec(bContext *C, wmOperator *op)
static int face_select_all_exec(bContext *C, wmOperator *op)
void PAINT_OT_face_select_all(wmOperatorType *ot)
static int imapaint_pick_face(ViewContext *vc, const int mval[2], uint *r_index, uint totpoly)
void PAINT_OT_face_select_linked(wmOperatorType *ot)
static bool face_vert_reveal_poll(bContext *C)
static int vert_select_ungrouped_exec(bContext *C, wmOperator *op)
static void imapaint_tri_weights(float matrix[4][4], const int view[4], const float v1[3], const float v2[3], const float v3[3], const float co[2], float w[3])
bool paint_convert_bb_to_rect(rcti *rect, const float bb_min[3], const float bb_max[3], const ARegion *region, RegionView3D *rv3d, Object *ob)
static void imapaint_pick_uv(Mesh *me_eval, Scene *scene, Object *ob_eval, uint faceindex, const int xy[2], float uv[2])
static void imapaint_project(const float matrix[4][4], const float co[3], float pco[4])
void paint_calc_redraw_planes(float planes[4][4], const ARegion *region, Object *ob, const rcti *screen_rect)
static int vert_select_all_exec(bContext *C, wmOperator *op)
void PAINT_OT_vert_select_hide(wmOperatorType *ot)
static int paint_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void PAINT_OT_face_vert_reveal(wmOperatorType *ot)
void paint_stroke_operator_properties(wmOperatorType *ot)
static int paint_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_collection_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct CurveMapping * curve
struct TexPaintSlot * texpaintslot
struct MLoopTri_Store looptris
struct MDeformVert * dvert
ListBase vertex_group_names
struct ToolSettings * toolsettings
struct Depsgraph * depsgraph
struct RegionView3D * rv3d
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
bool RE_texture_evaluate(const MTex *mtex, const float vec[3], const int thread, struct ImagePool *pool, const bool skip_load_image, const bool texnode_preview, float *r_intensity, float r_rgba[4])
void WM_operator_properties_select_all(wmOperatorType *ot)