37#include "RNA_prototypes.hh"
53 const float bb_min[3],
54 const float bb_max[3],
64 if (bb_min[0] > bb_max[0] || bb_min[1] > bb_max[1] || bb_min[2] > bb_max[2]) {
70 for (
i = 0;
i < 2;
i++) {
71 for (j = 0; j < 2; j++) {
72 for (k = 0; k < 2; k++) {
75 vec[0] =
i ? bb_min[0] : bb_max[0];
76 vec[1] = j ? bb_min[1] : bb_max[1];
77 vec[2] = k ? bb_min[2] : bb_max[2];
97 const float pixel_radius)
100 float delta[3], scale, loc[3];
101 const float xy_delta[2] = {pixel_radius, 0.0f};
103 mul_v3_m4v3(loc, ob->object_to_world().ptr(), center);
109 scale = (scale == 0.0f) ? 1.0f : scale;
111 return len_v3(delta) / scale;
123 const float co[3] = {u,
v, 0.0f};
126 mtex, co,
thread, pool,
false,
false, &intensity, r_rgba);
127 *r_intensity = intensity;
130 r_rgba[0] = intensity;
131 r_rgba[1] = intensity;
132 r_rgba[2] = intensity;
147 "Invert action of brush for duration of stroke"},
152 "Switch brush to smooth mode for duration of stroke"},
157 "Switch brush to erase mode for duration of stroke"},
171 "Action taken when a paint stroke is made");
178 ot->srna,
"pen_flip",
false,
"Pen Flip",
"Whether a tablet's eraser mode is being used");
192 ot->name =
"Select Linked";
193 ot->description =
"Select linked faces";
194 ot->idname =
"PAINT_OT_face_select_linked";
215 ot->name =
"Select Linked Pick";
216 ot->description =
"Select linked faces under the cursor";
217 ot->idname =
"PAINT_OT_face_select_linked_pick";
224 RNA_def_boolean(
ot->srna,
"deselect",
false,
"Deselect",
"Deselect rather than select items");
239 ot->name =
"(De)select All";
240 ot->description =
"Change selection for all faces";
241 ot->idname =
"PAINT_OT_face_select_all";
255 if (mesh ==
nullptr || mesh->
faces_num == 0) {
269 ot->name =
"Select More";
270 ot->description =
"Select Faces connected to existing selection";
271 ot->idname =
"PAINT_OT_face_select_more";
279 ot->srna,
"face_step",
true,
"Face Step",
"Also select faces that only touch on a corner");
286 if (mesh ==
nullptr || mesh->
faces_num == 0) {
300 ot->name =
"Select Less";
301 ot->description =
"Deselect Faces connected to existing selection";
302 ot->idname =
"PAINT_OT_face_select_less";
310 ot->srna,
"face_step",
true,
"Face Step",
"Also deselect faces that only touch on a corner");
330 ot->name =
"Select Loop";
331 ot->description =
"Select face loop under the cursor";
332 ot->idname =
"PAINT_OT_face_select_loop";
339 RNA_def_boolean(
ot->srna,
"select",
true,
"Select",
"If false, faces will be deselected");
354 ot->name =
"(De)select All";
355 ot->description =
"Change selection for all vertices";
356 ot->idname =
"PAINT_OT_vert_select_all";
385 ot->name =
"Select Ungrouped";
386 ot->idname =
"PAINT_OT_vert_select_ungrouped";
387 ot->description =
"Select vertices without a group";
408 ot->name =
"Select Linked Vertices";
409 ot->description =
"Select linked vertices";
410 ot->idname =
"PAINT_OT_vert_select_linked";
432 ot->name =
"Select Linked Vertices Pick";
433 ot->description =
"Select linked vertices under the cursor";
434 ot->idname =
"PAINT_OT_vert_select_linked_pick";
445 "Whether to select or deselect linked vertices under the cursor");
452 if (mesh ==
nullptr || mesh->
faces_num == 0) {
468 ot->name =
"Select More";
469 ot->description =
"Select Vertices connected to existing selection";
470 ot->idname =
"PAINT_OT_vert_select_more";
478 ot->srna,
"face_step",
true,
"Face Step",
"Also select faces that only touch on a corner");
485 if (mesh ==
nullptr || mesh->
faces_num == 0) {
501 ot->name =
"Select Less";
502 ot->description =
"Deselect Vertices connected to existing selection";
503 ot->idname =
"PAINT_OT_vert_select_less";
511 ot->srna,
"face_step",
true,
"Face Step",
"Also deselect faces that only touch on a corner");
525 ot->name =
"Face Select Hide";
526 ot->description =
"Hide selected faces";
527 ot->idname =
"PAINT_OT_face_select_hide";
535 ot->srna,
"unselected",
false,
"Unselected",
"Hide unselected rather than selected objects");
549 ot->name =
"Vertex Select Hide";
550 ot->description =
"Hide selected vertices";
551 ot->idname =
"PAINT_OT_vert_select_hide";
562 "Hide unselected rather than selected vertices");
591 ot->name =
"Reveal Faces/Vertices";
592 ot->description =
"Reveal hidden faces and vertices";
593 ot->idname =
"PAINT_OT_face_vert_reveal";
604 "Specifies whether the newly revealed geometry should be selected");
Object * CTX_data_active_object(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
Mesh * BKE_mesh_from_object(Object *ob)
bool BKE_paint_always_hide_test(const Object *ob)
bool BKE_paint_select_elem_test(const Object *ob)
bool BKE_paint_select_vert_test(const Object *ob)
void BKE_report(ReportList *reports, eReportType type, const char *message)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
float mat4_to_scale(const float mat[4][4])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[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_OPERATOR_DEFAULT
Object is a sort of wrapper for general info.
void paintvert_reveal(bContext *C, Object *ob, bool select)
void paintvert_select_more(Mesh *mesh, bool face_step)
void paintvert_select_less(Mesh *mesh, bool face_step)
void paintvert_flush_flags(Object *ob)
void paintface_select_less(Mesh *mesh, bool face_step)
void paintvert_tag_select_update(bContext *C, Object *ob)
void paintvert_hide(bContext *C, Object *ob, bool unselected)
void paintvert_select_ungrouped(Object *ob, bool extend, bool flush_flags)
void paintface_reveal(bContext *C, Object *ob, bool select)
void paintface_flush_flags(bContext *C, Object *ob, bool flush_selection, bool flush_hidden)
bool paintvert_deselect_all_visible(Object *ob, int action, bool flush_flags)
void paintvert_select_linked(bContext *C, Object *ob)
void paintvert_select_linked_pick(bContext *C, Object *ob, const int region_coordinates[2], bool select)
void paintface_select_linked(bContext *C, Object *ob, const int mval[2], bool select)
void paintface_select_loop(bContext *C, Object *ob, const int mval[2], bool select)
void paintface_hide(bContext *C, Object *ob, bool unselected)
bool paintface_deselect_all_visible(bContext *C, Object *ob, int action, bool flush_flags)
void paintface_select_more(Mesh *mesh, bool face_step)
void ED_region_tag_redraw(ARegion *region)
blender::float2 ED_view3d_project_float_v2_m4(const ARegion *region, const float co[3], const blender::float4x4 &mat)
void ED_view3d_win_to_delta(const ARegion *region, const float xy_delta[2], float zfac, float r_out[3], bool precise=false)
blender::float4x4 ED_view3d_ob_project_mat_get(const RegionView3D *rv3d, const Object *ob)
float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3])
void view3d_operator_needs_gpu(const bContext *C)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static BMFace * face_step(BMEdge *edge, BMFace *f)
MatBase< float, 4, 4 > float4x4
VecBase< float, 2 > float2
VecBase< float, 3 > float3
bool vert_paint_poll(bContext *C)
bool facemask_paint_poll(bContext *C)
void PAINT_OT_face_select_more(wmOperatorType *ot)
void PAINT_OT_vert_select_less(wmOperatorType *ot)
static wmOperatorStatus paintface_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool paint_convert_bb_to_rect(rcti *rect, const float bb_min[3], const float bb_max[3], const ARegion ®ion, const RegionView3D &rv3d, const Object &ob)
void PAINT_OT_face_select_hide(wmOperatorType *ot)
void PAINT_OT_face_select_loop(wmOperatorType *ot)
void PAINT_OT_vert_select_linked(wmOperatorType *ot)
void PAINT_OT_face_select_linked_pick(wmOperatorType *ot)
static wmOperatorStatus face_select_all_exec(bContext *C, wmOperator *op)
static wmOperatorStatus face_select_hide_exec(bContext *C, wmOperator *op)
void PAINT_OT_vert_select_linked_pick(wmOperatorType *ot)
void PAINT_OT_vert_select_ungrouped(wmOperatorType *ot)
static wmOperatorStatus paintvert_select_less_exec(bContext *C, wmOperator *op)
static wmOperatorStatus paint_select_less_exec(bContext *C, wmOperator *op)
static wmOperatorStatus vert_select_ungrouped_exec(bContext *C, wmOperator *op)
void PAINT_OT_face_select_less(wmOperatorType *ot)
void PAINT_OT_vert_select_all(wmOperatorType *ot)
static wmOperatorStatus paintvert_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void PAINT_OT_face_select_all(wmOperatorType *ot)
static wmOperatorStatus paintvert_select_more_exec(bContext *C, wmOperator *op)
void PAINT_OT_face_select_linked(wmOperatorType *ot)
static bool face_vert_reveal_poll(bContext *C)
static wmOperatorStatus paint_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus vert_select_hide_exec(bContext *C, wmOperator *op)
static wmOperatorStatus vert_select_all_exec(bContext *C, wmOperator *op)
static wmOperatorStatus paintvert_select_linked_exec(bContext *C, wmOperator *)
void PAINT_OT_vert_select_hide(wmOperatorType *ot)
void PAINT_OT_vert_select_more(wmOperatorType *ot)
bool paint_get_tex_pixel(const MTex *mtex, float u, float v, ImagePool *pool, int thread, float *r_intensity, float r_rgba[4])
static wmOperatorStatus face_vert_reveal_exec(bContext *C, wmOperator *op)
void PAINT_OT_face_vert_reveal(wmOperatorType *ot)
void paint_stroke_operator_properties(wmOperatorType *ot)
static wmOperatorStatus paint_select_more_exec(bContext *C, wmOperator *op)
float paint_calc_object_space_radius(const ViewContext &vc, const blender::float3 ¢er, const float pixel_radius)
static wmOperatorStatus paint_select_linked_exec(bContext *C, wmOperator *)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int 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)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, 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)
ListBase vertex_group_names
struct ReportList * reports
bool RE_texture_evaluate(const MTex *mtex, const float vec[3], const int thread, 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)