Pass viewport to BASE_ related tests, for viewport view/select restrictions
Note: functions like select all are still not respecting that. I will fix this as part of the local view commit though.
This commit is contained in:
parent
0d0c79e879
commit
9be5b2d23f
|
@ -146,7 +146,7 @@ void BKE_object_matrix_local_get(struct Object *ob, float mat[4][4]);
|
|||
|
||||
bool BKE_object_pose_context_check(const struct Object *ob);
|
||||
struct Object *BKE_object_pose_armature_get(struct Object *ob);
|
||||
struct Object *BKE_object_pose_armature_get_visible(struct Object *ob, struct ViewLayer *view_layer);
|
||||
struct Object *BKE_object_pose_armature_get_visible(struct Object *ob, struct ViewLayer *view_layer, struct View3D *v3d);
|
||||
|
||||
struct Object **BKE_object_pose_array_get_ex(struct ViewLayer *view_layer, unsigned int *r_objects_len, bool unique);
|
||||
struct Object **BKE_object_pose_array_get_unique(struct ViewLayer *view_layer, unsigned int *r_objects_len);
|
||||
|
|
|
@ -1207,13 +1207,13 @@ Object *BKE_object_pose_armature_get(Object *ob)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
Object *BKE_object_pose_armature_get_visible(Object *ob, ViewLayer *view_layer)
|
||||
Object *BKE_object_pose_armature_get_visible(Object *ob, ViewLayer *view_layer, View3D *v3d)
|
||||
{
|
||||
Object *ob_armature = BKE_object_pose_armature_get(ob);
|
||||
if (ob_armature) {
|
||||
Base *base = BKE_view_layer_base_find(view_layer, ob_armature);
|
||||
if (base) {
|
||||
if (BASE_VISIBLE(base)) {
|
||||
if (BASE_VISIBLE(v3d, base)) {
|
||||
return ob_armature;
|
||||
}
|
||||
}
|
||||
|
@ -3612,8 +3612,8 @@ LinkNode *BKE_object_relational_superset(struct ViewLayer *view_layer, eObjectSe
|
|||
obrel_list_add(&links, ob);
|
||||
}
|
||||
else {
|
||||
if ((objectSet == OB_SET_SELECTED && TESTBASELIB_BGMODE(base)) ||
|
||||
(objectSet == OB_SET_VISIBLE && BASE_EDITABLE_BGMODE(base)))
|
||||
if ((objectSet == OB_SET_SELECTED && TESTBASELIB_BGMODE(((View3D *)NULL), base)) ||
|
||||
(objectSet == OB_SET_VISIBLE && BASE_EDITABLE_BGMODE(((View3D *)NULL), base)))
|
||||
{
|
||||
Object *ob = base->object;
|
||||
|
||||
|
@ -3643,7 +3643,7 @@ LinkNode *BKE_object_relational_superset(struct ViewLayer *view_layer, eObjectSe
|
|||
if (includeFilter & (OB_REL_CHILDREN | OB_REL_CHILDREN_RECURSIVE)) {
|
||||
Base *local_base;
|
||||
for (local_base = view_layer->object_bases.first; local_base; local_base = local_base->next) {
|
||||
if (BASE_EDITABLE_BGMODE(local_base)) {
|
||||
if (BASE_EDITABLE_BGMODE(((View3D *)NULL), local_base)) {
|
||||
|
||||
Object *child = local_base->object;
|
||||
if (obrel_list_test(child)) {
|
||||
|
|
|
@ -1726,7 +1726,7 @@ void ED_gpencil_draw_view3d(
|
|||
|
||||
/* check that we have grease-pencil stuff to draw */
|
||||
// XXX: This is the only place that still uses this function
|
||||
bGPdata *gpd = ED_gpencil_data_get_active_v3d(view_layer);
|
||||
bGPdata *gpd = ED_gpencil_data_get_active_v3d(view_layer, v3d);
|
||||
if (gpd == NULL) return;
|
||||
|
||||
/* when rendering to the offscreen buffer we don't want to
|
||||
|
|
|
@ -264,7 +264,7 @@ bool ED_gpencil_data_owner_is_annotation(PointerRNA *owner_ptr)
|
|||
/* -------------------------------------------------------- */
|
||||
|
||||
// XXX: this should be removed... We really shouldn't duplicate logic like this!
|
||||
bGPdata *ED_gpencil_data_get_active_v3d(ViewLayer *view_layer)
|
||||
bGPdata *ED_gpencil_data_get_active_v3d(ViewLayer *view_layer, View3D *v3d)
|
||||
{
|
||||
Base *base = view_layer->basact;
|
||||
bGPdata *gpd = NULL;
|
||||
|
@ -272,7 +272,7 @@ bGPdata *ED_gpencil_data_get_active_v3d(ViewLayer *view_layer)
|
|||
/* We have to make sure active object is actually visible and selected, else we must use default scene gpd,
|
||||
* to be consistent with ED_gpencil_data_get_active's behavior.
|
||||
*/
|
||||
if (base && TESTBASE(base)) {
|
||||
if (base && TESTBASE(v3d, base)) {
|
||||
if (base->object->type == OB_GPENCIL)
|
||||
gpd = base->object->data;
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ struct bGPdata *ED_gpencil_data_get_active_direct(
|
|||
bool ED_gpencil_data_owner_is_annotation(struct PointerRNA *owner_ptr);
|
||||
|
||||
/* 3D View */
|
||||
struct bGPdata *ED_gpencil_data_get_active_v3d(struct ViewLayer *view_layer);
|
||||
struct bGPdata *ED_gpencil_data_get_active_v3d(struct ViewLayer *view_layer, struct View3D *v3d);
|
||||
|
||||
bool ED_gpencil_has_keyframe_v3d(struct Scene *scene, struct Object *ob, int cfra);
|
||||
|
||||
|
|
|
@ -894,7 +894,7 @@ static void copy_texture_space(Object *to, Object *ob)
|
|||
}
|
||||
|
||||
/* UNUSED, keep in case we want to copy functionality for use elsewhere */
|
||||
static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, short event)
|
||||
static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, short event)
|
||||
{
|
||||
Object *ob;
|
||||
Base *base;
|
||||
|
@ -918,7 +918,7 @@ static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, short ev
|
|||
|
||||
for (base = FIRSTBASE(view_layer); base; base = base->next) {
|
||||
if (base != BASACT(view_layer)) {
|
||||
if (TESTBASELIB(base)) {
|
||||
if (TESTBASELIB(v3d, base)) {
|
||||
DEG_id_tag_update(&base->object->id, OB_RECALC_DATA);
|
||||
|
||||
if (event == 1) { /* loc */
|
||||
|
@ -1111,7 +1111,7 @@ static void copy_attr(Main *bmain, Scene *scene, ViewLayer *view_layer, short ev
|
|||
}
|
||||
}
|
||||
|
||||
static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, ViewLayer *view_layer, Object *obedit)
|
||||
static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, Object *obedit)
|
||||
{
|
||||
Object *ob;
|
||||
short event;
|
||||
|
@ -1165,7 +1165,7 @@ static void UNUSED_FUNCTION(copy_attr_menu) (Main *bmain, Scene *scene, ViewLaye
|
|||
event = pupmenu(str);
|
||||
if (event <= 0) return;
|
||||
|
||||
copy_attr(bmain, scene, view_layer, event);
|
||||
copy_attr(bmain, scene, view_layer, v3d, event);
|
||||
}
|
||||
|
||||
/* ******************* force field toggle operator ***************** */
|
||||
|
|
|
@ -755,6 +755,7 @@ static bool select_grouped_children(bContext *C, Object *ob, const bool recursiv
|
|||
static bool select_grouped_parent(bContext *C) /* Makes parent active and de-selected OBACT */
|
||||
{
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
Base *baspar, *basact = CTX_data_active_base(C);
|
||||
bool changed = false;
|
||||
|
||||
|
@ -765,7 +766,7 @@ static bool select_grouped_parent(bContext *C) /* Makes parent active and de-sel
|
|||
baspar = BKE_view_layer_base_find(view_layer, basact->object->parent);
|
||||
|
||||
/* can be NULL if parent in other scene */
|
||||
if (baspar && BASE_SELECTABLE(baspar)) {
|
||||
if (baspar && BASE_SELECTABLE(v3d, baspar)) {
|
||||
ED_object_base_select(baspar, BA_SELECT);
|
||||
ED_object_base_activate(C, baspar);
|
||||
changed = true;
|
||||
|
@ -823,6 +824,7 @@ static bool select_grouped_collection(bContext *C, Object *ob) /* Select object
|
|||
static bool select_grouped_object_hooks(bContext *C, Object *ob)
|
||||
{
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
|
||||
bool changed = false;
|
||||
Base *base;
|
||||
|
@ -834,7 +836,7 @@ static bool select_grouped_object_hooks(bContext *C, Object *ob)
|
|||
hmd = (HookModifierData *) md;
|
||||
if (hmd->object) {
|
||||
base = BKE_view_layer_base_find(view_layer, hmd->object);
|
||||
if (base && ((base->flag & BASE_SELECTED) == 0) && (BASE_SELECTABLE(base))) {
|
||||
if (base && ((base->flag & BASE_SELECTED) == 0) && (BASE_SELECTABLE(v3d, base))) {
|
||||
ED_object_base_select(base, BA_SELECT);
|
||||
changed = true;
|
||||
}
|
||||
|
|
|
@ -254,6 +254,7 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3])
|
|||
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ViewLayer *view_layer_eval = DEG_get_evaluated_view_layer(depsgraph);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
Object *ob_act_eval = OBACT(view_layer_eval);
|
||||
Object *ob_act = DEG_get_original_object(ob_act_eval);
|
||||
|
||||
|
@ -298,7 +299,7 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3])
|
|||
|
||||
zero_v3(select_center);
|
||||
for (base_eval = FIRSTBASE(view_layer_eval); base_eval; base_eval = base_eval->next) {
|
||||
if (TESTBASE(base_eval)) {
|
||||
if (TESTBASE(v3d, base_eval)) {
|
||||
/* use the boundbox if we can */
|
||||
Object *ob_eval = base_eval->object;
|
||||
|
||||
|
@ -2722,7 +2723,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op)
|
|||
}
|
||||
|
||||
for (base_eval = view_layer_eval->object_bases.first; base_eval; base_eval = base_eval->next) {
|
||||
if (BASE_VISIBLE(base_eval)) {
|
||||
if (BASE_VISIBLE(v3d, base_eval)) {
|
||||
changed = true;
|
||||
|
||||
Object *ob = DEG_get_original_object(base_eval->object);
|
||||
|
@ -2819,7 +2820,7 @@ static int viewselected_exec(bContext *C, wmOperator *op)
|
|||
/* this is weak code this way, we should make a generic active/selection callback interface once... */
|
||||
Base *base_eval;
|
||||
for (base_eval = view_layer_eval->object_bases.first; base_eval; base_eval = base_eval->next) {
|
||||
if (TESTBASELIB(base_eval)) {
|
||||
if (TESTBASELIB(v3d, base_eval)) {
|
||||
if (base_eval->object->type == OB_ARMATURE)
|
||||
if (base_eval->object->mode & OB_MODE_POSE)
|
||||
break;
|
||||
|
@ -2880,7 +2881,7 @@ static int viewselected_exec(bContext *C, wmOperator *op)
|
|||
else {
|
||||
Base *base_eval;
|
||||
for (base_eval = FIRSTBASE(view_layer_eval); base_eval; base_eval = base_eval->next) {
|
||||
if (TESTBASE(base_eval)) {
|
||||
if (TESTBASE(v3d, base_eval)) {
|
||||
|
||||
if (skip_camera && base_eval->object == v3d->camera) {
|
||||
continue;
|
||||
|
|
|
@ -405,12 +405,12 @@ static void do_lasso_tag_pose(ViewContext *vc, Object *ob, const int mcords[][2]
|
|||
pose_foreachScreenBone(&vc_tmp, do_lasso_select_pose__do_tag, &data, V3D_PROJ_TEST_CLIP_DEFAULT);
|
||||
}
|
||||
|
||||
static void object_deselect_all_visible(ViewLayer *view_layer)
|
||||
static void object_deselect_all_visible(ViewLayer *view_layer, View3D *v3d)
|
||||
{
|
||||
Base *base;
|
||||
|
||||
for (base = view_layer->object_bases.first; base; base = base->next) {
|
||||
if (BASE_SELECTABLE(base)) {
|
||||
if (BASE_SELECTABLE(v3d, base)) {
|
||||
ED_object_base_select(base, BA_DESELECT);
|
||||
}
|
||||
}
|
||||
|
@ -420,15 +420,16 @@ static void do_lasso_select_objects(
|
|||
ViewContext *vc, const int mcords[][2], const short moves,
|
||||
const eSelectOp sel_op)
|
||||
{
|
||||
View3D *v3d = vc->v3d;
|
||||
Base *base;
|
||||
|
||||
if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
|
||||
object_deselect_all_visible(vc->view_layer);
|
||||
object_deselect_all_visible(vc->view_layer, vc->v3d);
|
||||
}
|
||||
|
||||
bool changed = false;
|
||||
for (base = vc->view_layer->object_bases.first; base; base = base->next) {
|
||||
if (BASE_SELECTABLE(base)) { /* use this to avoid un-needed lasso lookups */
|
||||
if (BASE_SELECTABLE(v3d, base)) { /* use this to avoid un-needed lasso lookups */
|
||||
const bool is_select = base->flag & BASE_SELECTED;
|
||||
const bool is_inside = (
|
||||
(ED_view3d_project_base(vc->ar, base) == V3D_PROJ_RET_OK) &&
|
||||
|
@ -1202,8 +1203,6 @@ static Base *object_mouse_select_menu(
|
|||
short baseCount = 0;
|
||||
bool ok;
|
||||
LinkNode *linklist = NULL;
|
||||
const int object_type_exclude_select = (
|
||||
vc->v3d->object_type_exclude_viewport | vc->v3d->object_type_exclude_select);
|
||||
|
||||
/* handle base->object->select_color */
|
||||
CTX_DATA_BEGIN (C, Base *, base, selectable_bases)
|
||||
|
@ -1221,9 +1220,6 @@ static Base *object_mouse_select_menu(
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (object_type_exclude_select & (1 << base->object->type)) {
|
||||
continue;
|
||||
}
|
||||
const int dist = 15 * U.pixelsize;
|
||||
if (ED_view3d_project_base(vc->ar, base) == V3D_PROJ_RET_OK) {
|
||||
const int delta_px[2] = {base->sx - mval[0], base->sy - mval[1]};
|
||||
|
@ -1427,6 +1423,7 @@ static Base *mouse_select_eval_buffer(
|
|||
Base *startbase, bool has_bones, bool do_nearest)
|
||||
{
|
||||
ViewLayer *view_layer = vc->view_layer;
|
||||
View3D *v3d = vc->v3d;
|
||||
Base *base, *basact = NULL;
|
||||
int a;
|
||||
|
||||
|
@ -1460,7 +1457,7 @@ static Base *mouse_select_eval_buffer(
|
|||
|
||||
base = FIRSTBASE(view_layer);
|
||||
while (base) {
|
||||
if (BASE_SELECTABLE(base)) {
|
||||
if (BASE_SELECTABLE(v3d, base)) {
|
||||
if (base->object->select_color == selcol) break;
|
||||
}
|
||||
base = base->next;
|
||||
|
@ -1479,7 +1476,7 @@ static Base *mouse_select_eval_buffer(
|
|||
if (base == startbase) break;
|
||||
}
|
||||
|
||||
if (BASE_SELECTABLE(base)) {
|
||||
if (BASE_SELECTABLE(v3d, base)) {
|
||||
for (a = 0; a < hits; a++) {
|
||||
if (has_bones) {
|
||||
/* skip non-bone objects */
|
||||
|
@ -1573,6 +1570,7 @@ static bool ed_object_select_pick(
|
|||
ARegion *ar = CTX_wm_region(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
Base *base, *startbase = NULL, *basact = NULL, *oldbasact = BASACT(view_layer);
|
||||
const eObjectMode object_mode = oldbasact ? oldbasact->object->mode : OB_MODE_OBJECT;
|
||||
bool is_obedit;
|
||||
|
@ -1606,13 +1604,9 @@ static bool ed_object_select_pick(
|
|||
basact = object_mouse_select_menu(C, &vc, NULL, 0, mval, toggle);
|
||||
}
|
||||
else {
|
||||
const int object_type_exclude_select = (
|
||||
vc.v3d->object_type_exclude_viewport | vc.v3d->object_type_exclude_select);
|
||||
base = startbase;
|
||||
while (base) {
|
||||
if (BASE_SELECTABLE(base) &&
|
||||
((object_type_exclude_select & (1 << base->object->type)) == 0))
|
||||
{
|
||||
if (BASE_SELECTABLE(v3d, base)) {
|
||||
float screen_co[2];
|
||||
if (ED_view3d_project_float_global(
|
||||
ar, base->object->obmat[3], screen_co,
|
||||
|
@ -1800,7 +1794,7 @@ static bool ed_object_select_pick(
|
|||
ED_object_base_select(basact, BA_SELECT);
|
||||
}
|
||||
/* also prevent making it active on mouse selection */
|
||||
else if (BASE_SELECTABLE(basact)) {
|
||||
else if (BASE_SELECTABLE(v3d, basact)) {
|
||||
if (extend) {
|
||||
ED_object_base_select(basact, BA_SELECT);
|
||||
}
|
||||
|
@ -2372,6 +2366,7 @@ static int opengl_bone_select_buffer_cmp(const void *sel_a_p, const void *sel_b_
|
|||
|
||||
static int do_object_box_select(bContext *C, ViewContext *vc, rcti *rect, const eSelectOp sel_op)
|
||||
{
|
||||
View3D *v3d = vc->v3d;
|
||||
bool changed = false;
|
||||
int totobj = MAXPICKBUF; /* XXX solve later */
|
||||
|
||||
|
@ -2390,7 +2385,7 @@ static int do_object_box_select(bContext *C, ViewContext *vc, rcti *rect, const
|
|||
BLI_array_declare(bases);
|
||||
|
||||
if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
|
||||
object_deselect_all_visible(vc->view_layer);
|
||||
object_deselect_all_visible(vc->view_layer, vc->v3d);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
|
@ -2399,7 +2394,7 @@ static int do_object_box_select(bContext *C, ViewContext *vc, rcti *rect, const
|
|||
}
|
||||
|
||||
for (Base *base = vc->view_layer->object_bases.first; base; base = base->next) {
|
||||
if (BASE_SELECTABLE(base)) {
|
||||
if (BASE_SELECTABLE(v3d, base)) {
|
||||
if ((base->object->select_color & 0x0000FFFF) != 0) {
|
||||
BLI_array_append(bases, base);
|
||||
}
|
||||
|
@ -2416,7 +2411,7 @@ static int do_object_box_select(bContext *C, ViewContext *vc, rcti *rect, const
|
|||
}
|
||||
|
||||
for (Base *base = vc->view_layer->object_bases.first; base && hits; base = base->next) {
|
||||
if (BASE_SELECTABLE(base)) {
|
||||
if (BASE_SELECTABLE(v3d, base)) {
|
||||
const bool is_select = base->flag & BASE_SELECTED;
|
||||
const bool is_inside = base->object->id.tag & LIB_TAG_DOIT;
|
||||
const int sel_op_result = ED_select_op_action_deselected(sel_op, is_select, is_inside);
|
||||
|
@ -3222,6 +3217,8 @@ static void obedit_circle_select(
|
|||
static bool object_circle_select(ViewContext *vc, const bool select, const int mval[2], float rad)
|
||||
{
|
||||
ViewLayer *view_layer = vc->view_layer;
|
||||
View3D *v3d = vc->v3d;
|
||||
|
||||
const float radius_squared = rad * rad;
|
||||
const float mval_fl[2] = {mval[0], mval[1]};
|
||||
bool changed = false;
|
||||
|
@ -3230,7 +3227,7 @@ static bool object_circle_select(ViewContext *vc, const bool select, const int m
|
|||
|
||||
Base *base;
|
||||
for (base = FIRSTBASE(view_layer); base; base = base->next) {
|
||||
if (BASE_SELECTABLE(base) && ((base->flag & BASE_SELECTED) != select_flag)) {
|
||||
if (BASE_SELECTABLE(v3d, base) && ((base->flag & BASE_SELECTED) != select_flag)) {
|
||||
float screen_co[2];
|
||||
if (ED_view3d_project_float_global(
|
||||
vc->ar, base->object->obmat[3], screen_co,
|
||||
|
|
|
@ -5800,6 +5800,7 @@ static void set_trans_object_base_flags(TransInfo *t)
|
|||
{
|
||||
Main *bmain = CTX_data_main(t->context);
|
||||
ViewLayer *view_layer = t->view_layer;
|
||||
View3D *v3d = t->view;
|
||||
Scene *scene = t->scene;
|
||||
Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true);
|
||||
/* NOTE: if Base selected and has parent selected:
|
||||
|
@ -5818,7 +5819,7 @@ static void set_trans_object_base_flags(TransInfo *t)
|
|||
/* Traverse all bases and set all possible flags. */
|
||||
for (Base *base = view_layer->object_bases.first; base; base = base->next) {
|
||||
base->flag_legacy &= ~BA_WAS_SEL;
|
||||
if (TESTBASELIB_BGMODE(base)) {
|
||||
if (TESTBASELIB_BGMODE(v3d, base)) {
|
||||
Object *ob = base->object;
|
||||
Object *parsel = ob->parent;
|
||||
/* If parent selected, deselect. */
|
||||
|
@ -5826,7 +5827,7 @@ static void set_trans_object_base_flags(TransInfo *t)
|
|||
if (parsel->base_flag & BASE_SELECTED) {
|
||||
Base *parbase = BKE_view_layer_base_find(view_layer, parsel);
|
||||
if (parbase != NULL) { /* in rare cases this can fail */
|
||||
if (TESTBASELIB_BGMODE(parbase)) {
|
||||
if (TESTBASELIB_BGMODE(v3d, parbase)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -5873,6 +5874,7 @@ static int count_proportional_objects(TransInfo *t)
|
|||
{
|
||||
int total = 0;
|
||||
ViewLayer *view_layer = t->view_layer;
|
||||
View3D *v3d = t->view;
|
||||
Scene *scene = t->scene;
|
||||
Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true);
|
||||
/* Clear all flags we need. It will be used to detect dependencies. */
|
||||
|
@ -5883,7 +5885,7 @@ static int count_proportional_objects(TransInfo *t)
|
|||
{
|
||||
/* Mark all parents. */
|
||||
for (Base *base = view_layer->object_bases.first; base; base = base->next) {
|
||||
if (TESTBASELIB_BGMODE(base)) {
|
||||
if (TESTBASELIB_BGMODE(v3d, base)) {
|
||||
Object *parent = base->object->parent;
|
||||
/* flag all parents */
|
||||
while (parent != NULL) {
|
||||
|
@ -5897,7 +5899,7 @@ static int count_proportional_objects(TransInfo *t)
|
|||
/* all base not already selected or marked that is editable */
|
||||
if ((base->object->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
|
||||
(base->flag & BASE_SELECTED) == 0 &&
|
||||
(BASE_EDITABLE_BGMODE(base)))
|
||||
(BASE_EDITABLE_BGMODE(v3d, base)))
|
||||
{
|
||||
mark_children(base->object);
|
||||
}
|
||||
|
@ -5911,7 +5913,7 @@ static int count_proportional_objects(TransInfo *t)
|
|||
*/
|
||||
if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
|
||||
(base->flag & BASE_SELECTED) == 0 &&
|
||||
(BASE_EDITABLE_BGMODE(base)))
|
||||
(BASE_EDITABLE_BGMODE(v3d, base)))
|
||||
{
|
||||
flush_trans_object_base_deps_flag(depsgraph, ob);
|
||||
total += 1;
|
||||
|
@ -6916,6 +6918,7 @@ static void createTransObject(bContext *C, TransInfo *t)
|
|||
|
||||
if (is_prop_edit) {
|
||||
ViewLayer *view_layer = t->view_layer;
|
||||
View3D *v3d = t->view;
|
||||
Base *base;
|
||||
|
||||
for (base = view_layer->object_bases.first; base; base = base->next) {
|
||||
|
@ -6924,7 +6927,7 @@ static void createTransObject(bContext *C, TransInfo *t)
|
|||
/* if base is not selected, not a parent of selection or not a child of selection and it is editable */
|
||||
if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
|
||||
(base->flag & BASE_SELECTED) == 0 &&
|
||||
BASE_EDITABLE_BGMODE(base))
|
||||
BASE_EDITABLE_BGMODE(v3d, base))
|
||||
{
|
||||
td->protectflag = ob->protectflag;
|
||||
td->ext = tx;
|
||||
|
@ -8694,7 +8697,8 @@ void createTransData(bContext *C, TransInfo *t)
|
|||
if (ob_armature && ob_armature->mode & OB_MODE_POSE) {
|
||||
Base *base_arm = BKE_view_layer_base_find(t->view_layer, ob_armature);
|
||||
if (base_arm) {
|
||||
if (BASE_VISIBLE(base_arm)) {
|
||||
View3D *v3d = t->view;
|
||||
if (BASE_VISIBLE(v3d, base_arm)) {
|
||||
Object *objects[1];
|
||||
objects[0] = ob_armature;
|
||||
uint objects_len = 1;
|
||||
|
|
|
@ -722,8 +722,8 @@ int ED_transform_calc_gizmo_stats(
|
|||
Scene *scene = CTX_data_scene(C);
|
||||
Depsgraph *depsgraph = CTX_data_depsgraph(C);
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
View3D *v3d = sa->spacedata.first;
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
RegionView3D *rv3d = ar->regiondata;
|
||||
Base *base;
|
||||
Object *ob = OBACT(view_layer);
|
||||
|
@ -1128,7 +1128,7 @@ int ED_transform_calc_gizmo_stats(
|
|||
if (base && ((base->flag & BASE_SELECTED) == 0)) ob = NULL;
|
||||
|
||||
for (base = view_layer->object_bases.first; base; base = base->next) {
|
||||
if (!TESTBASELIB(base)) {
|
||||
if (!TESTBASELIB(v3d, base)) {
|
||||
continue;
|
||||
}
|
||||
if (ob == NULL) {
|
||||
|
|
|
@ -588,6 +588,7 @@ static unsigned int bm_mesh_faces_select_get_n(BMesh *bm, BMVert **elems, const
|
|||
int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3], const short around)
|
||||
{
|
||||
ViewLayer *view_layer = CTX_data_view_layer(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
Base *base;
|
||||
Object *ob = OBACT(view_layer);
|
||||
|
@ -839,7 +840,6 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3
|
|||
}
|
||||
}
|
||||
else {
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
const bool use_handle = (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_HANDLES) != 0;
|
||||
|
||||
for (nu = nurbs->first; nu; nu = nu->next) {
|
||||
|
@ -1090,7 +1090,7 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3
|
|||
/* first selected */
|
||||
ob = NULL;
|
||||
for (base = view_layer->object_bases.first; base; base = base->next) {
|
||||
if (TESTBASELIB(base)) {
|
||||
if (TESTBASELIB(v3d, base)) {
|
||||
ob = base->object;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -205,12 +205,13 @@ static void iter_snap_objects(
|
|||
void *data)
|
||||
{
|
||||
ViewLayer *view_layer = DEG_get_input_view_layer(sctx->depsgraph);
|
||||
const View3D *v3d = sctx->v3d_data.v3d;
|
||||
const eSnapSelect snap_select = params->snap_select;
|
||||
const bool use_object_edit_cage = params->use_object_edit_cage;
|
||||
|
||||
Base *base_act = view_layer->basact;
|
||||
for (Base *base = view_layer->object_bases.first; base != NULL; base = base->next) {
|
||||
if ((BASE_VISIBLE(base)) && (base->flag_legacy & BA_SNAP_FIX_DEPS_FIASCO) == 0 &&
|
||||
if ((BASE_VISIBLE(v3d, base)) && (base->flag_legacy & BA_SNAP_FIX_DEPS_FIASCO) == 0 &&
|
||||
!((snap_select == SNAP_NOT_SELECTED && ((base->flag & BASE_SELECTED) || (base->flag_legacy & BA_WAS_SEL))) ||
|
||||
(snap_select == SNAP_NOT_ACTIVE && base == base_act)))
|
||||
{
|
||||
|
|
|
@ -1805,24 +1805,31 @@ extern const char *RE_engine_id_CYCLES;
|
|||
#define MINAFRAMEF -1048574.0f
|
||||
|
||||
/* deprecate this! */
|
||||
#define TESTBASE(base) ( \
|
||||
#define TESTBASE(v3d, base) ( \
|
||||
(((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0) && \
|
||||
(((base)->flag & BASE_SELECTED) != 0) && \
|
||||
(((base)->flag & BASE_VISIBLE) != 0))
|
||||
#define TESTBASELIB(base) ( \
|
||||
#define TESTBASELIB(v3d, base) ( \
|
||||
(((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0) && \
|
||||
(((base)->flag & BASE_SELECTED) != 0) && \
|
||||
((base)->object->id.lib == NULL) && \
|
||||
(((base)->flag & BASE_VISIBLE) != 0))
|
||||
#define TESTBASELIB_BGMODE(base) ( \
|
||||
#define TESTBASELIB_BGMODE(v3d, base) ( \
|
||||
((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0)) && \
|
||||
(((base)->flag & BASE_SELECTED) != 0) && \
|
||||
((base)->object->id.lib == NULL) && \
|
||||
(((base)->flag & BASE_VISIBLE) != 0))
|
||||
#define BASE_EDITABLE_BGMODE(base) ( \
|
||||
#define BASE_EDITABLE_BGMODE(v3d, base) ( \
|
||||
((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0)) && \
|
||||
((base)->object->id.lib == NULL) && \
|
||||
(((base)->flag & BASE_VISIBLE) != 0))
|
||||
#define BASE_SELECTABLE(base) \
|
||||
(((base)->flag & BASE_SELECTABLE) != 0)
|
||||
#define BASE_VISIBLE(base) ( \
|
||||
((base)->flag & BASE_VISIBLE) != 0)
|
||||
#define BASE_SELECTABLE(v3d, base) ( \
|
||||
(((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0) && \
|
||||
(((1 << (base)->object->type) & (v3d)->object_type_exclude_select) == 0) && \
|
||||
(((base)->flag & BASE_SELECTABLE) != 0))
|
||||
#define BASE_VISIBLE(v3d, base) ( \
|
||||
(((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0) && \
|
||||
(((base)->flag & BASE_VISIBLE) != 0))
|
||||
|
||||
#define FIRSTBASE(_view_layer) ((_view_layer)->object_bases.first)
|
||||
#define LASTBASE(_view_layer) ((_view_layer)->object_bases.last)
|
||||
|
|
Loading…
Reference in New Issue