22 #define DNA_DEPRECATED_ALLOW
146 if (
STREQ(view_layer->name, layer_name)) {
168 name =
DATA_(
"View Layer");
190 for (; sub_collection !=
NULL; sub_collection = sub_collection->
next) {
207 if (view_layer_source) {
208 name = view_layer_source->
name;
222 *view_layer_new = *view_layer_source;
249 sizeof(view_layer_new->
name));
251 return view_layer_new;
280 sled->free(sled->storage);
309 base->object->flag |= tag;
312 base->object->flag &= ~tag;
414 view_layer->
basact = selbase;
426 if (aovs_src !=
NULL) {
433 while (aov_dst !=
NULL) {
439 aov_dst = aov_dst->
next;
440 aov_src = aov_src->
next;
447 const ListBase *layer_collections_src)
454 while (layer_collection_dst !=
NULL) {
464 layer_collection_dst = layer_collection_dst->
next;
465 layer_collection_src = layer_collection_src->
next;
499 if (view_layer_src->
basact == base_src) {
500 view_layer_dst->
basact = base_dst;
515 view_layer_dst, view_layer_src, &view_layer_dst->
aovs, &view_layer_src->
aovs);
524 char oldname[
sizeof(view_layer->
name)];
534 sizeof(view_layer->
name));
542 if (
node->custom1 == index) {
556 if (win->scene ==
scene &&
STREQ(win->view_layer_name, oldname)) {
712 if (i_nested != -1) {
744 short parent_exclude,
745 short parent_restrict,
746 short parent_layer_restrict,
747 unsigned short parent_local_collections_bits)
779 lb_layer_collections, collection, offsetof(
LayerCollection, collection));
787 lc->
flag = parent_exclude;
790 unsigned short local_collections_bits = parent_local_collections_bits &
798 short child_restrict = parent_restrict;
799 short child_layer_restrict = parent_layer_restrict;
801 child_restrict |= collection->
flag;
802 child_layer_restrict |= lc->
flag;
812 child_layer_restrict,
813 local_collections_bits);
834 if (cob->ob ==
NULL) {
849 if (!
ELEM(base, new_object_bases->
first, new_object_bases->
last)) {
904 *lb_layer_collections = new_lb_layer;
936 const ListBase collections = {.
first = &child, .last = &child};
939 const short parent_exclude = 0, parent_restrict = 0, parent_layer_restrict = 0;
946 parent_layer_restrict,
951 if (view_layer->
basact == base) {
1007 if (view_layer->object_bases_hash) {
1009 view_layer->object_bases_hash =
NULL;
1015 collection = collection->id.next) {
1037 bool changed =
false;
1095 if (lc_parent == lc_child) {
1229 lc_parent = lc_iter;
1234 while (lc_parent != lc) {
1239 lc_parent = lc_iter;
1255 const int local_collections_uuid)
1264 const int local_collections_uuid)
1274 const unsigned short local_collections_uuid,
1302 base->local_collections_bits &= ~local_collections_uuid;
1360 lc_parent = lc_iter;
1365 while (lc_parent != lc) {
1370 lc_parent = lc_iter;
1417 const bool hierarchy)
1446 const bool restore_flag)
1509 if (found !=
NULL) {
1557 return (base->
flag != 0);
1574 iter->
valid =
false;
1606 iter->
valid =
false;
1776 iter->
valid =
false;
1779 iter->
data = data_in;
1783 if (
data->object_type < 0) {
1797 if (base ==
data->base_active) {
1799 base =
data->view_layer->object_bases.first;
1816 iter->
valid =
false;
1872 num_object_bases,
sizeof(
Base *),
"view_layer->object_bases_array");
1881 int view_layer_index)
1924 #ifdef USE_COLLECTION_COMPAT_28
1991 if (base->object ==
NULL) {
2071 const char *
UNUSED(chanid),
2074 GHash *name_count = userdata;
void BKE_animdata_fix_paths_rename_all(struct ID *ref_id, const char *prefix, const char *oldName, const char *newName)
void BKE_collection_object_cache_free(struct Collection *collection)
void BKE_freestyle_config_copy(struct FreestyleConfig *new_config, const struct FreestyleConfig *config, const int flag)
void BKE_freestyle_config_free(struct FreestyleConfig *config, const bool do_id_user)
void BKE_freestyle_config_init(struct FreestyleConfig *config)
void IDP_FreeProperty_ex(struct IDProperty *prop, const bool do_id_user)
void IDP_BlendWrite(struct BlendWriter *writer, const struct IDProperty *prop)
void IDP_BlendReadLib(struct BlendLibReader *reader, struct IDProperty *prop)
#define IDP_BlendDataRead(reader, prop)
struct IDProperty * IDP_CopyProperty_ex(const struct IDProperty *prop, const int flag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
@ LIB_ID_CREATE_NO_USER_REFCOUNT
void id_us_plus(struct ID *id)
void id_lib_indirect_weak_link(struct ID *id)
#define CMP_NODE_R_LAYERS
General operations, lookup, etc. for blender objects.
bool BKE_object_is_libdata(const struct Object *ob)
unsigned int BLI_ghashutil_ptrhash(const void *key)
GHash * BLI_ghash_str_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool BLI_ghashutil_ptrcmp(const void *a, const void *b)
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
bool BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) ATTR_WARN_UNUSED_RESULT
void * BLI_ghash_lookup(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void void void void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src) ATTR_NONNULL(1
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findptr(const struct ListBase *listbase, const void *ptr, const int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define STRNCPY(dst, src)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
bool BLI_uniquename(struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t len)
#define BLI_MUTEX_INITIALIZER
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
pthread_mutex_t ThreadMutex
#define POINTER_FROM_INT(i)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define POINTER_AS_INT(i)
#define BLO_read_data_address(reader, ptr_p)
#define BLO_write_struct(writer, struct_name, data_ptr)
void BLO_read_list(BlendDataReader *reader, struct ListBase *list)
#define BLO_read_id_address(reader, lib, id_ptr_p)
#define BLO_write_struct_list(writer, struct_name, list_ptr)
struct Depsgraph Depsgraph
void DEG_debug_print_eval(struct Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address)
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag)
void DEG_id_tag_update(struct ID *id, int flag)
ID and Library types, which are fundamental for sdna.
@ ID_RECALC_COPY_ON_WRITE
Object groups, one object can be in many groups at once.
@ COLLECTION_RESTRICT_RENDER
@ COLLECTION_RESTRICT_VIEWPORT
@ COLLECTION_RESTRICT_SELECT
@ VIEW_LAYER_CRYPTOMATTE_ACCURATE
@ LAYER_COLLECTION_EXCLUDE
@ LAYER_COLLECTION_INDIRECT_ONLY
@ LAYER_COLLECTION_PREVIOUSLY_EXCLUDED
@ LAYER_COLLECTION_HOLDOUT
@ LAYER_COLLECTION_RESTRICT_VIEWPORT
@ LAYER_COLLECTION_VISIBLE_VIEW_LAYER
@ LAYER_COLLECTION_HAS_OBJECTS
Object is a sort of wrapper for general info.
#define BASE_VISIBLE(v3d, base)
#define V3D_LOCAL_COLLECTIONS
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
const Depsgraph * depsgraph
void RE_engine_update_render_passes(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer, update_render_passes_cb_t callback, void *callback_data)
Object * BKE_view_layer_camera_find(ViewLayer *view_layer)
void BKE_view_layer_bases_in_mode_iterator_begin(BLI_Iterator *iter, void *data_in)
void BKE_view_layer_bases_in_mode_iterator_next(BLI_Iterator *iter)
bool BKE_view_layer_has_collection(ViewLayer *view_layer, const Collection *collection)
static void layer_collection_bases_hide_recursive(ViewLayer *view_layer, LayerCollection *lc)
static void layer_aov_copy_data(ViewLayer *view_layer_dst, const ViewLayer *view_layer_src, ListBase *aovs_dst, const ListBase *aovs_src)
void BKE_view_layer_blend_read_data(BlendDataReader *reader, ViewLayer *view_layer)
static bool layer_collection_hidden(ViewLayer *view_layer, LayerCollection *lc)
struct LayerObjectBaseIteratorData LayerObjectBaseIteratorData
static void layer_collection_local_visibility_unset_recursive(LayerCollection *layer_collection, const int local_collections_uuid)
static void layer_collection_free(ViewLayer *view_layer, LayerCollection *lc)
static LayerCollection * find_layer_collection_by_scene_collection(LayerCollection *lc, const Collection *collection)
static void layer_collection_flag_set_recursive(LayerCollection *lc, const int flag)
bool BKE_view_layer_has_valid_aov(ViewLayer *view_layer)
static void object_bases_iterator_end(BLI_Iterator *iter)
void BKE_view_layer_bases_in_mode_iterator_end(BLI_Iterator *UNUSED(iter))
bool BKE_object_is_visible_in_viewport(const View3D *v3d, const struct Object *ob)
void BKE_view_layer_visible_bases_iterator_begin(BLI_Iterator *iter, void *data_in)
static void layer_collection_exclude_all(LayerCollection *layer_collection)
static int collection_count(ListBase *lb)
void BKE_main_collection_sync_remap(const Main *bmain)
static void object_bases_iterator_begin(BLI_Iterator *iter, void *data_in_v, const int flag)
void BKE_layer_collection_set_visible(ViewLayer *view_layer, LayerCollection *lc, const bool visible, const bool hierarchy)
LayerCollection * BKE_layer_collection_from_index(ViewLayer *view_layer, const int index)
int BKE_layer_collection_count(ViewLayer *view_layer)
ViewLayer * BKE_view_layer_find_with_aov(struct Scene *scene, struct ViewLayerAOV *aov)
static void layer_collection_sync(ViewLayer *view_layer, const ListBase *lb_collections, ListBase *lb_layer_collections, ListBase *new_object_bases, short parent_exclude, short parent_restrict, short parent_layer_restrict, unsigned short parent_local_collections_bits)
void BKE_view_layer_selected_editable_objects_iterator_begin(BLI_Iterator *iter, void *data_in)
static ViewLayer * view_layer_add(const char *name)
static void view_layer_bases_hash_create(ViewLayer *view_layer)
static int index_from_collection(ListBase *lb, const LayerCollection *lc, int *i)
void BKE_view_layer_set_active_aov(ViewLayer *view_layer, ViewLayerAOV *aov)
void BKE_view_layer_remove_aov(ViewLayer *view_layer, ViewLayerAOV *aov)
void BKE_view_layer_selected_editable_objects_iterator_end(BLI_Iterator *iter)
static void viewlayer_aov_active_set(ViewLayer *view_layer, ViewLayerAOV *aov)
LayerCollection * BKE_layer_collection_activate_parent(ViewLayer *view_layer, LayerCollection *lc)
void BKE_view_layer_selected_objects_iterator_begin(BLI_Iterator *iter, void *data_in)
static void layer_collection_flag_recursive_set(LayerCollection *lc, const int flag, const bool value, const bool restore_flag)
static bool find_scene_collection_in_scene_collections(ListBase *lb, const LayerCollection *lc)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
void BKE_view_layer_visible_bases_iterator_end(BLI_Iterator *iter)
bool BKE_layer_collection_has_selected_objects(ViewLayer *view_layer, LayerCollection *lc)
static void layer_eval_view_layer(struct Depsgraph *depsgraph, struct Scene *UNUSED(scene), ViewLayer *view_layer)
void BKE_view_layer_selected_objects_iterator_end(BLI_Iterator *iter)
void BKE_layer_collection_set_flag(LayerCollection *lc, const int flag, const bool value)
void BKE_view_layer_selected_editable_objects_iterator_next(BLI_Iterator *iter)
void BKE_view_layer_blend_read_lib(BlendLibReader *reader, Library *lib, ViewLayer *view_layer)
ViewLayer * BKE_view_layer_default_view(const Scene *scene)
void BKE_view_layer_free_ex(ViewLayer *view_layer, const bool do_id_user)
static void direct_link_layer_collections(BlendDataReader *reader, ListBase *lb, bool master)
static LayerCollection * layer_collection_add(ListBase *lb_parent, Collection *collection)
ViewLayer * BKE_view_layer_add(Scene *scene, const char *name, ViewLayer *view_layer_source, const int type)
static const short g_base_collection_flags
static void layer_collection_local_visibility_set_recursive(LayerCollection *layer_collection, const int local_collections_uuid)
static void lib_link_layer_collection(BlendLibReader *reader, Library *lib, LayerCollection *layer_collection, bool master)
LayerCollection * BKE_layer_collection_get_active(ViewLayer *view_layer)
void BKE_view_layer_selected_bases_iterator_next(BLI_Iterator *iter)
static void write_layer_collections(BlendWriter *writer, ListBase *lb)
ViewLayer * BKE_view_layer_default_render(const Scene *scene)
bool BKE_base_is_visible(const View3D *v3d, const Base *base)
void BKE_view_layer_verify_aov(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
void BKE_scene_collection_sync(const Scene *scene)
void BKE_view_layer_visible_objects_iterator_end(BLI_Iterator *iter)
void BKE_view_layer_selected_bases_iterator_end(BLI_Iterator *iter)
void BKE_view_layer_rename(Main *bmain, Scene *scene, ViewLayer *view_layer, const char *newname)
void BKE_base_set_visible(Scene *scene, ViewLayer *view_layer, Base *base, bool extend)
static void objects_iterator_next(BLI_Iterator *iter, const int flag)
void BKE_layer_collection_local_sync(ViewLayer *view_layer, const View3D *v3d)
static void layer_collection_flag_unset_recursive(LayerCollection *lc, const int flag)
bool BKE_layer_collection_has_layer_collection(LayerCollection *lc_parent, LayerCollection *lc_child)
void BKE_layer_collection_isolate_global(Scene *scene, ViewLayer *view_layer, LayerCollection *lc, bool extend)
static void bke_view_layer_verify_aov_cb(void *userdata, Scene *UNUSED(scene), ViewLayer *UNUSED(view_layer), const char *name, int UNUSED(channels), const char *UNUSED(chanid), eNodeSocketDatatype UNUSED(type))
static LayerCollection * collection_from_index(ListBase *lb, const int number, int *i)
static void layer_collection_bases_show_recursive(ViewLayer *view_layer, LayerCollection *lc)
void BKE_layer_eval_view_layer_indexed(struct Depsgraph *depsgraph, struct Scene *scene, int view_layer_index)
static void objects_iterator_end(BLI_Iterator *iter)
ViewLayer * BKE_view_layer_find(const Scene *scene, const char *layer_name)
bool BKE_scene_has_object(Scene *scene, Object *ob)
void BKE_layer_collection_isolate_local(ViewLayer *view_layer, const View3D *v3d, LayerCollection *lc, bool extend)
void BKE_main_collection_sync(const Main *bmain)
void BKE_view_layer_free(ViewLayer *view_layer)
LayerCollection * BKE_layer_collection_first_from_scene_collection(ViewLayer *view_layer, const Collection *collection)
static void viewlayer_aov_make_name_unique(ViewLayer *view_layer)
void BKE_view_layer_visible_objects_iterator_begin(BLI_Iterator *iter, void *data_in)
static Base * object_base_new(Object *ob)
static bool object_bases_iterator_is_valid(const View3D *v3d, Base *base, const int flag)
void BKE_view_layer_selected_objects_tag(ViewLayer *view_layer, const int tag)
ViewLayer * BKE_view_layer_find_from_collection(const Scene *scene, LayerCollection *lc)
static void layer_collection_local_sync(ViewLayer *view_layer, LayerCollection *layer_collection, const unsigned short local_collections_uuid, bool visible)
void BKE_view_layer_base_select_and_set_active(struct ViewLayer *view_layer, Base *selbase)
static void layer_collections_copy_data(ViewLayer *view_layer_dst, const ViewLayer *view_layer_src, ListBase *layer_collections_dst, const ListBase *layer_collections_src)
void BKE_view_layer_base_deselect_all(ViewLayer *view_layer)
void BKE_view_layer_selected_bases_iterator_begin(BLI_Iterator *iter, void *data_in)
static void object_bases_iterator_next(BLI_Iterator *iter, const int flag)
static void objects_iterator_begin(BLI_Iterator *iter, void *data_in, const int flag)
bool BKE_layer_collection_objects_select(ViewLayer *view_layer, LayerCollection *lc, bool deselect)
void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer)
int BKE_layer_collection_findindex(ViewLayer *view_layer, const LayerCollection *lc)
ViewLayer * BKE_view_layer_context_active_PLACEHOLDER(const Scene *scene)
bool BKE_layer_collection_activate(ViewLayer *view_layer, LayerCollection *lc)
void BKE_base_eval_flags(Base *base)
void BKE_view_layer_copy_data(Scene *scene_dst, const Scene *UNUSED(scene_src), ViewLayer *view_layer_dst, const ViewLayer *view_layer_src, const int flag)
void BKE_view_layer_visible_bases_iterator_next(BLI_Iterator *iter)
void BKE_layer_collection_local_sync_all(const Main *bmain)
struct ViewLayerAOV * BKE_view_layer_add_aov(struct ViewLayer *view_layer)
void BKE_view_layer_blend_write(BlendWriter *writer, ViewLayer *view_layer)
void BKE_view_layer_visible_objects_iterator_next(BLI_Iterator *iter)
static bool base_is_in_mode(struct ObjectsInModeIteratorData *data, Base *base)
void BKE_view_layer_selected_objects_iterator_next(BLI_Iterator *iter)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
bool active
all scheduled work for the GPU.
short flag_from_collection
unsigned short local_view_bits
unsigned short local_collections_bits
struct CollectionChild * next
struct Collection * collection
struct LayerCollection * next
ListBase layer_collections
unsigned short local_collections_bits
struct Collection * collection
unsigned short local_collections_bits
unsigned short base_local_view_bits
struct ViewLayer * view_layer
const struct View3D * v3d
struct ViewLayer * view_layer
struct bNodeTree * nodetree
struct Collection * master_collection
unsigned short local_view_uuid
unsigned short local_collections_uuid
int object_type_exclude_viewport
struct ViewLayerAOV * prev
struct ViewLayerAOV * next
struct FreestyleConfig freestyle_config
struct IDProperty * id_properties
ViewLayerAOV * active_aov
ListBase layer_collections
LayerCollection * active_collection
struct GHash * object_bases_hash
struct Base ** object_bases_array
struct SceneStats * stats
float pass_alpha_threshold
struct Material * mat_override