|
Blender
V2.93
|
#include <string.h>#include "BLI_listbase.h"#include "BLI_string.h"#include "BLI_string_utf8.h"#include "BLI_string_utils.h"#include "BLI_threads.h"#include "BLT_translation.h"#include "BKE_animsys.h"#include "BKE_collection.h"#include "BKE_freestyle.h"#include "BKE_idprop.h"#include "BKE_layer.h"#include "BKE_lib_id.h"#include "BKE_main.h"#include "BKE_node.h"#include "BKE_object.h"#include "DNA_ID.h"#include "DNA_collection_types.h"#include "DNA_layer_types.h"#include "DNA_node_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "DNA_space_types.h"#include "DNA_view3d_types.h"#include "DNA_windowmanager_types.h"#include "DNA_workspace_types.h"#include "DEG_depsgraph.h"#include "DEG_depsgraph_debug.h"#include "DEG_depsgraph_query.h"#include "DRW_engine.h"#include "RE_engine.h"#include "MEM_guardedalloc.h"#include "BLO_read_write.h"Go to the source code of this file.
Classes | |
| struct | LayerObjectBaseIteratorData |
Macros | |
| #define | DNA_DEPRECATED_ALLOW |
Variables | |
| static const short | g_base_collection_flags |
Private Iterator Helpers | |
| typedef struct LayerObjectBaseIteratorData | LayerObjectBaseIteratorData |
| static void | object_bases_iterator_next (BLI_Iterator *iter, const int flag) |
| static bool | object_bases_iterator_is_valid (const View3D *v3d, Base *base, const int flag) |
| static void | object_bases_iterator_begin (BLI_Iterator *iter, void *data_in_v, const int flag) |
| static void | object_bases_iterator_end (BLI_Iterator *iter) |
| static void | objects_iterator_begin (BLI_Iterator *iter, void *data_in, const int flag) |
| static void | objects_iterator_next (BLI_Iterator *iter, const int flag) |
| static void | objects_iterator_end (BLI_Iterator *iter) |
| typedef struct LayerObjectBaseIteratorData LayerObjectBaseIteratorData |
|
static |
Definition at line 1760 of file layer.c.
References data, Object::mode, Base::object, and Object::type.
Referenced by BKE_view_layer_bases_in_mode_iterator_begin(), and BKE_view_layer_bases_in_mode_iterator_next().
| void BKE_base_eval_flags | ( | Base * | base | ) |
Definition at line 1831 of file layer.c.
References BASE_ENABLED_RENDER, BASE_ENABLED_VIEWPORT, BASE_HIDDEN, BASE_SELECTABLE, BASE_SELECTED, BASE_VISIBLE_DEPSGRAPH, BASE_VISIBLE_VIEWLAYER, Base::flag, Base::flag_from_collection, g_base_collection_flags, OB_RESTRICT_RENDER, OB_RESTRICT_SELECT, OB_RESTRICT_VIEWPORT, Base::object, and Object::restrictflag.
Referenced by BKE_layer_collection_sync(), and BKE_object_eval_eval_base_flags().
Definition at line 1128 of file layer.c.
References BASE_VISIBLE_DEPSGRAPH, BASE_VISIBLE_VIEWLAYER, Base::flag, View3D::flag, Base::local_collections_bits, View3D::local_collections_uuid, Base::local_view_bits, View3D::local_view_uuid, View3D::localvd, NULL, Base::object, View3D::object_type_exclude_viewport, Object::type, and V3D_LOCAL_COLLECTIONS.
Referenced by BKE_view_layer_bases_in_mode_iterator_begin(), and BKE_view_layer_bases_in_mode_iterator_next().
Definition at line 1110 of file layer.c.
References BASE_HIDDEN, BKE_layer_collection_sync(), Base::flag, LISTBASE_FOREACH, ViewLayer::object_bases, and scene.
| bool BKE_layer_collection_activate | ( | ViewLayer * | view_layer, |
| LayerCollection * | lc | ||
| ) |
Definition at line 638 of file layer.c.
References ViewLayer::active_collection, LayerCollection::flag, and LAYER_COLLECTION_EXCLUDE.
Referenced by BKE_layer_collection_isolate_global(), tree_element_layer_collection_activate(), and tree_element_master_collection_activate().
| LayerCollection* BKE_layer_collection_activate_parent | ( | ViewLayer * | view_layer, |
| LayerCollection * | lc | ||
| ) |
Activate first parent collection
Definition at line 651 of file layer.c.
References ViewLayer::active_collection, BKE_layer_collection_activate_parent(), BKE_layer_collection_first_from_scene_collection(), CollectionParent::collection, LayerCollection::collection, ListBase::first, layer_collection_hidden(), ViewLayer::layer_collections, NULL, and Collection::parents.
Referenced by BKE_layer_collection_activate_parent(), BKE_layer_collection_sync(), collection_instance_add_exec(), and collection_instance_exec().
| int BKE_layer_collection_count | ( | ViewLayer * | view_layer | ) |
Get the total number of collections (including all the nested collections)
Definition at line 692 of file layer.c.
References collection_count(), and ViewLayer::layer_collections.
| int BKE_layer_collection_findindex | ( | ViewLayer * | view_layer, |
| const LayerCollection * | lc | ||
| ) |
Return -1 if not found
Definition at line 722 of file layer.c.
References index_from_collection(), and ViewLayer::layer_collections.
| LayerCollection* BKE_layer_collection_first_from_scene_collection | ( | ViewLayer * | view_layer, |
| const Collection * | collection | ||
| ) |
Return the first matching LayerCollection in the ViewLayer for the Collection.
Definition at line 1503 of file layer.c.
References find_layer_collection_by_scene_collection(), ViewLayer::layer_collections, LISTBASE_FOREACH, and NULL.
Referenced by BKE_layer_collection_activate_parent(), BKE_view_layer_has_collection(), and layer_collection_hidden().
| LayerCollection* BKE_layer_collection_from_index | ( | ViewLayer * | view_layer, |
| const int | index | ||
| ) |
Get the collection for a given index
Definition at line 621 of file layer.c.
References collection_from_index(), and ViewLayer::layer_collections.
Referenced by object_hide_collection_exec().
| LayerCollection* BKE_layer_collection_get_active | ( | ViewLayer * | view_layer | ) |
Get the active collection
Definition at line 630 of file layer.c.
References ViewLayer::active_collection.
Referenced by add_collections_to_scene(), add_loose_object_data_to_scene(), add_loose_objects_to_scene(), bc_add_object(), BKE_object_add(), BKE_object_add_for_data(), collection_instance_add_exec(), collection_instance_exec(), CTX_data_layer_collection(), import_endjob(), and object_add_duplicate_internal().
| bool BKE_layer_collection_has_layer_collection | ( | LayerCollection * | lc_parent, |
| LayerCollection * | lc_child | ||
| ) |
Definition at line 1092 of file layer.c.
References BKE_layer_collection_has_layer_collection(), LayerCollection::layer_collections, and LISTBASE_FOREACH.
Referenced by BKE_layer_collection_has_layer_collection(), BKE_layer_collection_isolate_global(), BKE_layer_collection_isolate_local(), and outliner_collection_isolate_flag().
| bool BKE_layer_collection_has_selected_objects | ( | ViewLayer * | view_layer, |
| LayerCollection * | lc | ||
| ) |
Definition at line 1067 of file layer.c.
References BASE_SELECTED, BASE_VISIBLE_DEPSGRAPH, BKE_layer_collection_has_selected_objects(), BKE_view_layer_base_find(), LayerCollection::collection, COLLECTION_RESTRICT_SELECT, Collection::flag, Base::flag, LayerCollection::flag, Collection::gobject, LAYER_COLLECTION_EXCLUDE, LayerCollection::layer_collections, and LISTBASE_FOREACH.
Referenced by BKE_layer_collection_has_selected_objects(), and ED_collection_hide_menu_draw().
| void BKE_layer_collection_isolate_global | ( | Scene * | scene, |
| ViewLayer * | view_layer, | ||
| LayerCollection * | lc, | ||
| bool | extend | ||
| ) |
Isolate the collection - hide all other collections but this one. Make sure to show all the direct parents and all children of the layer collection as well. When extending we simply show the collections and its direct family.
If the collection or any of its parents is disabled, make it enabled. Don't change the children disable state though.
Definition at line 1206 of file layer.c.
References BKE_layer_collection_activate(), BKE_layer_collection_has_layer_collection(), BKE_layer_collection_sync(), ListBase::first, LayerCollection::flag, layer_collection_flag_set_recursive(), layer_collection_flag_unset_recursive(), LAYER_COLLECTION_HIDE, LAYER_COLLECTION_VISIBLE_VIEW_LAYER, LayerCollection::layer_collections, ViewLayer::layer_collections, LISTBASE_FOREACH, LayerCollection::runtime_flag, and scene.
Referenced by collection_isolate_exec(), and object_hide_collection_exec().
| void BKE_layer_collection_isolate_local | ( | ViewLayer * | view_layer, |
| const View3D * | v3d, | ||
| LayerCollection * | lc, | ||
| bool | extend | ||
| ) |
Isolate the collection locally
Same as BKE_layer_collection_isolate_local but for a viewport
Definition at line 1337 of file layer.c.
References BKE_layer_collection_has_layer_collection(), BKE_layer_collection_local_sync(), ListBase::first, layer_collection_local_visibility_set_recursive(), layer_collection_local_visibility_unset_recursive(), LayerCollection::layer_collections, ViewLayer::layer_collections, LISTBASE_FOREACH, LayerCollection::local_collections_bits, and View3D::local_collections_uuid.
Definition at line 1296 of file layer.c.
References layer_collection_local_sync(), ViewLayer::layer_collections, LISTBASE_FOREACH, View3D::local_collections_uuid, and ViewLayer::object_bases.
Referenced by BKE_layer_collection_isolate_local(), and BKE_layer_collection_local_sync_all().
| void BKE_layer_collection_local_sync_all | ( | const Main * | bmain | ) |
Sync the local collection for all the 3D Viewports.
Definition at line 1313 of file layer.c.
References blender::compositor::area(), BKE_layer_collection_local_sync(), View3D::flag, LISTBASE_FOREACH, scene, Main::scenes, Main::screens, SPACE_VIEW3D, V3D_LOCAL_COLLECTIONS, and Scene::view_layers.
Referenced by BKE_main_collection_sync().
| bool BKE_layer_collection_objects_select | ( | ViewLayer * | view_layer, |
| LayerCollection * | lc, | ||
| bool | deselect | ||
| ) |
Select all the objects of this layer collection
It also select the objects that are in nested collections.
Definition at line 1031 of file layer.c.
References BASE_SELECTABLE, BASE_SELECTED, BKE_layer_collection_objects_select(), BKE_view_layer_base_find(), LayerCollection::collection, COLLECTION_RESTRICT_SELECT, Collection::flag, Base::flag, LayerCollection::flag, Collection::gobject, LAYER_COLLECTION_EXCLUDE, LayerCollection::layer_collections, and LISTBASE_FOREACH.
Referenced by BKE_collection_objects_select(), BKE_layer_collection_objects_select(), and collection_objects_select_exec().
| void BKE_layer_collection_set_flag | ( | LayerCollection * | lc, |
| const int | flag, | ||
| const bool | value | ||
| ) |
Definition at line 1477 of file layer.c.
References layer_collection_flag_recursive_set().
Referenced by collection_view_layer_exec(), and outliner_unhide_all_exec().
| void BKE_layer_collection_set_visible | ( | ViewLayer * | view_layer, |
| LayerCollection * | lc, | ||
| const bool | visible, | ||
| const bool | hierarchy | ||
| ) |
Hide/show all the elements of a collection. Don't change the collection children enable/disable state, but it may change it for the collection itself.
Definition at line 1414 of file layer.c.
References LayerCollection::flag, layer_collection_bases_hide_recursive(), layer_collection_bases_show_recursive(), layer_collection_flag_set_recursive(), layer_collection_flag_unset_recursive(), and LAYER_COLLECTION_HIDE.
Referenced by collection_visibility_exec(), and outliner_hide_exec().
Update view layer collection tree from collections used in the scene. This is used when collections are removed or added, both while editing and on file loaded in case linked data changed or went missing.
Definition at line 913 of file layer.c.
References blender::compositor::active, ViewLayer::active_collection, ViewLayer::basact, BKE_base_eval_flags(), BKE_layer_collection_activate_parent(), BLI_freelistN(), BLI_ghash_remove(), ListBase::first, g_base_collection_flags, layer_collection_hidden(), layer_collection_sync(), ViewLayer::layer_collections, LISTBASE_FOREACH, Scene::master_collection, MEM_SAFE_FREE, CollectionChild::next, NULL, ViewLayer::object_bases, ViewLayer::object_bases_array, ViewLayer::object_bases_hash, scene, and view_layer_bases_hash_create().
Referenced by BKE_base_set_visible(), BKE_layer_collection_isolate_global(), BKE_scene_collection_sync(), and BKE_view_layer_add().
| void BKE_layer_eval_view_layer_indexed | ( | struct Depsgraph * | depsgraph, |
| struct Scene * | scene, | ||
| int | view_layer_index | ||
| ) |
Definition at line 1879 of file layer.c.
References BLI_assert, BLI_findlink(), depsgraph, layer_eval_view_layer(), NULL, scene, ObjectsInModeIteratorData::view_layer, and Scene::view_layers.
| void BKE_main_collection_sync | ( | const Main * | bmain | ) |
Definition at line 984 of file layer.c.
References BKE_layer_collection_local_sync_all(), BKE_scene_collection_sync(), ListBase::first, Scene::id, ID::next, scene, and Main::scenes.
Referenced by BKE_main_collection_sync_remap().
| void BKE_main_collection_sync_remap | ( | const Main * | bmain | ) |
Definition at line 998 of file layer.c.
References BKE_collection_object_cache_free(), BKE_main_collection_sync(), BLI_ghash_free(), Main::collections, DEG_id_tag_update_ex(), ListBase::first, Scene::id, ID_RECALC_COPY_ON_WRITE, LISTBASE_FOREACH, MEM_SAFE_FREE, ID::next, NULL, scene, Main::scenes, and Scene::view_layers.
Definition at line 1153 of file layer.c.
References Object::base_flag, Object::base_local_view_bits, BASE_VISIBLE_VIEWLAYER, BLI_assert, View3D::flag, Object_Runtime::local_collections_bits, View3D::local_collections_uuid, View3D::local_view_uuid, View3D::localvd, NULL, OB_RESTRICT_VIEWPORT, View3D::object_type_exclude_viewport, Object::restrictflag, Object::runtime, Object::type, and V3D_LOCAL_COLLECTIONS.
| void BKE_scene_collection_sync | ( | const Scene * | scene | ) |
Definition at line 977 of file layer.c.
References BKE_layer_collection_sync(), LISTBASE_FOREACH, scene, and Scene::view_layers.
Referenced by BKE_main_collection_sync().
See if the object is in any of the scene layers of the scene
Definition at line 1527 of file layer.c.
References BKE_view_layer_base_find(), LISTBASE_FOREACH, scene, and Scene::view_layers.
Referenced by scene_drop_invoke().
| ViewLayer* BKE_view_layer_add | ( | Scene * | scene, |
| const char * | name, | ||
| ViewLayer * | view_layer_source, | ||
| const int | type | ||
| ) |
Add a new view layer by default, a view layer has the master collection
Definition at line 200 of file layer.c.
References BKE_layer_collection_sync(), BKE_view_layer_copy_data(), BLI_addtail(), BLI_strncpy_utf8(), BLI_uniquename(), DATA_, ListBase::first, layer_collection_exclude_all(), ViewLayer::layer_collections, MEM_callocN, ViewLayer::name, scene, type, view_layer_add(), Scene::view_layers, VIEWLAYER_ADD_COPY, VIEWLAYER_ADD_EMPTY, and VIEWLAYER_ADD_NEW.
Referenced by do_version_layers_to_collections(), scene_init_data(), and view_layer_add_exec().
| struct ViewLayerAOV* BKE_view_layer_add_aov | ( | struct ViewLayer * | view_layer | ) |
Definition at line 2034 of file layer.c.
References AOV_TYPE_COLOR, ViewLayer::aovs, BLI_addtail(), BLI_strncpy(), DATA_, MEM_callocN, ViewLayerAOV::name, ViewLayerAOV::type, viewlayer_aov_active_set(), and viewlayer_aov_make_name_unique().
Referenced by blender::bke::tests::TEST(), and view_layer_add_aov_exec().
| void BKE_view_layer_base_deselect_all | ( | ViewLayer * | view_layer | ) |
Definition at line 403 of file layer.c.
References BASE_SELECTED, ListBase::first, Base::flag, Base::next, and ViewLayer::object_bases.
Referenced by BKE_copybuffer_paste(), BKE_object_add_for_data(), do_outliner_item_activate_tree_element(), do_outliner_item_mode_toggle_generic(), DocumentImporter::import(), import_endjob(), make_local_exec(), object_add_common(), object_transfer_mode_to_base(), select_marker_camera_switch(), tree_element_object_activate(), and wm_link_append_exec().
Definition at line 394 of file layer.c.
References BLI_ghash_lookup(), ViewLayer::object_bases_hash, and view_layer_bases_hash_create().
Referenced by add_collections_to_scene(), add_hook_object_new(), bake_object_check(), bc_add_object(), BKE_layer_collection_has_selected_objects(), BKE_layer_collection_objects_select(), BKE_object_add(), BKE_object_add_for_data(), BKE_object_add_from(), BKE_object_pose_armature_get_visible(), BKE_object_pose_base_array_get_ex(), BKE_scene_has_object(), collection_objects_select(), createTransObject(), CTX_data_active_base(), ctx_data_base_collection_get(), do_outliner_item_activate_tree_element(), do_outliner_item_mode_toggle_generic(), do_version_layers_to_collections(), duplibase_for_convert(), ED_armature_pose_select_in_wpaint_mode(), ED_object_jump_to_object(), ed_object_posemode_set_for_weight_paint_ex(), ED_outliner_give_base_under_cursor(), ED_undo_object_set_active_or_warn(), EDBM_edge_find_nearest(), EDBM_face_find_nearest(), EDBM_vert_find_nearest(), editselect_buf_cache_init(), element_should_draw_faded(), getTransformOrientation_ex(), gpencil_layer_to_curve(), import_endjob(), jump_to_target_ptr(), layer_collection_bases_hide_recursive(), layer_collection_bases_show_recursive(), layer_collection_local_sync(), make_local_all__instance_indirect_unused(), make_object_duplilist_real(), object_add_duplicate_internal(), object_base_instance_init(), object_batch_delete_hierarchy_fn(), object_deselect_fn(), object_preview_scene_create(), object_select_fn(), object_select_mirror_exec(), object_transfer_mode_to_base(), outliner_base_or_object_pointer_create(), outliner_draw_restrictbuts(), outliner_draw_tree_element(), outliner_element_visible_get(), outliner_hide_find_data_to_edit(), outliner_item_mode_toggle(), outliner_object_set_flag_recursive_fn(), outliner_select_sync_from_object(), outliner_select_sync_to_object(), parent_drop_allowed(), scene_drop_invoke(), screen_set_3dview_camera(), select_grouped_object_hooks(), select_grouped_parent(), select_marker_camera_switch(), set_trans_object_base_flags(), transform_object_deform_pose_armature_get(), tree_element_object_activate(), tree_element_pose_state_get(), and validate_object_select_id().
Definition at line 412 of file layer.c.
References ViewLayer::basact, BASE_SELECTABLE, BASE_SELECTED, and Base::flag.
Referenced by bc_add_object(), BKE_object_add(), BKE_object_add_for_data(), BKE_object_add_from(), do_outliner_item_mode_toggle_generic(), import_endjob(), and object_transfer_mode_to_base().
| void BKE_view_layer_bases_in_mode_iterator_begin | ( | BLI_Iterator * | iter, |
| void * | data_in | ||
| ) |
Definition at line 1766 of file layer.c.
References base_is_in_mode(), BKE_base_is_visible(), BKE_view_layer_bases_in_mode_iterator_next(), BLI_assert, BLI_Iterator::current, BLI_Iterator::data, data, NULL, Base::object, Object::type, and BLI_Iterator::valid.
| void BKE_view_layer_bases_in_mode_iterator_end | ( | BLI_Iterator * | UNUSEDiter | ) |
| void BKE_view_layer_bases_in_mode_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 1792 of file layer.c.
References base_is_in_mode(), BKE_base_is_visible(), BLI_Iterator::current, BLI_Iterator::data, data, Base::next, and BLI_Iterator::valid.
Referenced by BKE_view_layer_bases_in_mode_iterator_begin().
| void BKE_view_layer_blend_read_data | ( | BlendDataReader * | reader, |
| ViewLayer * | view_layer | ||
| ) |
Definition at line 1937 of file layer.c.
References ViewLayer::active_aov, ViewLayer::active_collection, ViewLayer::aovs, ViewLayer::basact, BLI_listbase_clear(), BLO_read_data_address, BLO_read_list(), direct_link_layer_collections(), ViewLayer::drawdata, ViewLayer::freestyle_config, ViewLayer::id_properties, IDP_BlendDataRead, ViewLayer::layer_collections, FreestyleConfig::linesets, FreestyleConfig::modules, NULL, ViewLayer::object_bases, ViewLayer::object_bases_array, ViewLayer::object_bases_hash, ViewLayer::stats, and ObjectsInModeIteratorData::view_layer.
Referenced by BKE_collection_blend_read_data(), and scene_blend_read_data().
| void BKE_view_layer_blend_read_lib | ( | BlendLibReader * | reader, |
| Library * | lib, | ||
| ViewLayer * | view_layer | ||
| ) |
Definition at line 1976 of file layer.c.
References ViewLayer::basact, BLI_freelinkN(), BLO_read_id_address, ViewLayer::freestyle_config, ViewLayer::id_properties, IDP_BlendReadLib(), ViewLayer::layer_collections, lib, lib_link_layer_collection(), FreestyleConfig::linesets, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, ViewLayer::mat_override, FreestyleConfig::modules, NULL, ViewLayer::object_bases, and ObjectsInModeIteratorData::view_layer.
Referenced by BKE_collection_blend_read_lib(), and scene_blend_read_lib().
| void BKE_view_layer_blend_write | ( | BlendWriter * | writer, |
| ViewLayer * | view_layer | ||
| ) |
Definition at line 1898 of file layer.c.
References ViewLayer::aovs, BLO_write_struct, BLO_write_struct_list, ViewLayer::freestyle_config, ViewLayer::id_properties, IDP_BlendWrite(), ViewLayer::layer_collections, FreestyleConfig::linesets, LISTBASE_FOREACH, FreestyleConfig::modules, ViewLayer::object_bases, ObjectsInModeIteratorData::view_layer, and write_layer_collections().
Referenced by scene_blend_write().
Fallback for when a Scene has no camera to use
| view_layer | in general you want to use the same ViewLayer that is used for depsgraph. If rendering you pass the scene active layer, when viewing in the viewport you want to get ViewLayer from context. |
Definition at line 337 of file layer.c.
References LISTBASE_FOREACH, NULL, OB_CAMERA, and ViewLayer::object_bases.
Referenced by check_valid_camera(), check_valid_compositing_camera(), screen_set_3dview_camera(), and view_camera_exec().
This is a placeholder to know which areas of the code need to be addressed for the Workspace changes. Never use this, you should typically get the active layer from the context or window.
Definition at line 159 of file layer.c.
References BLI_assert, ListBase::first, scene, and Scene::view_layers.
| void BKE_view_layer_copy_data | ( | Scene * | scene_dst, |
| const Scene * | UNUSEDscene_src, | ||
| ViewLayer * | view_layer_dst, | ||
| const ViewLayer * | view_layer_src, | ||
| const int | flag | ||
| ) |
Only copy internal data of ViewLayer from source to already allocated/initialized destination.
| flag | Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more). |
Definition at line 474 of file layer.c.
References ViewLayer::active_collection, ViewLayer::aovs, ViewLayer::basact, BKE_freestyle_config_copy(), BLI_addtail(), BLI_listbase_clear(), LayerCollection::collection, ViewLayer::drawdata, ListBase::first, ViewLayer::freestyle_config, ViewLayer::id_properties, id_us_plus(), IDP_CopyProperty_ex(), layer_aov_copy_data(), ViewLayer::layer_collections, layer_collections_copy_data(), LIB_ID_CREATE_NO_USER_REFCOUNT, LISTBASE_FOREACH, Scene::master_collection, ViewLayer::mat_override, MEM_dupallocN, NULL, ViewLayer::object_bases, ViewLayer::object_bases_array, ViewLayer::object_bases_hash, and ViewLayer::stats.
Referenced by BKE_view_layer_add().
Definition at line 130 of file layer.c.
References BLI_assert, ListBase::first, LISTBASE_FOREACH, scene, VIEW_LAYER_RENDER, and Scene::view_layers.
Definition at line 117 of file layer.c.
References BLI_assert, ListBase::first, LISTBASE_FOREACH, scene, VIEW_LAYER_RENDER, and Scene::view_layers.
Definition at line 143 of file layer.c.
References LISTBASE_FOREACH, NULL, scene, STREQ, and Scene::view_layers.
| ViewLayer* BKE_view_layer_find_from_collection | ( | const Scene * | scene, |
| LayerCollection * | lc | ||
| ) |
Find the ViewLayer a LayerCollection belongs to
Definition at line 351 of file layer.c.
References find_scene_collection_in_scene_collections(), LISTBASE_FOREACH, NULL, scene, and Scene::view_layers.
| ViewLayer* BKE_view_layer_find_with_aov | ( | struct Scene * | scene, |
| struct ViewLayerAOV * | aov | ||
| ) |
Definition at line 2123 of file layer.c.
References BLI_findindex(), LISTBASE_FOREACH, NULL, scene, and Scene::view_layers.
| void BKE_view_layer_free | ( | ViewLayer * | view_layer | ) |
Definition at line 254 of file layer.c.
References BKE_view_layer_free_ex().
Referenced by ED_scene_view_layer_delete().
| void BKE_view_layer_free_ex | ( | ViewLayer * | view_layer, |
| const bool | do_id_user | ||
| ) |
Free (or release) any data used by this ViewLayer.
Definition at line 262 of file layer.c.
References ViewLayer::active_aov, ViewLayer::aovs, ViewLayer::basact, BKE_freestyle_config_free(), BLI_freelistN(), BLI_ghash_free(), ViewLayer::drawdata, ViewLayer::freestyle_config, ViewLayer::id_properties, IDP_FreeProperty_ex(), layer_collection_free(), ViewLayer::layer_collections, LISTBASE_FOREACH, MEM_freeN, MEM_SAFE_FREE, NULL, ViewLayer::object_bases, ViewLayer::object_bases_array, ViewLayer::object_bases_hash, and ViewLayer::stats.
Referenced by BKE_view_layer_free(), and scene_free_data().
| bool BKE_view_layer_has_collection | ( | ViewLayer * | view_layer, |
| const Collection * | collection | ||
| ) |
See if view layer has the scene collection linked directly, or indirectly (nested)
Definition at line 1519 of file layer.c.
References BKE_layer_collection_first_from_scene_collection(), and NULL.
| bool BKE_view_layer_has_valid_aov | ( | ViewLayer * | view_layer | ) |
Definition at line 2113 of file layer.c.
References AOV_CONFLICT, ViewLayer::aovs, and LISTBASE_FOREACH.
Referenced by blender::bke::tests::TEST(), and blender::bke::tests::test_render_pass_conflict().
| void BKE_view_layer_remove_aov | ( | ViewLayer * | view_layer, |
| ViewLayerAOV * | aov | ||
| ) |
Definition at line 2046 of file layer.c.
References ViewLayer::active_aov, ViewLayer::aovs, BLI_assert, BLI_findindex(), BLI_freelinkN(), ViewLayerAOV::next, NULL, ViewLayerAOV::prev, and viewlayer_aov_active_set().
Referenced by blender::bke::tests::TEST(), and view_layer_remove_aov_exec().
| void BKE_view_layer_rename | ( | Main * | bmain, |
| Scene * | scene, | ||
| ViewLayer * | view_layer, | ||
| const char * | newname | ||
| ) |
Definition at line 522 of file layer.c.
References BKE_animdata_fix_paths_rename_all(), BLI_findindex(), BLI_strncpy(), BLI_strncpy_utf8(), BLI_uniquename(), CMP_NODE_R_LAYERS, DATA_, DEG_id_tag_update(), ListBase::first, Scene::id, LISTBASE_FOREACH, ViewLayer::name, node, NODE_MAXSTR, bNodeTree::nodes, Scene::nodetree, NULL, scene, STREQ, STRNCPY, Scene::view_layers, wmWindowManager::windows, and Main::wm.
Referenced by blo_update_defaults_scene(), and namebutton_fn().
| void BKE_view_layer_selected_bases_iterator_begin | ( | BLI_Iterator * | iter, |
| void * | data_in | ||
| ) |
Definition at line 1718 of file layer.c.
References BASE_SELECTED, BASE_VISIBLE_DEPSGRAPH, and objects_iterator_begin().
| void BKE_view_layer_selected_bases_iterator_end | ( | BLI_Iterator * | iter | ) |
Definition at line 1728 of file layer.c.
References object_bases_iterator_end().
| void BKE_view_layer_selected_bases_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 1723 of file layer.c.
References BASE_SELECTED, BASE_VISIBLE_DEPSGRAPH, and object_bases_iterator_next().
| void BKE_view_layer_selected_editable_objects_iterator_begin | ( | BLI_Iterator * | iter, |
| void * | data_in | ||
| ) |
Definition at line 1684 of file layer.c.
References BASE_SELECTED, BASE_VISIBLE_DEPSGRAPH, BKE_object_is_libdata(), BKE_view_layer_selected_editable_objects_iterator_next(), BLI_Iterator::current, objects_iterator_begin(), and BLI_Iterator::valid.
| void BKE_view_layer_selected_editable_objects_iterator_end | ( | BLI_Iterator * | iter | ) |
Definition at line 1707 of file layer.c.
References objects_iterator_end().
| void BKE_view_layer_selected_editable_objects_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 1698 of file layer.c.
References BASE_SELECTED, BASE_VISIBLE_DEPSGRAPH, BKE_object_is_libdata(), BLI_Iterator::current, objects_iterator_next(), and BLI_Iterator::valid.
Referenced by BKE_view_layer_selected_editable_objects_iterator_begin().
| void BKE_view_layer_selected_objects_iterator_begin | ( | BLI_Iterator * | iter, |
| void * | data_in | ||
| ) |
Definition at line 1642 of file layer.c.
References BASE_SELECTED, BASE_VISIBLE_DEPSGRAPH, and objects_iterator_begin().
| void BKE_view_layer_selected_objects_iterator_end | ( | BLI_Iterator * | iter | ) |
Definition at line 1652 of file layer.c.
References objects_iterator_end().
| void BKE_view_layer_selected_objects_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 1647 of file layer.c.
References BASE_SELECTED, BASE_VISIBLE_DEPSGRAPH, and objects_iterator_next().
| void BKE_view_layer_selected_objects_tag | ( | ViewLayer * | view_layer, |
| const int | tag | ||
| ) |
Tag all the selected objects of a render-layer.
Definition at line 305 of file layer.c.
References BASE_SELECTED, LISTBASE_FOREACH, and ViewLayer::object_bases.
Referenced by make_single_user_exec().
| void BKE_view_layer_set_active_aov | ( | ViewLayer * | view_layer, |
| ViewLayerAOV * | aov | ||
| ) |
Definition at line 2061 of file layer.c.
References viewlayer_aov_active_set().
| void BKE_view_layer_verify_aov | ( | struct RenderEngine * | engine, |
| struct Scene * | scene, | ||
| struct ViewLayer * | view_layer | ||
| ) |
Definition at line 2095 of file layer.c.
References AOV_CONFLICT, ViewLayer::aovs, bke_view_layer_verify_aov_cb(), BLI_ghash_free(), BLI_ghash_lookup(), BLI_ghash_str_new(), count, LISTBASE_FOREACH, MEM_freeN, NULL, POINTER_AS_INT, RE_engine_update_render_passes(), scene, SET_FLAG_FROM_TEST, and viewlayer_aov_make_name_unique().
Referenced by blender::bke::tests::TEST(), blender::bke::tests::test_render_pass_conflict(), view_layer_add_aov_exec(), and view_layer_remove_aov_exec().
|
static |
Definition at line 2066 of file layer.c.
References BLI_ghash_ensure_p(), BLI_strdup(), MEM_freeN, ViewLayerAOV::name, POINTER_AS_INT, and POINTER_FROM_INT.
Referenced by BKE_view_layer_verify_aov().
| void BKE_view_layer_visible_bases_iterator_begin | ( | BLI_Iterator * | iter, |
| void * | data_in | ||
| ) |
Definition at line 1739 of file layer.c.
References object_bases_iterator_begin().
| void BKE_view_layer_visible_bases_iterator_end | ( | BLI_Iterator * | iter | ) |
Definition at line 1749 of file layer.c.
References object_bases_iterator_end().
| void BKE_view_layer_visible_bases_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 1744 of file layer.c.
References object_bases_iterator_next().
| void BKE_view_layer_visible_objects_iterator_begin | ( | BLI_Iterator * | iter, |
| void * | data_in | ||
| ) |
Definition at line 1663 of file layer.c.
References objects_iterator_begin().
| void BKE_view_layer_visible_objects_iterator_end | ( | BLI_Iterator * | iter | ) |
Definition at line 1673 of file layer.c.
References objects_iterator_end().
| void BKE_view_layer_visible_objects_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 1668 of file layer.c.
References objects_iterator_next().
|
static |
Recursively get the count of collections
Definition at line 679 of file layer.c.
References LISTBASE_FOREACH.
Referenced by BKE_layer_collection_count(), and select_grouped_collection().
|
static |
Recursively get the collection for a given index
Definition at line 571 of file layer.c.
References LISTBASE_FOREACH, and NULL.
Referenced by BKE_layer_collection_from_index().
|
static |
Definition at line 1920 of file layer.c.
References BLO_read_data_address, BLO_read_list(), and LISTBASE_FOREACH.
Referenced by BKE_view_layer_blend_read_data().
|
static |
Definition at line 1484 of file layer.c.
References LayerCollection::collection, LayerCollection::layer_collections, LISTBASE_FOREACH, and NULL.
Referenced by BKE_layer_collection_first_from_scene_collection().
|
static |
Definition at line 317 of file layer.c.
References LISTBASE_FOREACH.
Referenced by BKE_view_layer_find_from_collection().
|
static |
Recursively get the index for a given collection
Definition at line 700 of file layer.c.
References LISTBASE_FOREACH.
Referenced by BKE_layer_collection_findindex().
|
static |
Definition at line 421 of file layer.c.
References ViewLayer::active_aov, BLI_assert, BLI_duplicatelist(), ListBase::first, ViewLayerAOV::next, and NULL.
Referenced by BKE_view_layer_copy_data().
|
static |
Definition at line 77 of file layer.c.
References BLI_addtail(), LayerCollection::collection, LayerCollection::local_collections_bits, and MEM_callocN.
Referenced by layer_collection_sync().
|
static |
Definition at line 1396 of file layer.c.
References BASE_HIDDEN, BKE_view_layer_base_find(), LayerCollection::collection, Base::flag, LayerCollection::flag, Collection::gobject, LAYER_COLLECTION_EXCLUDE, LayerCollection::layer_collections, and LISTBASE_FOREACH.
Referenced by BKE_layer_collection_set_visible().
|
static |
Definition at line 1383 of file layer.c.
References BASE_HIDDEN, BKE_view_layer_base_find(), LayerCollection::collection, Base::flag, LayerCollection::flag, Collection::gobject, LAYER_COLLECTION_EXCLUDE, LayerCollection::layer_collections, and LISTBASE_FOREACH.
Referenced by BKE_layer_collection_set_visible().
|
static |
Definition at line 187 of file layer.c.
References ListBase::first, LayerCollection::flag, LAYER_COLLECTION_EXCLUDE, LayerCollection::layer_collections, LayerCollection::next, and NULL.
Referenced by BKE_view_layer_add().
|
static |
Set layer collection hide/exclude/indirect flag on a layer collection. recursively.
Definition at line 1443 of file layer.c.
References LayerCollection::flag, LAYER_COLLECTION_EXCLUDE, LAYER_COLLECTION_PREVIOUSLY_EXCLUDED, LayerCollection::layer_collections, LISTBASE_FOREACH, and SET_FLAG_FROM_TEST.
Referenced by BKE_layer_collection_set_flag().
|
static |
Definition at line 1182 of file layer.c.
References LayerCollection::flag, LayerCollection::layer_collections, and LISTBASE_FOREACH.
Referenced by BKE_layer_collection_isolate_global(), and BKE_layer_collection_set_visible().
|
static |
Definition at line 1190 of file layer.c.
References LayerCollection::flag, LayerCollection::layer_collections, and LISTBASE_FOREACH.
Referenced by BKE_layer_collection_isolate_global(), and BKE_layer_collection_set_visible().
|
static |
Definition at line 87 of file layer.c.
References ViewLayer::active_collection, BLI_freelistN(), LayerCollection::layer_collections, LISTBASE_FOREACH, and NULL.
Referenced by BKE_view_layer_free_ex(), and layer_collection_sync().
|
static |
Determine if a collection is hidden, viewport visibility restricted, or excluded
Definition at line 593 of file layer.c.
References BKE_layer_collection_first_from_scene_collection(), CollectionParent::collection, LayerCollection::collection, COLLECTION_RESTRICT_VIEWPORT, ListBase::first, Collection::flag, LayerCollection::flag, LAYER_COLLECTION_EXCLUDE, LAYER_COLLECTION_HIDE, and Collection::parents.
Referenced by BKE_layer_collection_activate_parent(), and BKE_layer_collection_sync().
|
static |
Definition at line 1272 of file layer.c.
References BKE_view_layer_base_find(), BLI_assert, LayerCollection::collection, Collection::gobject, LAYER_COLLECTION_EXCLUDE, LayerCollection::layer_collections, LISTBASE_FOREACH, Base::local_collections_bits, and LayerCollection::local_collections_bits.
Referenced by BKE_layer_collection_local_sync().
|
static |
Definition at line 1254 of file layer.c.
References LayerCollection::layer_collections, LISTBASE_FOREACH, and LayerCollection::local_collections_bits.
Referenced by BKE_layer_collection_isolate_local().
|
static |
Definition at line 1263 of file layer.c.
References LayerCollection::layer_collections, LISTBASE_FOREACH, and LayerCollection::local_collections_bits.
Referenced by BKE_layer_collection_isolate_local().
|
static |
Definition at line 740 of file layer.c.
References ViewLayer::active_collection, BASE_ENABLED_RENDER, BASE_ENABLED_VIEWPORT, BASE_HOLDOUT, BASE_INDIRECT_ONLY, BASE_SELECTABLE, BASE_VISIBLE_DEPSGRAPH, BASE_VISIBLE_VIEWLAYER, BLI_addtail(), BLI_assert, BLI_findptr(), BLI_freelinkN(), BLI_ghash_ensure_p(), BLI_listbase_count(), BLI_listbase_is_empty(), BLI_remlink(), Collection::children, COLLECTION_IS_MASTER, COLLECTION_RESTRICT_RENDER, COLLECTION_RESTRICT_SELECT, COLLECTION_RESTRICT_VIEWPORT, ELEM, ListBase::first, Collection::flag, LayerCollection::flag, Base::flag_from_collection, Collection::gobject, Collection::id, id_lib_indirect_weak_link(), ListBase::last, layer_collection_add(), LAYER_COLLECTION_EXCLUDE, layer_collection_free(), LAYER_COLLECTION_HAS_OBJECTS, LAYER_COLLECTION_HIDE, LAYER_COLLECTION_HOLDOUT, LAYER_COLLECTION_INDIRECT_ONLY, LAYER_COLLECTION_RESTRICT_VIEWPORT, LAYER_COLLECTION_VISIBLE_VIEW_LAYER, LayerCollection::layer_collections, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, Base::local_collections_bits, LayerCollection::local_collections_bits, NULL, object_base_new(), ViewLayer::object_bases, ViewLayer::object_bases_hash, and LayerCollection::runtime_flag.
Referenced by BKE_layer_collection_sync().
|
static |
Definition at line 444 of file layer.c.
References ViewLayer::active_collection, BLI_duplicatelist(), ListBase::first, LayerCollection::layer_collections, LayerCollection::next, and NULL.
Referenced by BKE_view_layer_copy_data().
|
static |
Definition at line 1862 of file layer.c.
References BLI_listbase_count(), DEG_debug_print_eval(), depsgraph, LISTBASE_FOREACH, MEM_malloc_arrayN, MEM_SAFE_FREE, ViewLayer::name, ViewLayer::object_bases, ViewLayer::object_bases_array, and ObjectsInModeIteratorData::view_layer.
Referenced by BKE_layer_eval_view_layer_indexed().
|
static |
Definition at line 1960 of file layer.c.
References BLO_read_id_address, LayerCollection::collection, LayerCollection::layer_collections, lib, and LISTBASE_FOREACH.
Referenced by BKE_view_layer_blend_read_lib().
Definition at line 100 of file layer.c.
References Object::base_flag, BASE_SELECTED, Base::flag, Base::local_view_bits, MEM_callocN, and Base::object.
Referenced by layer_collection_sync().
|
static |
Definition at line 1564 of file layer.c.
References BLI_Iterator::current, BLI_Iterator::data, data, ListBase::first, MEM_callocN, NULL, ViewLayer::object_bases, object_bases_iterator_is_valid(), object_bases_iterator_next(), ObjectsVisibleIteratorData::v3d, BLI_Iterator::valid, and ObjectsVisibleIteratorData::view_layer.
Referenced by BKE_view_layer_visible_bases_iterator_begin(), and objects_iterator_begin().
|
static |
Definition at line 1609 of file layer.c.
References BLI_Iterator::data, and MEM_SAFE_FREE.
Referenced by BKE_view_layer_selected_bases_iterator_end(), BKE_view_layer_visible_bases_iterator_end(), and objects_iterator_end().
|
static |
Definition at line 1551 of file layer.c.
References BASE_VISIBLE, BLI_assert, Base::flag, NULL, SPACE_VIEW3D, and View3D::spacetype.
Referenced by object_bases_iterator_begin(), and object_bases_iterator_next().
|
static |
Definition at line 1592 of file layer.c.
References BLI_Iterator::current, BLI_Iterator::data, data, Base::next, object_bases_iterator_is_valid(), and BLI_Iterator::valid.
Referenced by BKE_view_layer_selected_bases_iterator_next(), BKE_view_layer_visible_bases_iterator_next(), object_bases_iterator_begin(), and objects_iterator_next().
|
static |
Definition at line 1614 of file layer.c.
References BLI_Iterator::current, object_bases_iterator_begin(), and BLI_Iterator::valid.
Referenced by BKE_view_layer_selected_bases_iterator_begin(), BKE_view_layer_selected_editable_objects_iterator_begin(), BKE_view_layer_selected_objects_iterator_begin(), and BKE_view_layer_visible_objects_iterator_begin().
|
static |
Definition at line 1632 of file layer.c.
References object_bases_iterator_end().
Referenced by BKE_view_layer_selected_editable_objects_iterator_end(), BKE_view_layer_selected_objects_iterator_end(), and BKE_view_layer_visible_objects_iterator_end().
|
static |
Definition at line 1623 of file layer.c.
References BLI_Iterator::current, object_bases_iterator_next(), and BLI_Iterator::valid.
Referenced by BKE_view_layer_selected_editable_objects_iterator_next(), BKE_view_layer_selected_objects_iterator_next(), and BKE_view_layer_visible_objects_iterator_next().
|
static |
Definition at line 165 of file layer.c.
References BKE_freestyle_config_init(), BLI_strncpy_utf8(), ViewLayer::cryptomatte_flag, ViewLayer::cryptomatte_levels, DATA_, ViewLayer::flag, ViewLayer::freestyle_config, ViewLayer::layflag, MEM_callocN, ViewLayer::name, ViewLayer::pass_alpha_threshold, ViewLayer::passflag, SCE_PASS_COMBINED, SCE_PASS_Z, VIEW_LAYER_CRYPTOMATTE_ACCURATE, VIEW_LAYER_FREESTYLE, and VIEW_LAYER_RENDER.
Referenced by BKE_view_layer_add().
|
static |
Definition at line 364 of file layer.c.
References BLI_ghash_ensure_p(), BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), BLI_MUTEX_INITIALIZER, BLI_mutex_lock(), BLI_mutex_unlock(), hash, LISTBASE_FOREACH, NULL, ViewLayer::object_bases, and ViewLayer::object_bases_hash.
Referenced by BKE_layer_collection_sync(), and BKE_view_layer_base_find().
|
static |
Definition at line 2023 of file layer.c.
References ViewLayer::active_aov, ViewLayer::aovs, BLI_assert, BLI_findindex(), NULL, and ObjectsInModeIteratorData::view_layer.
Referenced by BKE_view_layer_add_aov(), BKE_view_layer_remove_aov(), and BKE_view_layer_set_active_aov().
|
static |
Definition at line 2013 of file layer.c.
References ViewLayer::active_aov, ViewLayer::aovs, BLI_uniquename(), DATA_, ViewLayerAOV::name, NULL, and ObjectsInModeIteratorData::view_layer.
Referenced by BKE_view_layer_add_aov(), and BKE_view_layer_verify_aov().
|
static |
Definition at line 1889 of file layer.c.
References BLO_write_struct, and LISTBASE_FOREACH.
Referenced by BKE_view_layer_blend_write().
|
static |
Definition at line 67 of file layer.c.
Referenced by BKE_base_eval_flags(), and BKE_layer_collection_sync().