64 bool changed_multi =
false;
65 for (
uint base_index = 0; base_index < bases_len; base_index++) {
66 Base *base_iter = bases[base_index];
100 uint objects_len = 0;
103 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
104 Object *obedit = objects[ob_index];
106 int seed_iter =
seed;
114 int elem_map_len = 0;
120 elem_map[elem_map_len++] = bp;
126 const int count_select = elem_map_len * randfac;
127 for (
int i = 0; i < count_select; i++) {
147 ot->
name =
"Select Random";
149 ot->
idname =
"LATTICE_OT_select_random";
172 bool flip_uvw[3] = {
false};
173 flip_uvw[axis] =
true;
185 for (
int i = 0; i < tot; i++) {
209 uint objects_len = 0;
213 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
214 Object *obedit = objects[ob_index];
217 for (
int axis = 0; axis < 3; axis++) {
218 if ((1 << axis) & axis_flag) {
235 ot->
name =
"Select Mirror";
237 ot->
idname =
"LATTICE_OT_select_mirror";
261 if ((u < 0 || u >= lt->
pntsu) || (v < 0 || v >= lt->
pntsv) || (w < 0 || w >= lt->
pntsw)) {
276 bool changed =
false;
280 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
281 Object *obedit = objects[ob_index];
296 for (u = 0; u < lt->
pntsu; u++) {
337 ot->
description =
"Select vertex directly linked to already selected ones";
338 ot->
idname =
"LATTICE_OT_select_more";
352 ot->
description =
"Deselect vertices at the boundary of each selection region";
353 ot->
idname =
"LATTICE_OT_select_less";
374 bool changed =
false;
387 if (bp->
f1 != flag) {
402 uint objects_len = 0;
408 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
409 Object *obedit = objects[ob_index];
418 bool changed_multi =
false;
419 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
420 Object *obedit = objects[ob_index];
424 bool changed =
false;
449 changed_multi =
true;
465 ot->
name =
"(De)select All";
466 ot->
description =
"Change selection of all UVW control points";
467 ot->
idname =
"LATTICE_OT_select_all";
490 bool changed =
false;
494 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
495 Object *obedit = objects[ob_index];
512 for (
a = 0, bp = lt->
def;
a < tot;
a++, bp++, dv++) {
536 ot->
name =
"Select Ungrouped";
537 ot->
idname =
"LATTICE_OT_select_ungrouped";
577 if (dist_test < data->
dist) {
578 data->dist = dist_test;
580 data->is_changed =
true;
596 for (
uint base_index = 0; base_index < bases_len; base_index++) {
597 Base *base = bases[base_index];
598 data.is_changed =
false;
605 if (
data.is_changed) {
619 bool changed =
false;
622 vc.
mval[0] = mval[0];
623 vc.
mval[1] = mval[1];
626 bool found = (
bp !=
NULL);
632 else if (found ||
params->deselect_all) {
634 uint objects_len = 0;
637 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
638 Object *ob = objects[ob_index];
693 return changed || found;
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
void BKE_lattice_bitmap_from_flag(struct Lattice *lt, unsigned int *bitmap, uint8_t flag, bool clear, bool respecthide)
int BKE_lattice_index_flip(struct Lattice *lt, int index, bool flip_u, bool flip_v, bool flip_w)
int BKE_lattice_index_from_uvw(struct Lattice *lt, int u, int v, int w)
bool BKE_lattice_is_any_selected(const struct Lattice *lt)
#define BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, v3d, r_len)
#define BKE_view_layer_array_from_bases_in_edit_mode_unique_data(view_layer, v3d, r_len)
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)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
Object is a sort of wrapper for general info.
void ED_object_base_activate(struct bContext *C, struct Base *base)
bool ED_operator_editlattice(struct bContext *C)
void ED_view3d_viewcontext_init(struct bContext *C, struct ViewContext *vc, struct Depsgraph *depsgraph)
void ED_view3d_viewcontext_init_object(struct ViewContext *vc, struct Object *obact)
void lattice_foreachScreenVert(struct ViewContext *vc, void(*func)(void *userData, struct BPoint *bp, const float screen_co[2]), void *userData, eV3DProjTest clip_flag)
#define V3D_PROJ_TEST_CLIP_DEFAULT
void ED_view3d_init_mats_rv3d(const struct Object *ob, struct RegionView3D *rv3d)
float ED_view3d_select_dist_px(void)
Read Guarded memory(de)allocation.
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
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
bool ED_lattice_deselect_all_multi_ex(struct Base **bases, const uint bases_len)
bool ED_lattice_deselect_all_multi(struct bContext *C)
static int lattice_select_less_exec(bContext *C, wmOperator *UNUSED(op))
static void findnearestLattvert__doClosest(void *user_data, BPoint *bp, const float screen_co[2])
void LATTICE_OT_select_all(wmOperatorType *ot)
static void bpoint_select_set(BPoint *bp, bool select)
void LATTICE_OT_select_random(wmOperatorType *ot)
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)
bool ED_lattice_select_pick(bContext *C, const int mval[2], const struct SelectPick_Params *params)
static bool lattice_test_bitmap_uvw(Lattice *lt, const BLI_bitmap *selpoints, int u, int v, int w, const bool selected)
static int lattice_select_all_exec(bContext *C, wmOperator *op)
void LATTICE_OT_select_mirror(wmOperatorType *ot)
static int lattice_select_more_exec(bContext *C, wmOperator *UNUSED(op))
static int lattice_select_ungrouped_exec(bContext *C, wmOperator *op)
bool ED_lattice_flags_set(Object *obedit, int flag)
static void ed_lattice_select_mirrored(Lattice *lt, const int axis, const bool extend)
static BPoint * findnearestLattvert(ViewContext *vc, bool select, Base **r_base)
void LATTICE_OT_select_less(wmOperatorType *ot)
static int lattice_select_mirror_exec(bContext *C, wmOperator *op)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
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_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int 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
struct ViewLayer * view_layer
struct RegionView3D * rv3d
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) 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)