68 bool changed_multi =
false;
69 for (
Base *base : bases) {
70 Object *ob_iter = base->object;
102 for (
const int ob_index : objects.index_range()) {
103 Object *obedit = objects[ob_index];
105 int seed_iter =
seed;
113 int elem_map_len = 0;
119 elem_map[elem_map_len++] = bp;
125 const int count_select = elem_map_len * randfac;
126 for (
int i = 0; i < count_select; i++) {
145 ot->
name =
"Select Random";
147 ot->
idname =
"LATTICE_OT_select_random";
170 bool flip_uvw[3] = {
false};
171 flip_uvw[axis] =
true;
183 for (
int i = 0; i < tot; i++) {
211 for (
Object *obedit : objects) {
214 for (
int axis = 0; axis < 3; axis++) {
215 if ((1 << axis) & axis_flag) {
231 ot->
name =
"Select Mirror";
233 ot->
idname =
"LATTICE_OT_select_mirror";
272 bool changed =
false;
276 for (
Object *obedit : objects) {
291 for (u = 0; u < lt->
pntsu; u++) {
332 ot->
description =
"Select vertex directly linked to already selected ones";
333 ot->
idname =
"LATTICE_OT_select_more";
347 ot->
description =
"Deselect vertices at the boundary of each selection region";
348 ot->
idname =
"LATTICE_OT_select_less";
369 bool changed =
false;
403 for (
Object *obedit : objects) {
412 bool changed_multi =
false;
413 for (
Object *obedit : objects) {
417 bool changed =
false;
427 lt =
static_cast<Lattice *
>(obedit->data);
442 changed_multi =
true;
457 ot->
name =
"(De)select All";
458 ot->
description =
"Change selection of all UVW control points";
459 ot->
idname =
"LATTICE_OT_select_all";
482 bool changed =
false;
486 for (
Object *obedit : objects) {
503 for (a = 0, bp = lt->
def; a < tot; a++, bp++, dv++) {
505 if (dv->
dw ==
nullptr) {
526 ot->
name =
"Select Ungrouped";
527 ot->
idname =
"LATTICE_OT_select_ungrouped";
563 if ((bp->
f1 &
SELECT) && data->select) {
567 if (dist_test < data->dist) {
568 data->dist = dist_test;
570 data->is_changed =
true;
580 data.mval_fl[0] = vc->
mval[0];
581 data.mval_fl[1] = vc->
mval[1];
585 for (
Base *base : bases) {
586 data.is_changed =
false;
593 if (data.is_changed) {
604 Base *basact =
nullptr;
605 bool changed =
false;
608 vc.
mval[0] = mval[0];
609 vc.
mval[1] = mval[1];
612 bool found = (bp !=
nullptr);
618 else if (found ||
params->deselect_all) {
622 for (
Object *ob : objects) {
677 return changed || found;
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
void BKE_lattice_bitmap_from_flag(const Lattice *lt, unsigned int *bitmap, uint8_t flag, bool clear, bool respecthide)
int BKE_lattice_index_flip(const Lattice *lt, int index, bool flip_u, bool flip_v, bool flip_w)
int BKE_lattice_index_from_uvw(const Lattice *lt, int u, int v, int w)
bool BKE_lattice_is_any_selected(const Lattice *lt)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Base * BKE_view_layer_active_base_get(ViewLayer *view_layer)
blender::Vector< Base * > BKE_view_layer_array_from_bases_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define BLI_assert_unreachable()
#define BLI_BITMAP_NEW(_num, _alloc_string)
#define BLI_BITMAP_TEST(_bitmap, _index)
unsigned int BLI_ghashutil_strhash_p(const void *ptr)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
MINLINE float len_manhattan_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
void BLI_array_randomize(void *data, unsigned int elem_size, unsigned int elem_num, unsigned int seed)
#define SET_FLAG_FROM_TEST(value, test, flag)
void DEG_id_tag_update(ID *id, unsigned int flags)
Object is a sort of wrapper for general info.
bool ED_operator_editlattice(bContext *C)
float ED_view3d_select_dist_px()
void ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d)
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
void lattice_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, BPoint *bp, const float screen_co[2]), void *user_data, eV3DProjTest clip_flag)
#define V3D_PROJ_TEST_CLIP_DEFAULT
void ED_view3d_viewcontext_init_object(ViewContext *vc, Object *obact)
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
static unsigned long seed
const Depsgraph * depsgraph
static int lattice_select_less_exec(bContext *C, wmOperator *)
static bool lattice_deselect_all_multi(const Span< Base * > bases)
static void findnearestLattvert__doClosest(void *user_data, BPoint *bp, const float screen_co[2])
bool ED_lattice_select_pick(bContext *C, const int mval[2], const SelectPick_Params *params)
void LATTICE_OT_select_all(wmOperatorType *ot)
static void bpoint_select_set(BPoint *bp, bool select)
void LATTICE_OT_select_random(wmOperatorType *ot)
bool ED_lattice_deselect_all_multi(bContext *C)
static int lattice_select_random_exec(bContext *C, wmOperator *op)
void LATTICE_OT_select_more(wmOperatorType *ot)
static int lattice_select_more_less(bContext *C, const bool select)
void LATTICE_OT_select_ungrouped(wmOperatorType *ot)
static int lattice_select_all_exec(bContext *C, wmOperator *op)
void LATTICE_OT_select_mirror(wmOperatorType *ot)
static int lattice_select_ungrouped_exec(bContext *C, wmOperator *op)
bool ED_lattice_flags_set(Object *obedit, int flag)
static BPoint * findnearestLattvert(ViewContext *vc, bool select, Base **r_base)
static bool lattice_test_bitmap_uvw(const Lattice *lt, const BLI_bitmap *selpoints, int u, int v, int w, const bool selected)
static int lattice_select_more_exec(bContext *C, wmOperator *)
static void ed_lattice_select_mirrored(Lattice *lt, const int axis, const bool extend)
void LATTICE_OT_select_less(wmOperatorType *ot)
static int lattice_select_mirror_exec(bContext *C, wmOperator *op)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
ccl_device_inline float4 select(const int4 mask, const float4 a, const float4 b)
void base_activate(bContext *C, Base *base)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, 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)
const EnumPropertyItem rna_enum_axis_flag_xyz_items[]
ListBase vertex_group_names
struct MDeformVert * dvert
struct EditLatt * editlatt
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_properties_select_random_seed_increment_get(wmOperator *op)
void WM_operator_properties_select_random(wmOperatorType *ot)
void WM_operator_properties_select_all(wmOperatorType *ot)