diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-09-05 18:14:40 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-09-08 16:23:21 +0300 |
commit | 173d8edb0bb6e017235ef85a10963f39725c29ef (patch) | |
tree | fc40e57981ed83c0a1bb3532da322843a5571238 /source/blender/makesdna | |
parent | b5fc8f611e3948a19c26d425496d76079506f480 (diff) |
Cleanup: make meaning of base visibility flags more clear
Rename, add comments, and use flag in the depsgraph to ensure the logic
matches.
Differential Revision: https://developer.blender.org/D15883
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_layer_types.h | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/source/blender/makesdna/DNA_layer_types.h b/source/blender/makesdna/DNA_layer_types.h index 345fa141514..2176df7f4ec 100644 --- a/source/blender/makesdna/DNA_layer_types.h +++ b/source/blender/makesdna/DNA_layer_types.h @@ -198,16 +198,44 @@ enum { BASE_HIDDEN = (1 << 8), /* Object is hidden for editing. */ /* Runtime evaluated flags. */ - BASE_VISIBLE_DEPSGRAPH = (1 << 1), /* Object is enabled and visible for the depsgraph. */ - BASE_SELECTABLE = (1 << 2), /* Object can be selected. */ - BASE_FROM_DUPLI = (1 << 3), /* Object comes from duplicator. */ - BASE_VISIBLE_VIEWLAYER = (1 << 4), /* Object is enabled and visible for the viewlayer. */ - BASE_FROM_SET = (1 << 5), /* Object comes from set. */ - BASE_ENABLED_VIEWPORT = (1 << 6), /* Object is enabled in viewport. */ - BASE_ENABLED_RENDER = (1 << 7), /* Object is enabled in final render */ + + /* Object is enabled and potentially visible in a viewport. Layer collection + * visibility, local collection visibility, and local view are not part of this + * and may cause the object to be hidden depending on the 3D viewport settings. + * + * Objects with this flag will be considered visible by the viewport depsgraph + * and be evaluated as a result. + * + * This implies BASE_ENABLED_VIEWPORT. */ + BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT = (1 << 1), + + /* Object can be selected. */ + BASE_SELECTABLE = (1 << 2), + + /* Object comes from a duplicator. */ + BASE_FROM_DUPLI = (1 << 3), + + /* Object is enabled and visible in a viewport with default viewport settings, + * (so without any local view or local collection visibility overrides). Used + * when editors other than the 3D viewport need to know if an object is visible. */ + BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT = (1 << 4), + + /* Object comes from a scene set. */ + BASE_FROM_SET = (1 << 5), + + /* Object is enabled for viewport or final render respectively. Only enabled + * objects can be pulled into the depsgraph for evaluation, either through being + * directly visible, as a dependency of another object, or as part of colliders + * and effectors for physics. */ + BASE_ENABLED_VIEWPORT = (1 << 6), + BASE_ENABLED_RENDER = (1 << 7), + /* BASE_DEPRECATED = (1 << 9), */ - BASE_HOLDOUT = (1 << 10), /* Object masked out from render */ - BASE_INDIRECT_ONLY = (1 << 11), /* Object only contributes indirectly to render */ + + /* Object masked out from render */ + BASE_HOLDOUT = (1 << 10), + /* Object only contributes indirectly to render */ + BASE_INDIRECT_ONLY = (1 << 11), }; /* LayerCollection->flag */ |