Cleanup: long lines
This commit is contained in:
parent
23ccf5767f
commit
63483fe417
|
@ -246,9 +246,10 @@ typedef struct LassoSelectUserData {
|
|||
bool is_changed;
|
||||
} LassoSelectUserData;
|
||||
|
||||
static void view3d_userdata_lassoselect_init(LassoSelectUserData *r_data,
|
||||
ViewContext *vc, const rcti *rect, const int (*mcords)[2],
|
||||
const int moves, const bool select)
|
||||
static void view3d_userdata_lassoselect_init(
|
||||
LassoSelectUserData *r_data,
|
||||
ViewContext *vc, const rcti *rect, const int (*mcords)[2],
|
||||
const int moves, const bool select)
|
||||
{
|
||||
r_data->vc = vc;
|
||||
|
||||
|
@ -323,7 +324,8 @@ static bool edge_inside_rect(const rctf *rect, const float v1[2], const float v2
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void do_lasso_select_pose__doSelectBone(void *userData, struct bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2])
|
||||
static void do_lasso_select_pose__doSelectBone(
|
||||
void *userData, struct bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2])
|
||||
{
|
||||
LassoSelectUserData *data = userData;
|
||||
bArmature *arm = data->vc->obact->data;
|
||||
|
@ -410,8 +412,9 @@ static void object_deselect_all_visible(Scene *scene, View3D *v3d)
|
|||
}
|
||||
}
|
||||
|
||||
static void do_lasso_select_objects(ViewContext *vc, const int mcords[][2], const short moves,
|
||||
const bool extend, const bool select)
|
||||
static void do_lasso_select_objects(
|
||||
ViewContext *vc, const int mcords[][2], const short moves,
|
||||
const bool extend, const bool select)
|
||||
{
|
||||
Base *base;
|
||||
|
||||
|
@ -444,7 +447,8 @@ static void do_lasso_select_mesh__doSelectVert(void *userData, BMVert *eve, cons
|
|||
BM_vert_select_set(data->vc->em->bm, eve, data->select);
|
||||
}
|
||||
}
|
||||
static void do_lasso_select_mesh__doSelectEdge(void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
|
||||
static void do_lasso_select_mesh__doSelectEdge(
|
||||
void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
|
||||
{
|
||||
LassoSelectUserData *data = userData;
|
||||
|
||||
|
@ -536,7 +540,8 @@ static void do_lasso_select_mesh(ViewContext *vc, const int mcords[][2], short m
|
|||
EDBM_selectmode_flush(vc->em);
|
||||
}
|
||||
|
||||
static void do_lasso_select_curve__doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, const float screen_co[2])
|
||||
static void do_lasso_select_curve__doSelect(
|
||||
void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, const float screen_co[2])
|
||||
{
|
||||
LassoSelectUserData *data = userData;
|
||||
Object *obedit = data->vc->obedit;
|
||||
|
@ -611,7 +616,8 @@ static void do_lasso_select_lattice(ViewContext *vc, const int mcords[][2], shor
|
|||
lattice_foreachScreenVert(vc, do_lasso_select_lattice__doSelect, &data, V3D_PROJ_TEST_CLIP_DEFAULT);
|
||||
}
|
||||
|
||||
static void do_lasso_select_armature__doSelectBone(void *userData, struct EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2])
|
||||
static void do_lasso_select_armature__doSelectBone(
|
||||
void *userData, struct EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2])
|
||||
{
|
||||
LassoSelectUserData *data = userData;
|
||||
bArmature *arm = data->vc->obedit->data;
|
||||
|
@ -717,7 +723,8 @@ static void do_lasso_select_meta(ViewContext *vc, const int mcords[][2], short m
|
|||
mball_foreachScreenElem(vc, do_lasso_select_mball__doSelectElem, &data, V3D_PROJ_TEST_CLIP_DEFAULT);
|
||||
}
|
||||
|
||||
static void do_lasso_select_meshobject__doSelectVert(void *userData, MVert *mv, const float screen_co[2], int UNUSED(index))
|
||||
static void do_lasso_select_meshobject__doSelectVert(
|
||||
void *userData, MVert *mv, const float screen_co[2], int UNUSED(index))
|
||||
{
|
||||
LassoSelectUserData *data = userData;
|
||||
|
||||
|
@ -822,9 +829,10 @@ static void do_lasso_select_node(int mcords[][2], short moves, const bool select
|
|||
}
|
||||
#endif
|
||||
|
||||
static void view3d_lasso_select(bContext *C, ViewContext *vc,
|
||||
const int mcords[][2], short moves,
|
||||
bool extend, bool select)
|
||||
static void view3d_lasso_select(
|
||||
bContext *C, ViewContext *vc,
|
||||
const int mcords[][2], short moves,
|
||||
bool extend, bool select)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
|
||||
|
@ -928,7 +936,8 @@ typedef struct SelMenuItemF {
|
|||
static SelMenuItemF object_mouse_select_menu_data[SEL_MENU_SIZE];
|
||||
|
||||
/* special (crappy) operator only for menu select */
|
||||
static const EnumPropertyItem *object_select_menu_enum_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
|
||||
static const EnumPropertyItem *object_select_menu_enum_itemf(
|
||||
bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
|
||||
{
|
||||
EnumPropertyItem *item = NULL, item_tmp = {0};
|
||||
int totitem = 0;
|
||||
|
@ -1403,8 +1412,9 @@ static bool ed_object_select_pick(
|
|||
while (base) {
|
||||
if (BASE_SELECTABLE(v3d, base)) {
|
||||
float screen_co[2];
|
||||
if (ED_view3d_project_float_global(ar, base->object->obmat[3], screen_co,
|
||||
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
|
||||
if (ED_view3d_project_float_global(
|
||||
ar, base->object->obmat[3], screen_co,
|
||||
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
|
||||
{
|
||||
float dist_temp = len_manhattan_v2v2(mval_fl, screen_co);
|
||||
if (base == BASACT) dist_temp += 10.0f;
|
||||
|
@ -1590,8 +1600,9 @@ typedef struct BoxSelectUserData {
|
|||
bool is_changed;
|
||||
} BoxSelectUserData;
|
||||
|
||||
static void view3d_userdata_boxselect_init(BoxSelectUserData *r_data,
|
||||
ViewContext *vc, const rcti *rect, const bool select)
|
||||
static void view3d_userdata_boxselect_init(
|
||||
BoxSelectUserData *r_data,
|
||||
ViewContext *vc, const rcti *rect, const bool select)
|
||||
{
|
||||
r_data->vc = vc;
|
||||
|
||||
|
@ -1704,7 +1715,8 @@ static int do_paintvert_box_select(ViewContext *vc, rcti *rect, bool select, boo
|
|||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static void do_nurbs_box_select__doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, const float screen_co[2])
|
||||
static void do_nurbs_box_select__doSelect(
|
||||
void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, const float screen_co[2])
|
||||
{
|
||||
BoxSelectUserData *data = userData;
|
||||
Object *obedit = data->vc->obedit;
|
||||
|
@ -1782,7 +1794,8 @@ static void do_mesh_box_select__doSelectVert(void *userData, BMVert *eve, const
|
|||
BM_vert_select_set(data->vc->em->bm, eve, data->select);
|
||||
}
|
||||
}
|
||||
static void do_mesh_box_select__doSelectEdge(void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
|
||||
static void do_mesh_box_select__doSelectEdge(
|
||||
void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
|
||||
{
|
||||
BoxSelectUserData *data = userData;
|
||||
|
||||
|
@ -2338,8 +2351,9 @@ typedef struct CircleSelectUserData {
|
|||
bool is_changed;
|
||||
} CircleSelectUserData;
|
||||
|
||||
static void view3d_userdata_circleselect_init(CircleSelectUserData *r_data,
|
||||
ViewContext *vc, const bool select, const int mval[2], const float rad)
|
||||
static void view3d_userdata_circleselect_init(
|
||||
CircleSelectUserData *r_data,
|
||||
ViewContext *vc, const bool select, const int mval[2], const float rad)
|
||||
{
|
||||
r_data->vc = vc;
|
||||
r_data->select = select;
|
||||
|
@ -2362,7 +2376,8 @@ static void mesh_circle_doSelectVert(void *userData, BMVert *eve, const float sc
|
|||
BM_vert_select_set(data->vc->em->bm, eve, data->select);
|
||||
}
|
||||
}
|
||||
static void mesh_circle_doSelectEdge(void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int UNUSED(index))
|
||||
static void mesh_circle_doSelectEdge(
|
||||
void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int UNUSED(index))
|
||||
{
|
||||
CircleSelectUserData *data = userData;
|
||||
|
||||
|
@ -2439,7 +2454,8 @@ static void paint_facesel_circle_select(ViewContext *vc, const bool select, cons
|
|||
}
|
||||
}
|
||||
|
||||
static void paint_vertsel_circle_select_doSelectVert(void *userData, MVert *mv, const float screen_co[2], int UNUSED(index))
|
||||
static void paint_vertsel_circle_select_doSelectVert(
|
||||
void *userData, MVert *mv, const float screen_co[2], int UNUSED(index))
|
||||
{
|
||||
CircleSelectUserData *data = userData;
|
||||
|
||||
|
@ -2480,7 +2496,8 @@ static void paint_vertsel_circle_select(ViewContext *vc, const bool select, cons
|
|||
}
|
||||
|
||||
|
||||
static void nurbscurve_circle_doSelect(void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, const float screen_co[2])
|
||||
static void nurbscurve_circle_doSelect(
|
||||
void *userData, Nurb *UNUSED(nu), BPoint *bp, BezTriple *bezt, int beztindex, const float screen_co[2])
|
||||
{
|
||||
CircleSelectUserData *data = userData;
|
||||
Object *obedit = data->vc->obedit;
|
||||
|
@ -2554,7 +2571,8 @@ static bool pchan_circle_doSelectJoint(void *userData, bPoseChannel *pchan, cons
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
static void do_circle_select_pose__doSelectBone(void *userData, struct bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2])
|
||||
static void do_circle_select_pose__doSelectBone(
|
||||
void *userData, struct bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2])
|
||||
{
|
||||
CircleSelectUserData *data = userData;
|
||||
bArmature *arm = data->vc->obact->data;
|
||||
|
@ -2640,7 +2658,8 @@ static bool armature_circle_doSelectJoint(void *userData, EditBone *ebone, const
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
static void do_circle_select_armature__doSelectBone(void *userData, struct EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2])
|
||||
static void do_circle_select_armature__doSelectBone(
|
||||
void *userData, struct EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2])
|
||||
{
|
||||
CircleSelectUserData *data = userData;
|
||||
bArmature *arm = data->vc->obedit->data;
|
||||
|
@ -2761,8 +2780,9 @@ static bool object_circle_select(ViewContext *vc, const bool select, const int m
|
|||
for (base = FIRSTBASE; base; base = base->next) {
|
||||
if (BASE_SELECTABLE(vc->v3d, base) && ((base->flag & SELECT) != select_flag)) {
|
||||
float screen_co[2];
|
||||
if (ED_view3d_project_float_global(vc->ar, base->object->obmat[3], screen_co,
|
||||
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
|
||||
if (ED_view3d_project_float_global(
|
||||
vc->ar, base->object->obmat[3], screen_co,
|
||||
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
|
||||
{
|
||||
if (len_squared_v2v2(mval_fl, screen_co) <= radius_squared) {
|
||||
ED_base_object_select(base, select ? BA_SELECT : BA_DESELECT);
|
||||
|
|
Loading…
Reference in New Issue