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:
authorBrecht Van Lommel <brecht@blender.org>2021-08-04 18:46:55 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-08-04 20:18:34 +0300
commit8abf6efcf60fa7f609f38fda0e085d84a72b6dba (patch)
tree29a330737f179f0d632dc76ead0cbd5370fc26b0 /source/blender/blenkernel/intern/layer.c
parent10b9621079823048e73d4677413bc5e59f833dcf (diff)
Cleanup: rename restrict to hide/visibility in Object, Collection, MaskLayer
This makes the internal naming consistent with the public API. And also gives us a visibility_flag rather than restrictflag that can be extended with more flags.
Diffstat (limited to 'source/blender/blenkernel/intern/layer.c')
-rw-r--r--source/blender/blenkernel/intern/layer.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index ae1863f0a47..5940569ba76 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -602,7 +602,7 @@ static bool layer_collection_hidden(ViewLayer *view_layer, LayerCollection *lc)
}
/* Check visiblilty restriction flags */
- if (lc->flag & LAYER_COLLECTION_HIDE || lc->collection->flag & COLLECTION_RESTRICT_VIEWPORT) {
+ if (lc->flag & LAYER_COLLECTION_HIDE || lc->collection->flag & COLLECTION_HIDE_VIEWPORT) {
return true;
}
@@ -1005,17 +1005,17 @@ static void layer_collection_objects_sync(ViewLayer *view_layer,
BLI_addtail(r_lb_new_object_bases, base);
}
- if ((collection_restrict & COLLECTION_RESTRICT_VIEWPORT) == 0) {
+ if ((collection_restrict & COLLECTION_HIDE_VIEWPORT) == 0) {
base->flag_from_collection |= (BASE_ENABLED_VIEWPORT | BASE_VISIBLE_DEPSGRAPH);
if ((layer_restrict & LAYER_COLLECTION_HIDE) == 0) {
base->flag_from_collection |= BASE_VISIBLE_VIEWLAYER;
}
- if (((collection_restrict & COLLECTION_RESTRICT_SELECT) == 0)) {
+ if (((collection_restrict & COLLECTION_HIDE_SELECT) == 0)) {
base->flag_from_collection |= BASE_SELECTABLE;
}
}
- if ((collection_restrict & COLLECTION_RESTRICT_RENDER) == 0) {
+ if ((collection_restrict & COLLECTION_HIDE_RENDER) == 0) {
base->flag_from_collection |= BASE_ENABLED_RENDER;
}
@@ -1150,11 +1150,11 @@ static void layer_collection_sync(ViewLayer *view_layer,
/* We separate restrict viewport and visible view layer because a layer collection can be
* hidden in the view layer yet (locally) visible in a viewport (if it is not restricted). */
- if (child_collection_restrict & COLLECTION_RESTRICT_VIEWPORT) {
- child_layer->runtime_flag |= LAYER_COLLECTION_RESTRICT_VIEWPORT;
+ if (child_collection_restrict & COLLECTION_HIDE_VIEWPORT) {
+ child_layer->runtime_flag |= LAYER_COLLECTION_HIDE_VIEWPORT;
}
- if (((child_layer->runtime_flag & LAYER_COLLECTION_RESTRICT_VIEWPORT) == 0) &&
+ if (((child_layer->runtime_flag & LAYER_COLLECTION_HIDE_VIEWPORT) == 0) &&
((child_layer_restrict & LAYER_COLLECTION_HIDE) == 0)) {
child_layer->runtime_flag |= LAYER_COLLECTION_VISIBLE_VIEW_LAYER;
}
@@ -1333,7 +1333,7 @@ void BKE_main_collection_sync_remap(const Main *bmain)
*/
bool BKE_layer_collection_objects_select(ViewLayer *view_layer, LayerCollection *lc, bool deselect)
{
- if (lc->collection->flag & COLLECTION_RESTRICT_SELECT) {
+ if (lc->collection->flag & COLLECTION_HIDE_SELECT) {
return false;
}
@@ -1369,7 +1369,7 @@ bool BKE_layer_collection_objects_select(ViewLayer *view_layer, LayerCollection
bool BKE_layer_collection_has_selected_objects(ViewLayer *view_layer, LayerCollection *lc)
{
- if (lc->collection->flag & COLLECTION_RESTRICT_SELECT) {
+ if (lc->collection->flag & COLLECTION_HIDE_SELECT) {
return false;
}
@@ -1457,7 +1457,7 @@ bool BKE_object_is_visible_in_viewport(const View3D *v3d, const struct Object *o
{
BLI_assert(v3d != NULL);
- if (ob->restrictflag & OB_RESTRICT_VIEWPORT) {
+ if (ob->visibility_flag & OB_HIDE_VIEWPORT) {
return false;
}
@@ -2146,14 +2146,14 @@ void BKE_base_eval_flags(Base *base)
base->flag |= (base->flag_from_collection & g_base_collection_flags);
/* Apply object restrictions. */
- const int object_restrict = base->object->restrictflag;
- if (object_restrict & OB_RESTRICT_VIEWPORT) {
+ const int object_restrict = base->object->visibility_flag;
+ if (object_restrict & OB_HIDE_VIEWPORT) {
base->flag &= ~BASE_ENABLED_VIEWPORT;
}
- if (object_restrict & OB_RESTRICT_RENDER) {
+ if (object_restrict & OB_HIDE_RENDER) {
base->flag &= ~BASE_ENABLED_RENDER;
}
- if (object_restrict & OB_RESTRICT_SELECT) {
+ if (object_restrict & OB_HIDE_SELECT) {
base->flag &= ~BASE_SELECTABLE;
}