Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2018-11-23 19:41:38 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-11-23 20:13:14 +0300
commit9be5b2d23fb46a7da22d16decd044324ed8d4e78 (patch)
treec486399ce5c7c2b46cd9aceca7dfba272d8eb598 /source/blender/editors/transform/transform_conversions.c
parent0d0c79e879fe0c7bf1f1d47968c11578a05db7cf (diff)
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.
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-rw-r--r--source/blender/editors/transform/transform_conversions.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 73f4c05b2f8..e531c65e829 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -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;