58 const Scene *scene = id_cast<const Scene *>(ptr->owner_id);
67static void rna_ViewLayer_active_layer_collection_set(
PointerRNA *ptr,
71 const Scene *scene = id_cast<const Scene *>(ptr->owner_id);
85 const Scene *scene = id_cast<Scene *>(ptr->owner_id);
94static void rna_LayerObjects_active_object_set(
PointerRNA *ptr,
98 const Scene *scene = id_cast<Scene *>(ptr->owner_id);
106 if (basact_test !=
nullptr) {
107 view_layer->basact = basact_test;
112 "ViewLayer '%s' does not contain object '%s'",
118 view_layer->basact =
nullptr;
124 const size_t r_rna_path_maxncpy)
126 char name_esc[
sizeof(view_layer->name) * 2];
129 return BLI_snprintf_rlen(r_rna_path, r_rna_path_maxncpy,
"view_layers[\"%s\"]", name_esc);
132static std::optional<std::string> rna_ViewLayer_path(
const PointerRNA *ptr)
135 char rna_path[
sizeof(view_layer->name) * 3];
160 if (v3d->local_collections_uid & layer_collection->local_collections_bits) {
167static void rna_ViewLayer_update_render_passes(
ID *
id,
Main *bmain)
169 Scene *scene = id_cast<Scene *>(
id);
174 if (engine_type->update_render_passes) {
177 for (
ViewLayer &view_layer : scene->view_layers) {
209 ID *
id = ptr->owner_id;
211 Scene *scene = id_cast<Scene *>(
id);
235static void rna_ViewLayer_update_tagged(
ID *id_ptr,
240 Scene *scene = id_cast<Scene *>(id_ptr);
269 Base *base =
static_cast<Base *
>(ptr->data);
283static void rna_LayerCollection_name_get(
PointerRNA *ptr,
char *value)
286 strcpy(value,
id->name + 2);
289int rna_LayerCollection_name_length(
PointerRNA *ptr)
292 return strlen(
id->name + 2);
295static void rna_LayerCollection_flag_set(
PointerRNA *ptr,
300 Collection *collection = layer_collection->collection;
307 layer_collection->flag |= flag;
310 layer_collection->flag &= ~flag;
314static void rna_LayerCollection_exclude_set(
PointerRNA *ptr,
bool value)
319static void rna_LayerCollection_holdout_set(
PointerRNA *ptr,
bool value)
324static void rna_LayerCollection_indirect_only_set(
PointerRNA *ptr,
bool value)
329static void rna_LayerCollection_hide_viewport_set(
PointerRNA *ptr,
bool value)
336 Scene *scene = id_cast<Scene *>(ptr->owner_id);
365 Scene *scene = id_cast<Scene *>(ptr->owner_id);
382static bool rna_LayerCollection_has_selected_objects(
LayerCollection *lc,
386 for (
Scene &scene : bmain->scenes) {
387 for (
ViewLayer &scene_view_layer : scene.view_layers) {
388 if (&scene_view_layer == view_layer) {
398 Scene *scene = id_cast<Scene *>(ptr->owner_id);
410 Scene *scene = id_cast<Scene *>(ptr->owner_id);
427static bool rna_LayerCollection_children_lookupstring(
PointerRNA *ptr,
431 Scene *scene = id_cast<Scene *>(ptr->owner_id);
440 if (
STREQ(child.collection->id.name + 2, key)) {
474 prop,
"Name",
"Name of this layer collection (same as its collection one)");
476 prop,
"rna_LayerCollection_name_get",
"rna_LayerCollection_name_length",
nullptr);
484 "rna_LayerCollection_children_begin",
489 "rna_LayerCollection_children_lookupint",
490 "rna_LayerCollection_children_lookupstring",
518 "Objects in collection only contribute indirectly (through shadows and reflections) "
519 "in the view layer");
530 func =
RNA_def_function(srna,
"visible_get",
"rna_LayerCollection_visible_get");
532 "Whether this collection is visible, take into account the "
533 "collection parent and the viewport");
544 "Whether this collection is visible for the view layer, take into "
545 "account the collection parent");
547 func =
RNA_def_function(srna,
"has_objects",
"rna_LayerCollection_has_objects");
552 srna,
"has_selected_objects",
"rna_LayerCollection_has_selected_objects");
556 func,
"view_layer",
"ViewLayer",
"",
"View layer the layer collection belongs to");
574 "rna_LayerObjects_active_object_get",
575 "rna_LayerObjects_active_object_set",
588 "rna_LayerObjects_selected_begin",
589 "rna_iterator_listbase_next",
590 "rna_iterator_listbase_end",
591 "rna_ViewLayer_objects_get",
609 "An object instance in a View Layer (currently never exposed in Python API)");
647 func =
RNA_def_function(srna,
"update_render_passes",
"rna_ViewLayer_update_render_passes");
649 "Requery the enabled render passes from the render engine");
659 "Root of collections hierarchy of this view layer, "
660 "its 'collection' pointer property is the same as the scene's master collection");
665 "rna_ViewLayer_active_layer_collection_get",
666 "rna_ViewLayer_active_layer_collection_set",
671 prop,
"Active Layer Collection",
"Active layer collection in this view layer's hierarchy");
681 "rna_ViewLayer_objects_get",
700 "Has export collections",
701 "At least one Collection in this View Layer has an exporter");
722 prop,
"Grease Pencil",
"Deliver Grease Pencil render result in a separate pass");
729 func,
"Update data tagged to be updated from previous access to data or operators");
#define FOREACH_OBJECT_END
#define FOREACH_OBJECT_BEGIN(_bmain, _scene, _view_layer, _instance)
#define BPy_BEGIN_ALLOW_THREADS
#define BPy_END_ALLOW_THREADS
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
#define ND_RENDER_OPTIONS
void base_select(Base *base, eObjectSelect_Mode mode)
void base_active_refresh(Main *bmain, Scene *scene, ViewLayer *view_layer)
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void BKE_ntree_update(Main &bmain, std::optional< Span< bNodeTree * > > modified_trees=std::nullopt, const NodeTreeUpdateExtraParams ¶ms={})
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
bool BKE_layer_collection_activate(ViewLayer *view_layer, LayerCollection *lc)
void rna_def_freestyle_settings(BlenderRNA *brna)
void BKE_ntree_update_tag_id_changed(Main *bmain, ID *id)
Depsgraph * BKE_scene_get_depsgraph(const Scene *scene, const ViewLayer *view_layer)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
PointerRNA RNA_id_pointer_create(ID *id)
void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, bool scene)
void RNA_def_view_layer(BlenderRNA *brna)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_struct_system_idprops_func(StructRNA *srna, const char *system_idproperties)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_flag_hide_from_ui_workaround(PropertyRNA *prop)
void rna_pointer_create_with_ancestors(const PointerRNA &parent, StructRNA *type, void *data, PointerRNA &r_ptr)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void BKE_view_layer_remove_aov(ViewLayer *view_layer, ViewLayerAOV *aov)
@ GREASE_PENCIL_AS_SEPARATE_PASS
int BKE_layer_collection_findindex(ViewLayer *view_layer, const LayerCollection *lc)
void DEG_make_active(Depsgraph *depsgraph)
void BKE_view_layer_need_resync_tag(ViewLayer *view_layer)
size_t BLI_snprintf_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
void RNA_define_animate_sdna(bool animate)
static void rna_def_layer_objects(BlenderRNA *brna, PropertyRNA *cprop)
ViewLayer * CTX_data_view_layer(const bContext *C)
void BKE_layer_collection_set_flag(LayerCollection *lc, eLayerCollection_Flag flag, bool value)
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
@ PROPOVERRIDE_NO_COMPARISON
void RE_engine_free(RenderEngine *engine)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
LayerCollection * BKE_view_layer_active_collection_get(ViewLayer *view_layer)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
@ VIEW_LAYER_HAS_EXPORT_COLLECTIONS
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
@ LAYER_COLLECTION_INDIRECT_ONLY
@ LAYER_COLLECTION_EXCLUDE
@ LAYER_COLLECTION_HOLDOUT
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void BKE_view_layer_verify_aov(RenderEngine *engine, Scene *scene, ViewLayer *view_layer)
char char size_t BLI_str_escape(char *__restrict dst, StringRef src, size_t dst_maxncpy) ATTR_NONNULL(1)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
@ LAYER_COLLECTION_VISIBLE_VIEW_LAYER
@ LAYER_COLLECTION_HIDE_VIEWPORT
@ LAYER_COLLECTION_HAS_OBJECTS
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void BKE_scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain)
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
ViewLayer * BKE_view_layer_find_from_collection(const Scene *scene, LayerCollection *lc)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
static void rna_def_object_base(BlenderRNA *brna)
RenderEngineType * RE_engines_find(const char *idname)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_struct_idprops_func(StructRNA *srna, const char *idproperties)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
RenderEngine * RE_engine_create(RenderEngineType *type)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
ID_Type GS(const char *name)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
void DEG_relations_tag_update(Main *bmain)
Scene * CTX_data_scene(const bContext *C)
Depsgraph * BKE_scene_ensure_depsgraph(Main *bmain, Scene *scene, ViewLayer *view_layer)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
bool DEG_is_evaluating(const Depsgraph *depsgraph)
size_t rna_ViewLayer_path_buffer_get(const ViewLayer *view_layer, char *r_rna_path, const size_t r_rna_path_maxncpy)
bool BKE_layer_collection_has_selected_objects(const Main &bmain, const Scene *scene, ViewLayer *view_layer, LayerCollection *lc)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
static void rna_def_layer_collection(BlenderRNA *brna)
ListBaseT< Base > * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
View3D * CTX_wm_view3d(const bContext *C)
ListBaseT< LayerCollection > layer_collections
struct IDProperty * id_properties
struct IDProperty * system_properties