Blender
V3.3
|
#include <string.h>
#include "CLG_log.h"
#include "BLI_listbase.h"
#include "BLI_mempool.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 "DNA_world_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 | LayerCollectionResync |
struct | LayerObjectBaseIteratorData |
Macros | |
#define | DNA_DEPRECATED_ALLOW |
Variables | |
static CLG_LogRef | LOG = {"bke.layercollection"} |
static const short | g_base_collection_flags |
Syncing | |
The layer collection tree mirrors the scene collection tree. Whenever that changes we need to synchronize them so that there is a corresponding layer collection for each collection. Note that the scene collection tree can contain link or override collections, and so this is also called on .blend file load to ensure any new or removed collections are synced. The view layer also contains a list of bases for each object that exists in at least one layer collection. That list is also synchronized here, and stores state like selection. This API allows to temporarily forbid resync of LayerCollections. This can greatly improve performances in cases where those functions get called a lot (e.g. during massive remappings of IDs). Usage of these should be done very carefully though. In particular, calling code must ensures it resync LayerCollections before any UI/Event loop handling can happen.
| |
typedef struct LayerCollectionResync | LayerCollectionResync |
static bool | no_resync = false |
void | BKE_layer_collection_resync_forbid (void) |
void | BKE_layer_collection_resync_allow (void) |
static LayerCollectionResync * | layer_collection_resync_create_recurse (LayerCollectionResync *parent_layer_resync, LayerCollection *layer, BLI_mempool *mempool) |
static LayerCollectionResync * | layer_collection_resync_find (LayerCollectionResync *layer_resync, Collection *child_collection) |
static void | layer_collection_resync_unused_layers_free (ViewLayer *view_layer, LayerCollectionResync *layer_resync) |
static void | layer_collection_objects_sync (ViewLayer *view_layer, LayerCollection *layer, ListBase *r_lb_new_object_bases, const short collection_restrict, const short layer_restrict, const ushort local_collections_bits) |
static void | layer_collection_sync (ViewLayer *view_layer, LayerCollectionResync *layer_resync, BLI_mempool *layer_resync_mempool, ListBase *r_lb_new_object_bases, const short parent_layer_flag, const short parent_collection_restrict, const short parent_layer_restrict, const ushort parent_local_collections_bits) |
static bool | view_layer_objects_base_cache_validate (ViewLayer *view_layer, LayerCollection *layer) |
void | BKE_layer_collection_doversion_2_80 (const Scene *scene, ViewLayer *view_layer) |
void | BKE_layer_collection_sync (const Scene *scene, ViewLayer *view_layer) |
void | BKE_scene_collection_sync (const Scene *scene) |
void | BKE_main_collection_sync (const Main *bmain) |
void | BKE_main_collection_sync_remap (const Main *bmain) |
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 LayerCollectionResync LayerCollectionResync |
typedef struct LayerObjectBaseIteratorData LayerObjectBaseIteratorData |
|
static |
Definition at line 2130 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().
Applies object's restrict flags on top of flags coming from the collection and stores those in base->flag
. BASE_VISIBLE_DEPSGRAPH ignores viewport flags visibility (i.e., restriction and local collection).
Definition at line 2200 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_HIDE_RENDER, OB_HIDE_SELECT, OB_HIDE_VIEWPORT, Base::object, and Object::visibility_flag.
Referenced by BKE_layer_collection_sync(), BKE_object_eval_eval_base_flags(), and object_add_named_exec().
Definition at line 1509 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().
void BKE_base_set_visible | ( | struct Scene * | scene, |
struct ViewLayer * | view_layer, | ||
struct Base * | base, | ||
bool | extend | ||
) |
Update after toggling visibility of an object base.
Definition at line 1491 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 | ( | struct ViewLayer * | view_layer, |
struct LayerCollection * | lc | ||
) |
Activate collection
Definition at line 641 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 | ( | struct ViewLayer * | view_layer, |
struct 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_add_info_get_from_op(), and collection_instance_exec().
int BKE_layer_collection_count | ( | const ViewLayer * | view_layer | ) |
Definition at line 688 of file layer.c.
References collection_count(), and ViewLayer::layer_collections.
Definition at line 1215 of file layer.c.
References BLI_listbase_clear(), BLI_listbase_count_at_most(), LayerCollection::collection, ListBase::first, layer_collection_add(), LayerCollection::layer_collections, ViewLayer::layer_collections, Scene::master_collection, and scene.
int BKE_layer_collection_findindex | ( | ViewLayer * | view_layer, |
const LayerCollection * | lc | ||
) |
Definition at line 715 of file layer.c.
References index_from_collection(), and ViewLayer::layer_collections.
LayerCollection* BKE_layer_collection_first_from_scene_collection | ( | const ViewLayer * | view_layer, |
const Collection * | collection | ||
) |
Definition at line 1877 of file layer.c.
References LayerCollectionResync::collection, 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 | ( | struct ViewLayer * | view_layer, |
int | index | ||
) |
Get the collection for a given index.
Definition at line 630 of file layer.c.
References collection_from_index(), and ViewLayer::layer_collections.
Referenced by object_hide_collection_exec().
LayerCollection* BKE_layer_collection_get_active | ( | struct ViewLayer * | view_layer | ) |
Get the active collection
Definition at line 636 of file layer.c.
References ViewLayer::active_collection.
Referenced by bc_add_object(), BKE_object_add(), BKE_object_add_for_data(), collection_add_info_get_from_op(), collection_instance_exec(), CTX_data_layer_collection(), blender::io::obj::geometry_to_blender_objects(), blender::io::usd::import_endjob(), import_endjob(), blender::io::stl::importer_main(), loose_data_instantiate_ensure_active_collection(), and object_add_duplicate_internal().
bool BKE_layer_collection_has_layer_collection | ( | LayerCollection * | lc_parent, |
LayerCollection * | lc_child | ||
) |
Definition at line 1470 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 1445 of file layer.c.
References BASE_SELECTED, BASE_VISIBLE_DEPSGRAPH, BKE_layer_collection_has_selected_objects(), BKE_view_layer_base_find(), LayerCollection::collection, COLLECTION_HIDE_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 | ( | struct Scene * | scene, |
struct ViewLayer * | view_layer, | ||
struct 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 1585 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 | ||
) |
Definition at line 1719 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 1678 of file layer.c.
References layer_collection_local_sync(), ViewLayer::layer_collections, LISTBASE_FOREACH, View3D::local_collections_uuid, no_resync, and ViewLayer::object_bases.
Referenced by BKE_layer_collection_isolate_local(), and BKE_layer_collection_local_sync_all().
Definition at line 1696 of file layer.c.
References blender::compositor::area(), BKE_layer_collection_local_sync(), View3D::flag, LISTBASE_FOREACH, no_resync, 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 | ( | struct ViewLayer * | view_layer, |
struct 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 1409 of file layer.c.
References BASE_SELECTABLE, BASE_SELECTED, BKE_layer_collection_objects_select(), BKE_view_layer_base_find(), LayerCollection::collection, COLLECTION_HIDE_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().
Definition at line 766 of file layer.c.
References no_resync.
Referenced by BKE_lib_override_library_main_resync(), duplicate_exec(), blender::io::obj::geometry_to_blender_objects(), id_delete(), blender::io::usd::import_endjob(), and import_endjob().
Definition at line 761 of file layer.c.
References no_resync.
Referenced by BKE_lib_override_library_main_resync(), duplicate_exec(), blender::io::obj::geometry_to_blender_objects(), id_delete(), blender::io::usd::import_endjob(), and import_endjob().
void BKE_layer_collection_set_flag | ( | LayerCollection * | lc, |
const int | flag, | ||
const bool | value | ||
) |
Definition at line 1854 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 | ( | struct ViewLayer * | view_layer, |
struct LayerCollection * | lc, | ||
bool | visible, | ||
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 1791 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().
Definition at line 1232 of file layer.c.
References blender::compositor::active, ViewLayer::active_collection, ViewLayer::basact, BKE_base_eval_flags(), BKE_layer_collection_activate_parent(), BLI_assert, BLI_assert_msg, BLI_findindex(), BLI_findptr(), BLI_freelistN(), BLI_ghash_remove(), BLI_listbase_count_at_most(), BLI_listbase_is_empty(), BLI_mempool_create(), BLI_mempool_destroy(), BLI_MEMPOOL_NOP, LayerCollection::collection, ListBase::first, g_base_collection_flags, layer_collection_add(), layer_collection_hidden(), layer_collection_resync_create_recurse(), layer_collection_resync_unused_layers_free(), layer_collection_sync(), ViewLayer::layer_collections, LISTBASE_FOREACH, Scene::master_collection, MEM_SAFE_FREE, no_resync, NULL, ViewLayer::object_bases, ViewLayer::object_bases_array, ViewLayer::object_bases_hash, scene, view_layer_bases_hash_create(), and view_layer_objects_base_cache_validate().
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 2248 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_lightgroup_membership_get | ( | struct LightgroupMembership * | lgm, |
char * | name | ||
) |
Definition at line 2624 of file layer.c.
References BLI_strncpy(), ViewLayerLightgroup::name, LightgroupMembership::name, and NULL.
int BKE_lightgroup_membership_length | ( | struct LightgroupMembership * | lgm | ) |
Definition at line 2634 of file layer.c.
References LightgroupMembership::name, and NULL.
void BKE_lightgroup_membership_set | ( | struct LightgroupMembership ** | lgm, |
const char * | name | ||
) |
Definition at line 2642 of file layer.c.
References BLI_strncpy(), MEM_callocN, MEM_freeN, ViewLayerLightgroup::name, and NULL.
Definition at line 1347 of file layer.c.
References BKE_layer_collection_local_sync_all(), BKE_scene_collection_sync(), ListBase::first, Scene::id, ID::next, no_resync, scene, and Main::scenes.
Referenced by BKE_main_collection_sync_remap().
Definition at line 1365 of file layer.c.
References BKE_collection_object_cache_free(), BKE_main_collection_sync(), BLI_ghash_free(), LayerCollectionResync::collection, Main::collections, DEG_id_tag_update_ex(), ListBase::first, Collection::id, Scene::id, ID_RECALC_COPY_ON_WRITE, LISTBASE_FOREACH, Scene::master_collection, MEM_SAFE_FREE, ID::next, no_resync, NULL, scene, Main::scenes, view_layer_bases_hash_create(), and Scene::view_layers.
Definition at line 1534 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_HIDE_VIEWPORT, View3D::object_type_exclude_viewport, Object::runtime, Object::type, V3D_LOCAL_COLLECTIONS, and Object::visibility_flag.
Definition at line 1336 of file layer.c.
References BKE_layer_collection_sync(), LISTBASE_FOREACH, no_resync, 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 1895 of file layer.c.
References BKE_view_layer_base_find(), LISTBASE_FOREACH, scene, and Scene::view_layers.
Referenced by ED_editors_init(), and scene_drop_invoke().
ViewLayer* BKE_view_layer_add | ( | struct Scene * | scene, |
const char * | name, | ||
struct ViewLayer * | view_layer_source, | ||
int | type | ||
) |
Add a new view layer by default, a view layer has the master collection.
Definition at line 185 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 2421 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().
struct ViewLayerLightgroup* BKE_view_layer_add_lightgroup | ( | struct ViewLayer * | view_layer, |
const char * | name | ||
) |
Definition at line 2544 of file layer.c.
References BLI_addtail(), BLI_strncpy(), DATA_, ViewLayer::lightgroups, MEM_callocN, ViewLayerLightgroup::name, viewlayer_lightgroup_active_set(), and viewlayer_lightgroup_make_name_unique().
Referenced by view_layer_add_lightgroup_exec(), and view_layer_add_used_lightgroups_exec().
Definition at line 388 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(), blender::io::usd::import_endjob(), import_endjob(), blender::io::obj::importer_main(), blender::io::stl::importer_main(), make_local_exec(), object_add_common(), object_transfer_mode_to_base(), select_marker_camera_switch(), tree_element_object_activate(), view3d_collection_drop_copy_external_asset(), view3d_ob_drop_copy_external_asset(), and wm_link_append_exec().
Definition at line 379 of file layer.c.
References BLI_ghash_lookup(), ViewLayer::object_bases_hash, and view_layer_bases_hash_create().
Referenced by 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(), clear_override_library_exec(), 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(), duplicate_exec(), 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(), blender::io::obj::geometry_to_blender_objects(), getTransformOrientation_ex(), gpencil_layer_to_curve(), id_override_library_clear_single_fn(), blender::io::usd::import_endjob(), import_endjob(), blender::io::stl::importer_main(), jump_to_target_ptr(), layer_collection_bases_hide_recursive(), layer_collection_bases_show_recursive(), layer_collection_local_sync(), lib_override_library_create_post_process(), loose_data_instantiate_collection_process(), loose_data_instantiate_object_base_instance_init(), make_local_all__instance_indirect_unused(), make_object_duplilist_real(), object_add_duplicate_internal(), 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(), override_idtemplate_clear_exec(), 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(), validate_object_select_id(), view3d_collection_drop_copy_external_asset(), and view3d_ob_drop_copy_external_asset().
Definition at line 397 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(), blender::io::obj::geometry_to_blender_objects(), blender::io::usd::import_endjob(), import_endjob(), blender::io::stl::importer_main(), object_transfer_mode_to_base(), view3d_collection_drop_copy_external_asset(), and view3d_ob_drop_copy_external_asset().
void BKE_view_layer_bases_in_mode_iterator_begin | ( | BLI_Iterator * | iter, |
void * | data_in | ||
) |
Definition at line 2136 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 2162 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 2315 of file layer.c.
References ViewLayer::active_aov, ViewLayer::active_collection, ViewLayer::active_lightgroup, 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, ViewLayer::lightgroups, 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 2357 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 2273 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, ViewLayer::lightgroups, 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 311 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().
Definition at line 148 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 | ||
) |
Definition at line 482 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(), layer_lightgroup_copy_data(), LIB_ID_CREATE_NO_USER_REFCOUNT, ViewLayer::lightgroups, 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 125 of file layer.c.
References BLI_assert, ListBase::first, LISTBASE_FOREACH, scene, VIEW_LAYER_RENDER, and Scene::view_layers.
Definition at line 113 of file layer.c.
References BLI_assert, ListBase::first, LISTBASE_FOREACH, scene, VIEW_LAYER_RENDER, and Scene::view_layers.
Definition at line 137 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 | ||
) |
Definition at line 322 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 2503 of file layer.c.
References BLI_findindex(), LISTBASE_FOREACH, NULL, scene, and Scene::view_layers.
ViewLayer* BKE_view_layer_find_with_lightgroup | ( | struct Scene * | scene, |
struct ViewLayerLightgroup * | lightgroup | ||
) |
Definition at line 2581 of file layer.c.
References BLI_findindex(), LISTBASE_FOREACH, NULL, scene, and Scene::view_layers.
Definition at line 239 of file layer.c.
References BKE_view_layer_free_ex().
Referenced by ED_scene_view_layer_delete().
Free (or release) any data used by this ViewLayer.
Definition at line 244 of file layer.c.
References ViewLayer::active_aov, ViewLayer::active_lightgroup, 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, ViewLayer::lightgroups, 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 | ( | const ViewLayer * | view_layer, |
const Collection * | collection | ||
) |
Definition at line 1890 of file layer.c.
References BKE_layer_collection_first_from_scene_collection(), LayerCollectionResync::collection, and NULL.
Check if the given view layer has at least one valid AOV.
Definition at line 2493 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 2433 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_remove_lightgroup | ( | ViewLayer * | view_layer, |
ViewLayerLightgroup * | lightgroup | ||
) |
Definition at line 2561 of file layer.c.
References ViewLayer::active_lightgroup, BLI_assert, BLI_findindex(), BLI_freelinkN(), ViewLayer::lightgroups, ViewLayerLightgroup::next, NULL, ViewLayerLightgroup::prev, and viewlayer_lightgroup_active_set().
Referenced by view_layer_remove_lightgroup_exec(), and view_layer_remove_unused_lightgroups_exec().
void BKE_view_layer_rename | ( | Main * | bmain, |
Scene * | scene, | ||
ViewLayer * | view_layer, | ||
const char * | newname | ||
) |
Definition at line 534 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_rename_lightgroup | ( | Scene * | scene, |
ViewLayer * | view_layer, | ||
ViewLayerLightgroup * | lightgroup, | ||
const char * | name | ||
) |
Definition at line 2592 of file layer.c.
References BLI_strncpy_utf8(), FOREACH_SCENE_OBJECT_BEGIN, FOREACH_SCENE_OBJECT_END, ID_IS_LINKED, World::lightgroup, ViewLayerLightgroup::name, LightgroupMembership::name, NULL, scene, STREQ, viewlayer_lightgroup_make_name_unique(), and Scene::world.
void BKE_view_layer_selected_bases_iterator_begin | ( | BLI_Iterator * | iter, |
void * | data_in | ||
) |
Definition at line 2088 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 2098 of file layer.c.
References object_bases_iterator_end().
void BKE_view_layer_selected_bases_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 2093 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 2054 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 2077 of file layer.c.
References objects_iterator_end().
void BKE_view_layer_selected_editable_objects_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 2068 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 2012 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 2022 of file layer.c.
References objects_iterator_end().
void BKE_view_layer_selected_objects_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 2017 of file layer.c.
References BASE_SELECTED, BASE_VISIBLE_DEPSGRAPH, and objects_iterator_next().
Tag all the selected objects of a render-layer.
Definition at line 286 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 2448 of file layer.c.
References viewlayer_aov_active_set().
void BKE_view_layer_set_active_lightgroup | ( | ViewLayer * | view_layer, |
ViewLayerLightgroup * | lightgroup | ||
) |
Definition at line 2576 of file layer.c.
References viewlayer_lightgroup_active_set().
void BKE_view_layer_verify_aov | ( | struct RenderEngine * | engine, |
struct Scene * | scene, | ||
struct ViewLayer * | view_layer | ||
) |
Update the naming and conflicts of the AOVs.
Name must be unique between all AOVs. Conflicts with render passes will show a conflict icon. Reason is that switching a render engine or activating a render pass could lead to other conflicts that wouldn't be that clear for the user.
Definition at line 2476 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 2453 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 2109 of file layer.c.
References object_bases_iterator_begin().
void BKE_view_layer_visible_bases_iterator_end | ( | BLI_Iterator * | iter | ) |
Definition at line 2119 of file layer.c.
References object_bases_iterator_end().
void BKE_view_layer_visible_bases_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 2114 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 2033 of file layer.c.
References objects_iterator_begin().
void BKE_view_layer_visible_objects_iterator_end | ( | BLI_Iterator * | iter | ) |
Definition at line 2043 of file layer.c.
References objects_iterator_end().
void BKE_view_layer_visible_objects_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 2038 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 583 of file layer.c.
References LISTBASE_FOREACH, and NULL.
Referenced by BKE_layer_collection_from_index().
|
static |
Definition at line 2298 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 1861 of file layer.c.
References LayerCollectionResync::collection, LayerCollection::collection, LayerCollection::layer_collections, LISTBASE_FOREACH, and NULL.
Referenced by BKE_layer_collection_first_from_scene_collection().
|
static |
Definition at line 298 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 696 of file layer.c.
References LISTBASE_FOREACH.
Referenced by BKE_layer_collection_findindex().
|
static |
Definition at line 411 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 71 of file layer.c.
References BLI_addtail(), LayerCollection::collection, LayerCollection::local_collections_bits, and MEM_callocN.
Referenced by BKE_layer_collection_doversion_2_80(), BKE_layer_collection_sync(), and layer_collection_sync().
|
static |
Definition at line 1778 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 1765 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 176 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 1820 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 1569 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 1577 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 81 of file layer.c.
References ViewLayer::active_collection, BLI_freelistN(), LayerCollection::layer_collections, LISTBASE_FOREACH, and NULL.
Referenced by BKE_view_layer_free_ex().
|
static |
Determine if a collection is hidden, viewport visibility restricted, or excluded
Definition at line 605 of file layer.c.
References BKE_layer_collection_first_from_scene_collection(), CollectionParent::collection, LayerCollection::collection, COLLECTION_HIDE_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 1651 of file layer.c.
References BKE_view_layer_base_find(), LayerCollection::collection, Collection::gobject, LAYER_COLLECTION_EXCLUDE, LayerCollection::layer_collections, LISTBASE_FOREACH, Base::local_collections_bits, LayerCollection::local_collections_bits, and NULL.
Referenced by BKE_layer_collection_local_sync().
|
static |
Definition at line 1633 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 1642 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 959 of file layer.c.
References BASE_ENABLED_RENDER, BASE_ENABLED_VIEWPORT, BASE_HOLDOUT, BASE_INDIRECT_ONLY, BASE_SELECTABLE, BASE_VISIBLE_DEPSGRAPH, BASE_VISIBLE_VIEWLAYER, BLI_addtail(), BLI_ghash_ensure_p(), BLI_remlink(), LayerCollection::collection, COLLECTION_HIDE_RENDER, COLLECTION_HIDE_SELECT, COLLECTION_HIDE_VIEWPORT, ELEM, ListBase::first, LayerCollection::flag, Base::flag_from_collection, Collection::gobject, id_lib_indirect_weak_link(), ListBase::last, LayerCollectionResync::layer, LAYER_COLLECTION_EXCLUDE, LAYER_COLLECTION_HAS_OBJECTS, LAYER_COLLECTION_HIDE, LAYER_COLLECTION_HOLDOUT, LAYER_COLLECTION_INDIRECT_ONLY, LISTBASE_FOREACH, Base::local_collections_bits, NULL, object_base_new(), ViewLayer::object_bases, ViewLayer::object_bases_hash, and LayerCollection::runtime_flag.
Referenced by layer_collection_sync().
|
static |
Definition at line 802 of file layer.c.
References BLI_addtail(), BLI_findptr(), BLI_listbase_is_empty(), BLI_mempool_calloc(), Collection::children, LayerCollectionResync::children_layer_resync, CLOG_INFO, LayerCollectionResync::collection, LayerCollection::collection, Collection::id, LayerCollectionResync::is_usable, LayerCollectionResync::is_used, LayerCollectionResync::is_valid_as_child, LayerCollectionResync::is_valid_as_parent, LayerCollectionResync::layer, LayerCollection::layer_collections, LISTBASE_FOREACH, LOG, ID::name, NULL, and LayerCollectionResync::parent_layer_resync.
Referenced by BKE_layer_collection_sync().
|
static |
Definition at line 854 of file layer.c.
References BLI_assert, LayerCollectionResync::children_layer_resync, LayerCollectionResync::collection, LayerCollectionResync::is_used, LayerCollectionResync::is_valid_as_child, LISTBASE_FOREACH, NULL, LayerCollectionResync::parent_layer_resync, and LayerCollectionResync::queue_next.
Referenced by layer_collection_sync().
|
static |
Definition at line 931 of file layer.c.
References ViewLayer::active_collection, LayerCollectionResync::children_layer_resync, CLOG_INFO, LayerCollectionResync::collection, Collection::id, LayerCollectionResync::is_usable, LayerCollectionResync::is_used, LayerCollectionResync::layer, LISTBASE_FOREACH, LOG, MEM_freeN, ID::name, and NULL.
Referenced by BKE_layer_collection_sync().
|
static |
Definition at line 1026 of file layer.c.
References BLI_addtail(), BLI_assert, BLI_listbase_count(), BLI_mempool_calloc(), BLI_remlink(), Collection::children, LayerCollectionResync::children_layer_resync, CLOG_INFO, LayerCollectionResync::collection, COLLECTION_HIDE_VIEWPORT, COLLECTION_IS_MASTER, Collection::flag, LayerCollection::flag, Collection::id, id_lib_indirect_weak_link(), LayerCollectionResync::is_usable, LayerCollectionResync::is_used, LayerCollectionResync::is_valid_as_child, LayerCollectionResync::is_valid_as_parent, LayerCollectionResync::layer, layer_collection_add(), LAYER_COLLECTION_EXCLUDE, LAYER_COLLECTION_HIDE, LAYER_COLLECTION_HIDE_VIEWPORT, layer_collection_objects_sync(), layer_collection_resync_find(), LAYER_COLLECTION_VISIBLE_VIEW_LAYER, LayerCollection::layer_collections, LISTBASE_FOREACH, LayerCollection::local_collections_bits, LOG, ID::name, NULL, LayerCollectionResync::parent_layer_resync, and LayerCollection::runtime_flag.
Referenced by BKE_layer_collection_sync().
|
static |
Definition at line 457 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 2231 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 434 of file layer.c.
References ViewLayer::active_lightgroup, BLI_assert, BLI_duplicatelist(), ListBase::first, ViewLayerLightgroup::next, and NULL.
Referenced by BKE_view_layer_copy_data().
|
static |
Definition at line 2341 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 94 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_objects_sync().
|
static |
Definition at line 1932 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 1977 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 1919 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 1960 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 1982 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 2000 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 1991 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 154 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_LAY_FLAG_DEFAULT, SCE_PASS_COMBINED, VIEW_LAYER_CRYPTOMATTE_ACCURATE, VIEW_LAYER_FREESTYLE, and VIEW_LAYER_RENDER.
Referenced by BKE_view_layer_add().
|
static |
Definition at line 335 of file layer.c.
References ViewLayer::basact, BLI_freelinkN(), BLI_ghash_ensure_p(), BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), BLI_MUTEX_INITIALIZER, BLI_mutex_lock(), BLI_mutex_unlock(), CLOG_FATAL, hash, LISTBASE_FOREACH_MUTABLE, LOG, NULL, ViewLayer::object_bases, and ViewLayer::object_bases_hash.
Referenced by BKE_layer_collection_sync(), BKE_main_collection_sync_remap(), and BKE_view_layer_base_find().
|
static |
Definition at line 1170 of file layer.c.
References BLI_ghash_lookup(), CLOG_FATAL, LayerCollection::collection, ListBase::first, LayerCollection::flag, Collection::gobject, Collection::id, is_valid, LayerCollectionResync::layer, LAYER_COLLECTION_EXCLUDE, LayerCollection::layer_collections, ViewLayer::layer_collections, LISTBASE_FOREACH, LOG, ID::name, NULL, and ViewLayer::object_bases_hash.
Referenced by BKE_layer_collection_sync().
|
static |
Definition at line 2410 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().
Definition at line 2396 of file layer.c.
References ViewLayer::active_aov, ViewLayer::aovs, BLI_str_replace_char(), 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 2533 of file layer.c.
References ViewLayer::active_lightgroup, BLI_assert, BLI_findindex(), ViewLayer::lightgroups, and NULL.
Referenced by BKE_view_layer_add_lightgroup(), BKE_view_layer_remove_lightgroup(), and BKE_view_layer_set_active_lightgroup().
|
static |
Definition at line 2519 of file layer.c.
References BLI_str_replace_char(), BLI_uniquename(), DATA_, ViewLayer::lightgroups, ViewLayerAOV::name, and ViewLayerLightgroup::name.
Referenced by BKE_view_layer_add_lightgroup(), and BKE_view_layer_rename_lightgroup().
|
static |
Definition at line 2264 of file layer.c.
References BLO_write_struct, and LISTBASE_FOREACH.
Referenced by BKE_view_layer_blend_write().
|
static |
Definition at line 59 of file layer.c.
Referenced by BKE_base_eval_flags(), and BKE_layer_collection_sync().
|
static |
Definition at line 56 of file layer.c.
Referenced by layer_collection_resync_create_recurse(), layer_collection_resync_unused_layers_free(), layer_collection_sync(), view_layer_bases_hash_create(), and view_layer_objects_base_cache_validate().
|
static |
Definition at line 759 of file layer.c.
Referenced by BKE_layer_collection_local_sync(), BKE_layer_collection_local_sync_all(), BKE_layer_collection_resync_allow(), BKE_layer_collection_resync_forbid(), BKE_layer_collection_sync(), BKE_main_collection_sync(), BKE_main_collection_sync_remap(), and BKE_scene_collection_sync().