Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_layer.c
| Show First 20 Lines • Show All 311 Lines • ▼ Show 20 Lines | |||||
| #define RNA_LAYER_MODE_PAINT_WEIGHT_GET_SET_BOOL(_NAME_) \ | #define RNA_LAYER_MODE_PAINT_WEIGHT_GET_SET_BOOL(_NAME_) \ | ||||
| RNA_LAYER_ENGINE_GET_SET(bool, PaintWeightMode, COLLECTION_MODE_PAINT_WEIGHT, _NAME_) | RNA_LAYER_ENGINE_GET_SET(bool, PaintWeightMode, COLLECTION_MODE_PAINT_WEIGHT, _NAME_) | ||||
| #define RNA_LAYER_MODE_PAINT_VERTEX_GET_SET_BOOL(_NAME_) \ | #define RNA_LAYER_MODE_PAINT_VERTEX_GET_SET_BOOL(_NAME_) \ | ||||
| RNA_LAYER_ENGINE_GET_SET(bool, PaintVertexMode, COLLECTION_MODE_PAINT_VERTEX, _NAME_) | RNA_LAYER_ENGINE_GET_SET(bool, PaintVertexMode, COLLECTION_MODE_PAINT_VERTEX, _NAME_) | ||||
| /* clay engine */ | /* clay engine */ | ||||
| #ifdef WITH_CLAY_ENGINE | #ifdef WITH_CLAY_ENGINE | ||||
| /* SceneLayer settings. */ | /* ViewLayer settings. */ | ||||
| RNA_LAYER_ENGINE_CLAY_GET_SET_INT(ssao_samples) | RNA_LAYER_ENGINE_CLAY_GET_SET_INT(ssao_samples) | ||||
| /* LayerCollection settings. */ | /* LayerCollection settings. */ | ||||
| RNA_LAYER_ENGINE_CLAY_GET_SET_INT(matcap_icon) | RNA_LAYER_ENGINE_CLAY_GET_SET_INT(matcap_icon) | ||||
| RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(matcap_rotation) | RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(matcap_rotation) | ||||
| RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(matcap_hue) | RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(matcap_hue) | ||||
| RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(matcap_saturation) | RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(matcap_saturation) | ||||
| RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(matcap_value) | RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(matcap_value) | ||||
| RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_factor_cavity) | RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_factor_cavity) | ||||
| RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_factor_edge) | RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_factor_edge) | ||||
| RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_distance) | RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_distance) | ||||
| RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_attenuation) | RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_attenuation) | ||||
| RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(hair_brightness_randomness) | RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(hair_brightness_randomness) | ||||
| #endif /* WITH_CLAY_ENGINE */ | #endif /* WITH_CLAY_ENGINE */ | ||||
| /* eevee engine */ | /* eevee engine */ | ||||
| /* SceneLayer settings. */ | /* ViewLayer settings. */ | ||||
| RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(gtao_enable) | RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(gtao_enable) | ||||
| RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(gtao_use_bent_normals) | RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(gtao_use_bent_normals) | ||||
| RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(gtao_denoise) | RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(gtao_denoise) | ||||
| RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(gtao_bounce) | RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(gtao_bounce) | ||||
| RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(gtao_factor) | RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(gtao_factor) | ||||
| RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(gtao_quality) | RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(gtao_quality) | ||||
| RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(gtao_distance) | RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(gtao_distance) | ||||
| RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gtao_samples) | RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gtao_samples) | ||||
| ▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
| RNA_LAYER_MODE_PAINT_WEIGHT_GET_SET_BOOL(use_wire) | RNA_LAYER_MODE_PAINT_WEIGHT_GET_SET_BOOL(use_wire) | ||||
| /* vertex paint engine */ | /* vertex paint engine */ | ||||
| RNA_LAYER_MODE_PAINT_VERTEX_GET_SET_BOOL(use_shading) | RNA_LAYER_MODE_PAINT_VERTEX_GET_SET_BOOL(use_shading) | ||||
| RNA_LAYER_MODE_PAINT_VERTEX_GET_SET_BOOL(use_wire) | RNA_LAYER_MODE_PAINT_VERTEX_GET_SET_BOOL(use_wire) | ||||
| #undef RNA_LAYER_ENGINE_GET_SET | #undef RNA_LAYER_ENGINE_GET_SET | ||||
| static void rna_SceneLayerEngineSettings_update(bContext *C, PointerRNA *UNUSED(ptr)) | static void rna_ViewLayerEngineSettings_update(bContext *C, PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| /* TODO(sergey): Use proper flag for tagging here. */ | /* TODO(sergey): Use proper flag for tagging here. */ | ||||
| DEG_id_tag_update(&scene->id, 0); | DEG_id_tag_update(&scene->id, 0); | ||||
| } | } | ||||
| static void rna_LayerCollectionEngineSettings_update(bContext *C, PointerRNA *UNUSED(ptr)) | static void rna_LayerCollectionEngineSettings_update(bContext *C, PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| /* TODO(sergey): Use proper flag for tagging here. */ | /* TODO(sergey): Use proper flag for tagging here. */ | ||||
| DEG_id_tag_update(&scene->id, 0); | DEG_id_tag_update(&scene->id, 0); | ||||
| } | } | ||||
| static void rna_LayerCollectionEngineSettings_wire_update(bContext *C, PointerRNA *UNUSED(ptr)) | static void rna_LayerCollectionEngineSettings_wire_update(bContext *C, PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneLayer *scene_layer = CTX_data_scene_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| Object *ob = OBACT(scene_layer); | Object *ob = OBACT(view_layer); | ||||
| if (ob != NULL && ob->type == OB_MESH) { | if (ob != NULL && ob->type == OB_MESH) { | ||||
| BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL); | BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL); | ||||
| } | } | ||||
| /* TODO(sergey): Use proper flag for tagging here. */ | /* TODO(sergey): Use proper flag for tagging here. */ | ||||
| DEG_id_tag_update(&scene->id, 0); | DEG_id_tag_update(&scene->id, 0); | ||||
| } | } | ||||
| Show All 32 Lines | switch (RNA_property_type(prop)) { | ||||
| case PROP_STRING: | case PROP_STRING: | ||||
| case PROP_POINTER: | case PROP_POINTER: | ||||
| case PROP_COLLECTION: | case PROP_COLLECTION: | ||||
| default: | default: | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| static StructRNA *rna_SceneLayerSettings_refine(PointerRNA *ptr) | static StructRNA *rna_ViewLayerSettings_refine(PointerRNA *ptr) | ||||
| { | { | ||||
| IDProperty *props = (IDProperty *)ptr->data; | IDProperty *props = (IDProperty *)ptr->data; | ||||
| BLI_assert(props && props->type == IDP_GROUP); | BLI_assert(props && props->type == IDP_GROUP); | ||||
| switch (props->subtype) { | switch (props->subtype) { | ||||
| case IDP_GROUP_SUB_ENGINE_RENDER: | case IDP_GROUP_SUB_ENGINE_RENDER: | ||||
| #ifdef WITH_CLAY_ENGINE | #ifdef WITH_CLAY_ENGINE | ||||
| if (STREQ(props->name, RE_engine_id_BLENDER_CLAY)) { | if (STREQ(props->name, RE_engine_id_BLENDER_CLAY)) { | ||||
| return &RNA_SceneLayerEngineSettingsClay; | return &RNA_ViewLayerEngineSettingsClay; | ||||
| } | } | ||||
| #endif | #endif | ||||
| if (STREQ(props->name, RE_engine_id_BLENDER_EEVEE)) { | if (STREQ(props->name, RE_engine_id_BLENDER_EEVEE)) { | ||||
| return &RNA_SceneLayerEngineSettingsEevee; | return &RNA_ViewLayerEngineSettingsEevee; | ||||
| } | } | ||||
| break; | break; | ||||
| case IDP_GROUP_SUB_MODE_OBJECT: | case IDP_GROUP_SUB_MODE_OBJECT: | ||||
| case IDP_GROUP_SUB_MODE_EDIT: | case IDP_GROUP_SUB_MODE_EDIT: | ||||
| case IDP_GROUP_SUB_MODE_PAINT_WEIGHT: | case IDP_GROUP_SUB_MODE_PAINT_WEIGHT: | ||||
| case IDP_GROUP_SUB_MODE_PAINT_VERTEX: | case IDP_GROUP_SUB_MODE_PAINT_VERTEX: | ||||
| default: | default: | ||||
| BLI_assert(!"Mode not fully implemented"); | BLI_assert(!"Mode not fully implemented"); | ||||
| break; | break; | ||||
| } | } | ||||
| return &RNA_SceneLayerSettings; | return &RNA_ViewLayerSettings; | ||||
| } | } | ||||
| static void rna_SceneLayerSettings_name_get(PointerRNA *ptr, char *value) | static void rna_ViewLayerSettings_name_get(PointerRNA *ptr, char *value) | ||||
| { | { | ||||
| IDProperty *props = (IDProperty *)ptr->data; | IDProperty *props = (IDProperty *)ptr->data; | ||||
| strcpy(value, props->name); | strcpy(value, props->name); | ||||
| } | } | ||||
| static int rna_SceneLayerSettings_name_length(PointerRNA *ptr) | static int rna_ViewLayerSettings_name_length(PointerRNA *ptr) | ||||
| { | { | ||||
| IDProperty *props = (IDProperty *)ptr->data; | IDProperty *props = (IDProperty *)ptr->data; | ||||
| return strnlen(props->name, sizeof(props->name)); | return strnlen(props->name, sizeof(props->name)); | ||||
| } | } | ||||
| static void rna_SceneLayerSettings_use(ID *id, IDProperty *props, const char *identifier) | static void rna_ViewLayerSettings_use(ID *id, IDProperty *props, const char *identifier) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = (Scene *)id; | ||||
| PointerRNA scene_props_ptr; | PointerRNA scene_props_ptr; | ||||
| IDProperty *scene_props; | IDProperty *scene_props; | ||||
| scene_props = BKE_scene_layer_engine_scene_get(scene, COLLECTION_MODE_NONE, props->name); | scene_props = BKE_view_layer_engine_scene_get(scene, COLLECTION_MODE_NONE, props->name); | ||||
| RNA_pointer_create(id, &RNA_SceneLayerSettings, scene_props, &scene_props_ptr); | RNA_pointer_create(id, &RNA_ViewLayerSettings, scene_props, &scene_props_ptr); | ||||
| engine_settings_use(props, scene_props, &scene_props_ptr, identifier); | engine_settings_use(props, scene_props, &scene_props_ptr, identifier); | ||||
| /* TODO(sergey): Use proper flag for tagging here. */ | /* TODO(sergey): Use proper flag for tagging here. */ | ||||
| DEG_id_tag_update(id, 0); | DEG_id_tag_update(id, 0); | ||||
| } | } | ||||
| static void rna_SceneLayerSettings_unuse(ID *id, IDProperty *props, const char *identifier) | static void rna_ViewLayerSettings_unuse(ID *id, IDProperty *props, const char *identifier) | ||||
| { | { | ||||
| IDProperty *prop_to_remove = IDP_GetPropertyFromGroup(props, identifier); | IDProperty *prop_to_remove = IDP_GetPropertyFromGroup(props, identifier); | ||||
| IDP_FreeFromGroup(props, prop_to_remove); | IDP_FreeFromGroup(props, prop_to_remove); | ||||
| /* TODO(sergey): Use proper flag for tagging here. */ | /* TODO(sergey): Use proper flag for tagging here. */ | ||||
| DEG_id_tag_update(id, 0); | DEG_id_tag_update(id, 0); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | static void rna_LayerCollection_flag_update(bContext *C, PointerRNA *UNUSED(ptr)) | ||||
| DEG_id_tag_update(&scene->id, 0); | DEG_id_tag_update(&scene->id, 0); | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | ||||
| } | } | ||||
| static void rna_LayerCollection_enable_set( | static void rna_LayerCollection_enable_set( | ||||
| ID *id, LayerCollection *layer_collection, Main *bmain, bContext *C, ReportList *reports, int value) | ID *id, LayerCollection *layer_collection, Main *bmain, bContext *C, ReportList *reports, int value) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = (Scene *)id; | ||||
| SceneLayer *scene_layer = BKE_scene_layer_find_from_collection(scene, layer_collection); | ViewLayer *view_layer = BKE_view_layer_find_from_collection(scene, layer_collection); | ||||
| if (layer_collection->flag & COLLECTION_DISABLED) { | if (layer_collection->flag & COLLECTION_DISABLED) { | ||||
| if (value == 1) { | if (value == 1) { | ||||
| BKE_collection_enable(scene_layer, layer_collection); | BKE_collection_enable(view_layer, layer_collection); | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_reportf(reports, RPT_ERROR, "Layer collection '%s' is already disabled", | BKE_reportf(reports, RPT_ERROR, "Layer collection '%s' is already disabled", | ||||
| layer_collection->scene_collection->name); | layer_collection->scene_collection->name); | ||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| if (value == 0) { | if (value == 0) { | ||||
| BKE_collection_disable(scene_layer, layer_collection); | BKE_collection_disable(view_layer, layer_collection); | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_reportf(reports, RPT_ERROR, "Layer collection '%s' is already enabled", | BKE_reportf(reports, RPT_ERROR, "Layer collection '%s' is already enabled", | ||||
| layer_collection->scene_collection->name); | layer_collection->scene_collection->name); | ||||
| } | } | ||||
| } | } | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| /* TODO(sergey): Use proper flag for tagging here. */ | /* TODO(sergey): Use proper flag for tagging here. */ | ||||
| DEG_id_tag_update(&scene->id, 0); | DEG_id_tag_update(&scene->id, 0); | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene); | WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene); | ||||
| } | } | ||||
| static int rna_LayerCollections_active_collection_index_get(PointerRNA *ptr) | static int rna_LayerCollections_active_collection_index_get(PointerRNA *ptr) | ||||
| { | { | ||||
| SceneLayer *scene_layer = (SceneLayer *)ptr->data; | ViewLayer *view_layer = (ViewLayer *)ptr->data; | ||||
| return scene_layer->active_collection; | return view_layer->active_collection; | ||||
| } | } | ||||
| static void rna_LayerCollections_active_collection_index_set(PointerRNA *ptr, int value) | static void rna_LayerCollections_active_collection_index_set(PointerRNA *ptr, int value) | ||||
| { | { | ||||
| SceneLayer *scene_layer = (SceneLayer *)ptr->data; | ViewLayer *view_layer = (ViewLayer *)ptr->data; | ||||
| int num_collections = BKE_layer_collection_count(scene_layer); | int num_collections = BKE_layer_collection_count(view_layer); | ||||
| scene_layer->active_collection = min_ff(value, num_collections - 1); | view_layer->active_collection = min_ff(value, num_collections - 1); | ||||
| } | } | ||||
| static void rna_LayerCollections_active_collection_index_range( | static void rna_LayerCollections_active_collection_index_range( | ||||
| PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) | PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax)) | ||||
| { | { | ||||
| SceneLayer *scene_layer = (SceneLayer *)ptr->data; | ViewLayer *view_layer = (ViewLayer *)ptr->data; | ||||
| *min = 0; | *min = 0; | ||||
| *max = max_ii(0, BKE_layer_collection_count(scene_layer) - 1); | *max = max_ii(0, BKE_layer_collection_count(view_layer) - 1); | ||||
| } | } | ||||
| static PointerRNA rna_LayerCollections_active_collection_get(PointerRNA *ptr) | static PointerRNA rna_LayerCollections_active_collection_get(PointerRNA *ptr) | ||||
| { | { | ||||
| SceneLayer *scene_layer = (SceneLayer *)ptr->data; | ViewLayer *view_layer = (ViewLayer *)ptr->data; | ||||
| LayerCollection *lc = BKE_layer_collection_get_active(scene_layer); | LayerCollection *lc = BKE_layer_collection_get_active(view_layer); | ||||
| return rna_pointer_inherit_refine(ptr, &RNA_LayerCollection, lc); | return rna_pointer_inherit_refine(ptr, &RNA_LayerCollection, lc); | ||||
| } | } | ||||
| static void rna_LayerCollections_active_collection_set(PointerRNA *ptr, PointerRNA value) | static void rna_LayerCollections_active_collection_set(PointerRNA *ptr, PointerRNA value) | ||||
| { | { | ||||
| SceneLayer *scene_layer = (SceneLayer *)ptr->data; | ViewLayer *view_layer = (ViewLayer *)ptr->data; | ||||
| LayerCollection *lc = (LayerCollection *)value.data; | LayerCollection *lc = (LayerCollection *)value.data; | ||||
| const int index = BKE_layer_collection_findindex(scene_layer, lc); | const int index = BKE_layer_collection_findindex(view_layer, lc); | ||||
| if (index != -1) scene_layer->active_collection = index; | if (index != -1) view_layer->active_collection = index; | ||||
| } | } | ||||
| LayerCollection * rna_SceneLayer_collection_link( | LayerCollection * rna_ViewLayer_collection_link( | ||||
| ID *id, SceneLayer *scene_layer, Main *bmain, SceneCollection *sc) | ID *id, ViewLayer *view_layer, Main *bmain, SceneCollection *sc) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = (Scene *)id; | ||||
| LayerCollection *lc = BKE_collection_link(scene_layer, sc); | LayerCollection *lc = BKE_collection_link(view_layer, sc); | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| /* TODO(sergey): Use proper flag for tagging here. */ | /* TODO(sergey): Use proper flag for tagging here. */ | ||||
| DEG_id_tag_update(id, 0); | DEG_id_tag_update(id, 0); | ||||
| WM_main_add_notifier(NC_SCENE | ND_LAYER, scene); | WM_main_add_notifier(NC_SCENE | ND_LAYER, scene); | ||||
| return lc; | return lc; | ||||
| } | } | ||||
| static void rna_SceneLayer_collection_unlink( | static void rna_ViewLayer_collection_unlink( | ||||
| ID *id, SceneLayer *scene_layer, Main *bmain, ReportList *reports, LayerCollection *lc) | ID *id, ViewLayer *view_layer, Main *bmain, ReportList *reports, LayerCollection *lc) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = (Scene *)id; | ||||
| if (BLI_findindex(&scene_layer->layer_collections, lc) == -1) { | if (BLI_findindex(&view_layer->layer_collections, lc) == -1) { | ||||
| BKE_reportf(reports, RPT_ERROR, "Layer collection '%s' is not in '%s'", | BKE_reportf(reports, RPT_ERROR, "Layer collection '%s' is not in '%s'", | ||||
| lc->scene_collection->name, scene_layer->name); | lc->scene_collection->name, view_layer->name); | ||||
| return; | return; | ||||
| } | } | ||||
| BKE_collection_unlink(scene_layer, lc); | BKE_collection_unlink(view_layer, lc); | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| /* TODO(sergey): Use proper flag for tagging here. */ | /* TODO(sergey): Use proper flag for tagging here. */ | ||||
| DEG_id_tag_update(id, 0); | DEG_id_tag_update(id, 0); | ||||
| WM_main_add_notifier(NC_SCENE | ND_LAYER | ND_OB_ACTIVE, scene); | WM_main_add_notifier(NC_SCENE | ND_LAYER | ND_OB_ACTIVE, scene); | ||||
| } | } | ||||
| static PointerRNA rna_LayerObjects_active_object_get(PointerRNA *ptr) | static PointerRNA rna_LayerObjects_active_object_get(PointerRNA *ptr) | ||||
| { | { | ||||
| SceneLayer *scene_layer = (SceneLayer *)ptr->data; | ViewLayer *view_layer = (ViewLayer *)ptr->data; | ||||
| return rna_pointer_inherit_refine(ptr, &RNA_Object, scene_layer->basact ? scene_layer->basact->object : NULL); | return rna_pointer_inherit_refine(ptr, &RNA_Object, view_layer->basact ? view_layer->basact->object : NULL); | ||||
| } | } | ||||
| static void rna_LayerObjects_active_object_set(PointerRNA *ptr, PointerRNA value) | static void rna_LayerObjects_active_object_set(PointerRNA *ptr, PointerRNA value) | ||||
| { | { | ||||
| SceneLayer *scene_layer = (SceneLayer *)ptr->data; | ViewLayer *view_layer = (ViewLayer *)ptr->data; | ||||
| if (value.data) | if (value.data) | ||||
| scene_layer->basact = BKE_scene_layer_base_find(scene_layer, (Object *)value.data); | view_layer->basact = BKE_view_layer_base_find(view_layer, (Object *)value.data); | ||||
| else | else | ||||
| scene_layer->basact = NULL; | view_layer->basact = NULL; | ||||
| } | } | ||||
| static IDProperty *rna_SceneLayer_idprops(PointerRNA *ptr, bool create) | static IDProperty *rna_ViewLayer_idprops(PointerRNA *ptr, bool create) | ||||
| { | { | ||||
| SceneLayer *scene_layer = (SceneLayer *)ptr->data; | ViewLayer *view_layer = (ViewLayer *)ptr->data; | ||||
| if (create && !scene_layer->id_properties) { | if (create && !view_layer->id_properties) { | ||||
| IDPropertyTemplate val = {0}; | IDPropertyTemplate val = {0}; | ||||
| scene_layer->id_properties = IDP_New(IDP_GROUP, &val, "SceneLayer ID properties"); | view_layer->id_properties = IDP_New(IDP_GROUP, &val, "ViewLayer ID properties"); | ||||
| } | } | ||||
| return scene_layer->id_properties; | return view_layer->id_properties; | ||||
| } | } | ||||
| static void rna_SceneLayer_update_render_passes(ID *id) | static void rna_ViewLayer_update_render_passes(ID *id) | ||||
| { | { | ||||
| Scene *scene = (Scene *)id; | Scene *scene = (Scene *)id; | ||||
| if (scene->nodetree) | if (scene->nodetree) | ||||
| ntreeCompositUpdateRLayers(scene->nodetree); | ntreeCompositUpdateRLayers(scene->nodetree); | ||||
| } | } | ||||
| static PointerRNA rna_SceneLayer_objects_get(CollectionPropertyIterator *iter) | static PointerRNA rna_ViewLayer_objects_get(CollectionPropertyIterator *iter) | ||||
| { | { | ||||
| ListBaseIterator *internal = &iter->internal.listbase; | ListBaseIterator *internal = &iter->internal.listbase; | ||||
| /* we are actually iterating a ObjectBase list, so override get */ | /* we are actually iterating a ObjectBase list, so override get */ | ||||
| Base *base = (Base *)internal->link; | Base *base = (Base *)internal->link; | ||||
| return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, base->object); | return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, base->object); | ||||
| } | } | ||||
| static int rna_SceneLayer_objects_selected_skip(CollectionPropertyIterator *iter, void *UNUSED(data)) | static int rna_ViewLayer_objects_selected_skip(CollectionPropertyIterator *iter, void *UNUSED(data)) | ||||
| { | { | ||||
| ListBaseIterator *internal = &iter->internal.listbase; | ListBaseIterator *internal = &iter->internal.listbase; | ||||
| Base *base = (Base *)internal->link; | Base *base = (Base *)internal->link; | ||||
| if ((base->flag & BASE_SELECTED) != 0) { | if ((base->flag & BASE_SELECTED) != 0) { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| return 1; | return 1; | ||||
| }; | }; | ||||
| static PointerRNA rna_SceneLayer_depsgraph_get(PointerRNA *ptr) | static PointerRNA rna_ViewLayer_depsgraph_get(PointerRNA *ptr) | ||||
| { | { | ||||
| Scene *scene = (Scene *)ptr->id.data; | Scene *scene = (Scene *)ptr->id.data; | ||||
| SceneLayer *scene_layer = (SceneLayer *)ptr->data; | ViewLayer *view_layer = (ViewLayer *)ptr->data; | ||||
| Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, scene_layer, false); | Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, false); | ||||
| return rna_pointer_inherit_refine(ptr, &RNA_Depsgraph, depsgraph); | return rna_pointer_inherit_refine(ptr, &RNA_Depsgraph, depsgraph); | ||||
| } | } | ||||
| static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) | static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) | ||||
| { | { | ||||
| SceneLayer *scene_layer = (SceneLayer *)ptr->data; | ViewLayer *view_layer = (ViewLayer *)ptr->data; | ||||
| rna_iterator_listbase_begin(iter, &scene_layer->object_bases, rna_SceneLayer_objects_selected_skip); | rna_iterator_listbase_begin(iter, &view_layer->object_bases, rna_ViewLayer_objects_selected_skip); | ||||
| } | } | ||||
| static void rna_SceneLayer_update_tagged(SceneLayer *UNUSED(scene_layer), bContext *C) | static void rna_ViewLayer_update_tagged(ViewLayer *UNUSED(view_layer), bContext *C) | ||||
| { | { | ||||
| Depsgraph *graph = CTX_data_depsgraph(C); | Depsgraph *graph = CTX_data_depsgraph(C); | ||||
| DEG_OBJECT_ITER(graph, ob, DEG_OBJECT_ITER_FLAG_ALL) | DEG_OBJECT_ITER(graph, ob, DEG_OBJECT_ITER_FLAG_ALL) | ||||
| { | { | ||||
| /* Don't do anything, we just need to run the iterator to flush | /* Don't do anything, we just need to run the iterator to flush | ||||
| * the base info to the objects. */ | * the base info to the objects. */ | ||||
| UNUSED_VARS(ob); | UNUSED_VARS(ob); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | static void rna_def_layer_collection_override(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_ui_text(prop, "Name", "Collection name"); | RNA_def_property_ui_text(prop, "Name", "Collection name"); | ||||
| RNA_def_struct_name_property(srna, prop); | RNA_def_struct_name_property(srna, prop); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, NULL); | ||||
| } | } | ||||
| #ifdef WITH_CLAY_ENGINE | #ifdef WITH_CLAY_ENGINE | ||||
| static void rna_def_scene_layer_engine_settings_clay(BlenderRNA *brna) | static void rna_def_view_layer_engine_settings_clay(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "SceneLayerEngineSettingsClay", "SceneLayerSettings"); | srna = RNA_def_struct(brna, "ViewLayerEngineSettingsClay", "ViewLayerSettings"); | ||||
| RNA_def_struct_ui_text(srna, "Clay Scene Layer Settings", "Clay Engine settings"); | RNA_def_struct_ui_text(srna, "Clay Scene Layer Settings", "Clay Engine settings"); | ||||
| RNA_define_verify_sdna(0); /* not in sdna */ | RNA_define_verify_sdna(0); /* not in sdna */ | ||||
| /* see RNA_LAYER_ENGINE_GET_SET macro */ | /* see RNA_LAYER_ENGINE_GET_SET macro */ | ||||
| prop = RNA_def_property(srna, "ssao_samples", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "ssao_samples", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Clay_ssao_samples_get", | RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Clay_ssao_samples_get", | ||||
| "rna_LayerEngineSettings_Clay_ssao_samples_set", NULL); | "rna_LayerEngineSettings_Clay_ssao_samples_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Samples", "Number of samples"); | RNA_def_property_ui_text(prop, "Samples", "Number of samples"); | ||||
| RNA_def_property_range(prop, 1, 500); | RNA_def_property_range(prop, 1, 500); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| RNA_define_verify_sdna(1); /* not in sdna */ | RNA_define_verify_sdna(1); /* not in sdna */ | ||||
| } | } | ||||
| #endif /* WITH_CLAY_ENGINE */ | #endif /* WITH_CLAY_ENGINE */ | ||||
| static void rna_def_scene_layer_engine_settings_eevee(BlenderRNA *brna) | static void rna_def_view_layer_engine_settings_eevee(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| /* Keep in sync with eevee_private.h */ | /* Keep in sync with eevee_private.h */ | ||||
| static const EnumPropertyItem eevee_shadow_method_items[] = { | static const EnumPropertyItem eevee_shadow_method_items[] = { | ||||
| {1, "ESM", 0, "ESM", "Exponential Shadow Mapping"}, | {1, "ESM", 0, "ESM", "Exponential Shadow Mapping"}, | ||||
| {2, "VSM", 0, "VSM", "Variance Shadow Mapping"}, | {2, "VSM", 0, "VSM", "Variance Shadow Mapping"}, | ||||
| Show All 15 Lines | static void rna_def_view_layer_engine_settings_eevee(BlenderRNA *brna) | ||||
| static const EnumPropertyItem eevee_volumetric_tile_size_items[] = { | static const EnumPropertyItem eevee_volumetric_tile_size_items[] = { | ||||
| {2, "2", 0, "2px", ""}, | {2, "2", 0, "2px", ""}, | ||||
| {4, "4", 0, "4px", ""}, | {4, "4", 0, "4px", ""}, | ||||
| {8, "8", 0, "8px", ""}, | {8, "8", 0, "8px", ""}, | ||||
| {16, "16", 0, "16px", ""}, | {16, "16", 0, "16px", ""}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| srna = RNA_def_struct(brna, "SceneLayerEngineSettingsEevee", "SceneLayerSettings"); | srna = RNA_def_struct(brna, "ViewLayerEngineSettingsEevee", "ViewLayerSettings"); | ||||
| RNA_def_struct_ui_text(srna, "Eevee Scene Layer Settings", "Eevee Engine settings"); | RNA_def_struct_ui_text(srna, "Eevee Scene Layer Settings", "Eevee Engine settings"); | ||||
| RNA_define_verify_sdna(0); /* not in sdna */ | RNA_define_verify_sdna(0); /* not in sdna */ | ||||
| /* see RNA_LAYER_ENGINE_GET_SET macro */ | /* see RNA_LAYER_ENGINE_GET_SET macro */ | ||||
| /* Indirect Lighting */ | /* Indirect Lighting */ | ||||
| prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "gi_diffuse_bounces", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_gi_diffuse_bounces_get", | RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_gi_diffuse_bounces_get", | ||||
| "rna_LayerEngineSettings_Eevee_gi_diffuse_bounces_set", NULL); | "rna_LayerEngineSettings_Eevee_gi_diffuse_bounces_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Diffuse Bounces", "Number of time the light is reinjected inside light grids, " | RNA_def_property_ui_text(prop, "Diffuse Bounces", "Number of time the light is reinjected inside light grids, " | ||||
| "0 disable indirect diffuse light"); | "0 disable indirect diffuse light"); | ||||
| RNA_def_property_range(prop, 0, INT_MAX); | RNA_def_property_range(prop, 0, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_gi_cubemap_resolution_get", "rna_LayerEngineSettings_Eevee_gi_cubemap_resolution_set", NULL); | RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_gi_cubemap_resolution_get", "rna_LayerEngineSettings_Eevee_gi_cubemap_resolution_set", NULL); | ||||
| RNA_def_property_enum_items(prop, eevee_shadow_size_items); | RNA_def_property_enum_items(prop, eevee_shadow_size_items); | ||||
| RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps"); | RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| /* Temporal Anti-Aliasing (super sampling) */ | /* Temporal Anti-Aliasing (super sampling) */ | ||||
| prop = RNA_def_property(srna, "taa_samples", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "taa_samples", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_taa_samples_get", | RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_taa_samples_get", | ||||
| "rna_LayerEngineSettings_Eevee_taa_samples_set", NULL); | "rna_LayerEngineSettings_Eevee_taa_samples_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Viewport Samples", "Number of temporal samples, unlimited if 0, " | RNA_def_property_ui_text(prop, "Viewport Samples", "Number of temporal samples, unlimited if 0, " | ||||
| "disabled if 1"); | "disabled if 1"); | ||||
| RNA_def_property_range(prop, 0, INT_MAX); | RNA_def_property_range(prop, 0, INT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| /* Screen Space Subsurface Scattering */ | /* Screen Space Subsurface Scattering */ | ||||
| prop = RNA_def_property(srna, "sss_enable", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "sss_enable", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_sss_enable_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_sss_enable_get", | ||||
| "rna_LayerEngineSettings_Eevee_sss_enable_set"); | "rna_LayerEngineSettings_Eevee_sss_enable_set"); | ||||
| RNA_def_property_ui_text(prop, "Subsurface Scattering", "Enable screen space subsurface scattering"); | RNA_def_property_ui_text(prop, "Subsurface Scattering", "Enable screen space subsurface scattering"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "sss_samples", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "sss_samples", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_sss_samples_get", | RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_sss_samples_get", | ||||
| "rna_LayerEngineSettings_Eevee_sss_samples_set", NULL); | "rna_LayerEngineSettings_Eevee_sss_samples_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute the scattering effect"); | RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute the scattering effect"); | ||||
| RNA_def_property_range(prop, 1, 32); | RNA_def_property_range(prop, 1, 32); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "sss_jitter_threshold", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "sss_jitter_threshold", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_sss_jitter_threshold_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_sss_jitter_threshold_get", | ||||
| "rna_LayerEngineSettings_Eevee_sss_jitter_threshold_set", NULL); | "rna_LayerEngineSettings_Eevee_sss_jitter_threshold_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Jitter Threshold", "Rotate samples that are below this threshold"); | RNA_def_property_ui_text(prop, "Jitter Threshold", "Rotate samples that are below this threshold"); | ||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | RNA_def_property_range(prop, 0.0f, 1.0f); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| /* Screen Space Reflection */ | /* Screen Space Reflection */ | ||||
| prop = RNA_def_property(srna, "ssr_enable", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "ssr_enable", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_enable_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_enable_get", | ||||
| "rna_LayerEngineSettings_Eevee_ssr_enable_set"); | "rna_LayerEngineSettings_Eevee_ssr_enable_set"); | ||||
| RNA_def_property_ui_text(prop, "Screen Space Reflections", "Enable screen space reflection"); | RNA_def_property_ui_text(prop, "Screen Space Reflections", "Enable screen space reflection"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "ssr_refraction", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "ssr_refraction", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_refraction_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_refraction_get", | ||||
| "rna_LayerEngineSettings_Eevee_ssr_refraction_set"); | "rna_LayerEngineSettings_Eevee_ssr_refraction_set"); | ||||
| RNA_def_property_ui_text(prop, "Screen Space Refractions", "Enable screen space Refractions"); | RNA_def_property_ui_text(prop, "Screen Space Refractions", "Enable screen space Refractions"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "ssr_halfres", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "ssr_halfres", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_halfres_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_halfres_get", | ||||
| "rna_LayerEngineSettings_Eevee_ssr_halfres_set"); | "rna_LayerEngineSettings_Eevee_ssr_halfres_set"); | ||||
| RNA_def_property_ui_text(prop, "Half Res Trace", "Raytrace at a lower resolution"); | RNA_def_property_ui_text(prop, "Half Res Trace", "Raytrace at a lower resolution"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "ssr_quality", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "ssr_quality", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_quality_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_quality_get", | ||||
| "rna_LayerEngineSettings_Eevee_ssr_quality_set", NULL); | "rna_LayerEngineSettings_Eevee_ssr_quality_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Trace Quality", "Quality of the screen space raytracing"); | RNA_def_property_ui_text(prop, "Trace Quality", "Quality of the screen space raytracing"); | ||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | RNA_def_property_range(prop, 0.0f, 1.0f); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "ssr_max_roughness", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "ssr_max_roughness", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_max_roughness_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_max_roughness_get", | ||||
| "rna_LayerEngineSettings_Eevee_ssr_max_roughness_set", NULL); | "rna_LayerEngineSettings_Eevee_ssr_max_roughness_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Max Roughness", "Do not raytrace reflections for roughness above this value"); | RNA_def_property_ui_text(prop, "Max Roughness", "Do not raytrace reflections for roughness above this value"); | ||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | RNA_def_property_range(prop, 0.0f, 1.0f); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "ssr_ray_count", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "ssr_ray_count", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_ray_count_get", | RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_ray_count_get", | ||||
| "rna_LayerEngineSettings_Eevee_ssr_ray_count_set", NULL); | "rna_LayerEngineSettings_Eevee_ssr_ray_count_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Samples", "Number of rays to trace per pixels"); | RNA_def_property_ui_text(prop, "Samples", "Number of rays to trace per pixels"); | ||||
| RNA_def_property_range(prop, 1, 4); | RNA_def_property_range(prop, 1, 4); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "ssr_thickness", PROP_FLOAT, PROP_DISTANCE); | prop = RNA_def_property(srna, "ssr_thickness", PROP_FLOAT, PROP_DISTANCE); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_thickness_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_thickness_get", | ||||
| "rna_LayerEngineSettings_Eevee_ssr_thickness_set", NULL); | "rna_LayerEngineSettings_Eevee_ssr_thickness_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Thickness", "Pixel thickness used to detect intersection"); | RNA_def_property_ui_text(prop, "Thickness", "Pixel thickness used to detect intersection"); | ||||
| RNA_def_property_range(prop, 1e-6f, FLT_MAX); | RNA_def_property_range(prop, 1e-6f, FLT_MAX); | ||||
| RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 5, 3); | RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 5, 3); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "ssr_border_fade", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "ssr_border_fade", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_border_fade_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_border_fade_get", | ||||
| "rna_LayerEngineSettings_Eevee_ssr_border_fade_set", NULL); | "rna_LayerEngineSettings_Eevee_ssr_border_fade_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Edge Fading", "Screen percentage used to fade the SSR"); | RNA_def_property_ui_text(prop, "Edge Fading", "Screen percentage used to fade the SSR"); | ||||
| RNA_def_property_range(prop, 0.0f, 0.5f); | RNA_def_property_range(prop, 0.0f, 0.5f); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "ssr_firefly_fac", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "ssr_firefly_fac", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_firefly_fac_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_ssr_firefly_fac_get", | ||||
| "rna_LayerEngineSettings_Eevee_ssr_firefly_fac_set", NULL); | "rna_LayerEngineSettings_Eevee_ssr_firefly_fac_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Clamp", "Clamp pixel intensity to remove noise (0 to disabled)"); | RNA_def_property_ui_text(prop, "Clamp", "Clamp pixel intensity to remove noise (0 to disabled)"); | ||||
| RNA_def_property_range(prop, 0.0f, FLT_MAX); | RNA_def_property_range(prop, 0.0f, FLT_MAX); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| /* Volumetrics */ | /* Volumetrics */ | ||||
| prop = RNA_def_property(srna, "volumetric_enable", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "volumetric_enable", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_enable_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_enable_get", | ||||
| "rna_LayerEngineSettings_Eevee_volumetric_enable_set"); | "rna_LayerEngineSettings_Eevee_volumetric_enable_set"); | ||||
| RNA_def_property_ui_text(prop, "Volumetrics", "Enable scattering and absorbance of volumetric material"); | RNA_def_property_ui_text(prop, "Volumetrics", "Enable scattering and absorbance of volumetric material"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "volumetric_start", PROP_FLOAT, PROP_DISTANCE); | prop = RNA_def_property(srna, "volumetric_start", PROP_FLOAT, PROP_DISTANCE); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_start_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_start_get", | ||||
| "rna_LayerEngineSettings_Eevee_volumetric_start_set", NULL); | "rna_LayerEngineSettings_Eevee_volumetric_start_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Start", "Start distance of the volumetric effect"); | RNA_def_property_ui_text(prop, "Start", "Start distance of the volumetric effect"); | ||||
| RNA_def_property_range(prop, 1e-6f, FLT_MAX); | RNA_def_property_range(prop, 1e-6f, FLT_MAX); | ||||
| RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3); | RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "volumetric_end", PROP_FLOAT, PROP_DISTANCE); | prop = RNA_def_property(srna, "volumetric_end", PROP_FLOAT, PROP_DISTANCE); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_end_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_end_get", | ||||
| "rna_LayerEngineSettings_Eevee_volumetric_end_set", NULL); | "rna_LayerEngineSettings_Eevee_volumetric_end_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "End", "End distance of the volumetric effect"); | RNA_def_property_ui_text(prop, "End", "End distance of the volumetric effect"); | ||||
| RNA_def_property_range(prop, 1e-6f, FLT_MAX); | RNA_def_property_range(prop, 1e-6f, FLT_MAX); | ||||
| RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3); | RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "volumetric_tile_size", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "volumetric_tile_size", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_tile_size_get", | RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_tile_size_get", | ||||
| "rna_LayerEngineSettings_Eevee_volumetric_tile_size_set", NULL); | "rna_LayerEngineSettings_Eevee_volumetric_tile_size_set", NULL); | ||||
| RNA_def_property_enum_items(prop, eevee_volumetric_tile_size_items); | RNA_def_property_enum_items(prop, eevee_volumetric_tile_size_items); | ||||
| RNA_def_property_ui_text(prop, "Tile Size", "Control the quality of the volumetric effects " | RNA_def_property_ui_text(prop, "Tile Size", "Control the quality of the volumetric effects " | ||||
| "(lower size increase vram usage and quality)"); | "(lower size increase vram usage and quality)"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "volumetric_samples", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "volumetric_samples", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_samples_get", | RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_samples_get", | ||||
| "rna_LayerEngineSettings_Eevee_volumetric_samples_set", NULL); | "rna_LayerEngineSettings_Eevee_volumetric_samples_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute volumetric effects"); | RNA_def_property_ui_text(prop, "Samples", "Number of samples to compute volumetric effects"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_range(prop, 1, 256); | RNA_def_property_range(prop, 1, 256); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "volumetric_sample_distribution", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "volumetric_sample_distribution", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_sample_distribution_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_sample_distribution_get", | ||||
| "rna_LayerEngineSettings_Eevee_volumetric_sample_distribution_set", NULL); | "rna_LayerEngineSettings_Eevee_volumetric_sample_distribution_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Exponential Sampling", "Distribute more samples closer to the camera"); | RNA_def_property_ui_text(prop, "Exponential Sampling", "Distribute more samples closer to the camera"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "volumetric_lights", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "volumetric_lights", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_lights_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_lights_get", | ||||
| "rna_LayerEngineSettings_Eevee_volumetric_lights_set"); | "rna_LayerEngineSettings_Eevee_volumetric_lights_set"); | ||||
| RNA_def_property_ui_text(prop, "Volumetric Lighting", "Enable scene lamps interactions with volumetrics"); | RNA_def_property_ui_text(prop, "Volumetric Lighting", "Enable scene lamps interactions with volumetrics"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "volumetric_light_clamp", PROP_FLOAT, PROP_NONE); | prop = RNA_def_property(srna, "volumetric_light_clamp", PROP_FLOAT, PROP_NONE); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_light_clamp_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_light_clamp_get", | ||||
| "rna_LayerEngineSettings_Eevee_volumetric_light_clamp_set", NULL); | "rna_LayerEngineSettings_Eevee_volumetric_light_clamp_set", NULL); | ||||
| RNA_def_property_range(prop, 0.0f, FLT_MAX); | RNA_def_property_range(prop, 0.0f, FLT_MAX); | ||||
| RNA_def_property_ui_text(prop, "Clamp", "Maximum light contribution, reducing noise"); | RNA_def_property_ui_text(prop, "Clamp", "Maximum light contribution, reducing noise"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "volumetric_shadows", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "volumetric_shadows", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_shadows_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_shadows_get", | ||||
| "rna_LayerEngineSettings_Eevee_volumetric_shadows_set"); | "rna_LayerEngineSettings_Eevee_volumetric_shadows_set"); | ||||
| RNA_def_property_ui_text(prop, "Volumetric Shadows", "Generate shadows from volumetric material (Very expensive)"); | RNA_def_property_ui_text(prop, "Volumetric Shadows", "Generate shadows from volumetric material (Very expensive)"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "volumetric_shadow_samples", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "volumetric_shadow_samples", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_shadow_samples_get", | RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_shadow_samples_get", | ||||
| "rna_LayerEngineSettings_Eevee_volumetric_shadow_samples_set", NULL); | "rna_LayerEngineSettings_Eevee_volumetric_shadow_samples_set", NULL); | ||||
| RNA_def_property_range(prop, 1, 128); | RNA_def_property_range(prop, 1, 128); | ||||
| RNA_def_property_ui_text(prop, "Volumetric Shadow Samples", "Number of samples to compute volumetric shadowing"); | RNA_def_property_ui_text(prop, "Volumetric Shadow Samples", "Number of samples to compute volumetric shadowing"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "volumetric_colored_transmittance", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "volumetric_colored_transmittance", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_colored_transmittance_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_volumetric_colored_transmittance_get", | ||||
| "rna_LayerEngineSettings_Eevee_volumetric_colored_transmittance_set"); | "rna_LayerEngineSettings_Eevee_volumetric_colored_transmittance_set"); | ||||
| RNA_def_property_ui_text(prop, "Colored Transmittance", "Enable wavelength dependent volumetric transmittance"); | RNA_def_property_ui_text(prop, "Colored Transmittance", "Enable wavelength dependent volumetric transmittance"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| /* Ambient Occlusion */ | /* Ambient Occlusion */ | ||||
| prop = RNA_def_property(srna, "gtao_enable", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "gtao_enable", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_enable_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_enable_get", | ||||
| "rna_LayerEngineSettings_Eevee_gtao_enable_set"); | "rna_LayerEngineSettings_Eevee_gtao_enable_set"); | ||||
| RNA_def_property_ui_text(prop, "Ambient Occlusion", "Enable ambient occlusion to simulate medium scale indirect shadowing"); | RNA_def_property_ui_text(prop, "Ambient Occlusion", "Enable ambient occlusion to simulate medium scale indirect shadowing"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "gtao_use_bent_normals", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "gtao_use_bent_normals", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_use_bent_normals_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_use_bent_normals_get", | ||||
| "rna_LayerEngineSettings_Eevee_gtao_use_bent_normals_set"); | "rna_LayerEngineSettings_Eevee_gtao_use_bent_normals_set"); | ||||
| RNA_def_property_ui_text(prop, "Bent Normals", "Compute main non occluded direction to sample the environment"); | RNA_def_property_ui_text(prop, "Bent Normals", "Compute main non occluded direction to sample the environment"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "gtao_denoise", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "gtao_denoise", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_denoise_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_denoise_get", | ||||
| "rna_LayerEngineSettings_Eevee_gtao_denoise_set"); | "rna_LayerEngineSettings_Eevee_gtao_denoise_set"); | ||||
| RNA_def_property_ui_text(prop, "Denoise", "Use denoising to filter the resulting occlusion and bent normal but exhibit 2x2 pixel blocks"); | RNA_def_property_ui_text(prop, "Denoise", "Use denoising to filter the resulting occlusion and bent normal but exhibit 2x2 pixel blocks"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "gtao_bounce", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "gtao_bounce", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_bounce_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_bounce_get", | ||||
| "rna_LayerEngineSettings_Eevee_gtao_bounce_set"); | "rna_LayerEngineSettings_Eevee_gtao_bounce_set"); | ||||
| RNA_def_property_ui_text(prop, "Bounces Approximation", "An approximation to simulate light bounces " | RNA_def_property_ui_text(prop, "Bounces Approximation", "An approximation to simulate light bounces " | ||||
| "giving less occlusion on brighter objects"); | "giving less occlusion on brighter objects"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "gtao_factor", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "gtao_factor", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_factor_get", "rna_LayerEngineSettings_Eevee_gtao_factor_set", NULL); | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_factor_get", "rna_LayerEngineSettings_Eevee_gtao_factor_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending"); | RNA_def_property_ui_text(prop, "Factor", "Factor for ambient occlusion blending"); | ||||
| RNA_def_property_range(prop, 0.0f, FLT_MAX); | RNA_def_property_range(prop, 0.0f, FLT_MAX); | ||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 2); | RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 2); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); | ||||
| Show All 14 Lines | static void rna_def_view_layer_engine_settings_eevee(BlenderRNA *brna) | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "gtao_samples", PROP_INT, PROP_UNSIGNED); | prop = RNA_def_property(srna, "gtao_samples", PROP_INT, PROP_UNSIGNED); | ||||
| RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_samples_get", | RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_gtao_samples_get", | ||||
| "rna_LayerEngineSettings_Eevee_gtao_samples_set", NULL); | "rna_LayerEngineSettings_Eevee_gtao_samples_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Samples", "Number of samples to take to compute occlusion"); | RNA_def_property_ui_text(prop, "Samples", "Number of samples to take to compute occlusion"); | ||||
| RNA_def_property_range(prop, 2, 32); | RNA_def_property_range(prop, 2, 32); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| /* Depth of Field */ | /* Depth of Field */ | ||||
| prop = RNA_def_property(srna, "dof_enable", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "dof_enable", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_dof_enable_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_dof_enable_get", | ||||
| "rna_LayerEngineSettings_Eevee_dof_enable_set"); | "rna_LayerEngineSettings_Eevee_dof_enable_set"); | ||||
| RNA_def_property_ui_text(prop, "Depth of Field", "Enable depth of field using the values from the active camera"); | RNA_def_property_ui_text(prop, "Depth of Field", "Enable depth of field using the values from the active camera"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "bokeh_max_size", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "bokeh_max_size", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bokeh_max_size_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bokeh_max_size_get", | ||||
| "rna_LayerEngineSettings_Eevee_bokeh_max_size_set", NULL); | "rna_LayerEngineSettings_Eevee_bokeh_max_size_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Max Size", "Max size of the bokeh shape for the depth of field (lower is faster)"); | RNA_def_property_ui_text(prop, "Max Size", "Max size of the bokeh shape for the depth of field (lower is faster)"); | ||||
| RNA_def_property_range(prop, 0.0f, 2000.0f); | RNA_def_property_range(prop, 0.0f, 2000.0f); | ||||
| RNA_def_property_ui_range(prop, 2.0f, 200.0f, 1, 3); | RNA_def_property_ui_range(prop, 2.0f, 200.0f, 1, 3); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "bokeh_threshold", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "bokeh_threshold", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bokeh_threshold_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bokeh_threshold_get", | ||||
| "rna_LayerEngineSettings_Eevee_bokeh_threshold_set", NULL); | "rna_LayerEngineSettings_Eevee_bokeh_threshold_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Sprite Threshold", "Brightness threshold for using sprite base depth of field"); | RNA_def_property_ui_text(prop, "Sprite Threshold", "Brightness threshold for using sprite base depth of field"); | ||||
| RNA_def_property_range(prop, 0.0f, 100000.0f); | RNA_def_property_range(prop, 0.0f, 100000.0f); | ||||
| RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); | RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| /* Bloom */ | /* Bloom */ | ||||
| prop = RNA_def_property(srna, "bloom_enable", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "bloom_enable", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_enable_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_enable_get", | ||||
| "rna_LayerEngineSettings_Eevee_bloom_enable_set"); | "rna_LayerEngineSettings_Eevee_bloom_enable_set"); | ||||
| RNA_def_property_ui_text(prop, "Bloom", "High brighness pixels generate a glowing effect"); | RNA_def_property_ui_text(prop, "Bloom", "High brighness pixels generate a glowing effect"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "bloom_threshold", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "bloom_threshold", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_threshold_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_threshold_get", | ||||
| "rna_LayerEngineSettings_Eevee_bloom_threshold_set", NULL); | "rna_LayerEngineSettings_Eevee_bloom_threshold_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Threshold", "Filters out pixels under this level of brightness"); | RNA_def_property_ui_text(prop, "Threshold", "Filters out pixels under this level of brightness"); | ||||
| RNA_def_property_range(prop, 0.0f, 100000.0f); | RNA_def_property_range(prop, 0.0f, 100000.0f); | ||||
| RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); | RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "bloom_color", PROP_FLOAT, PROP_COLOR); | prop = RNA_def_property(srna, "bloom_color", PROP_FLOAT, PROP_COLOR); | ||||
| RNA_def_property_array(prop, 3); | RNA_def_property_array(prop, 3); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_color_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_color_get", | ||||
| "rna_LayerEngineSettings_Eevee_bloom_color_set", NULL); | "rna_LayerEngineSettings_Eevee_bloom_color_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Color", "Color applied to the bloom effect"); | RNA_def_property_ui_text(prop, "Color", "Color applied to the bloom effect"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "bloom_knee", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "bloom_knee", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_knee_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_knee_get", | ||||
| "rna_LayerEngineSettings_Eevee_bloom_knee_set", NULL); | "rna_LayerEngineSettings_Eevee_bloom_knee_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Knee", "Makes transition between under/over-threshold gradual"); | RNA_def_property_ui_text(prop, "Knee", "Makes transition between under/over-threshold gradual"); | ||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | RNA_def_property_range(prop, 0.0f, 1.0f); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "bloom_radius", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "bloom_radius", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_radius_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_radius_get", | ||||
| "rna_LayerEngineSettings_Eevee_bloom_radius_set", NULL); | "rna_LayerEngineSettings_Eevee_bloom_radius_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Radius", "Bloom spread distance"); | RNA_def_property_ui_text(prop, "Radius", "Bloom spread distance"); | ||||
| RNA_def_property_range(prop, 0.0f, 100.0f); | RNA_def_property_range(prop, 0.0f, 100.0f); | ||||
| RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); | RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "bloom_clamp", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "bloom_clamp", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_clamp_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_clamp_get", | ||||
| "rna_LayerEngineSettings_Eevee_bloom_clamp_set", NULL); | "rna_LayerEngineSettings_Eevee_bloom_clamp_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Clamp", "Maximum intensity a bloom pixel can have"); | RNA_def_property_ui_text(prop, "Clamp", "Maximum intensity a bloom pixel can have"); | ||||
| RNA_def_property_range(prop, 0.0f, 1000.0f); | RNA_def_property_range(prop, 0.0f, 1000.0f); | ||||
| RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); | RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "bloom_intensity", PROP_FLOAT, PROP_UNSIGNED); | prop = RNA_def_property(srna, "bloom_intensity", PROP_FLOAT, PROP_UNSIGNED); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_intensity_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_bloom_intensity_get", | ||||
| "rna_LayerEngineSettings_Eevee_bloom_intensity_set", NULL); | "rna_LayerEngineSettings_Eevee_bloom_intensity_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Intensity", "Blend factor"); | RNA_def_property_ui_text(prop, "Intensity", "Blend factor"); | ||||
| RNA_def_property_range(prop, 0.0f, 10000.0f); | RNA_def_property_range(prop, 0.0f, 10000.0f); | ||||
| RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); | RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| /* Motion blur */ | /* Motion blur */ | ||||
| prop = RNA_def_property(srna, "motion_blur_enable", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "motion_blur_enable", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_motion_blur_enable_get", | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_motion_blur_enable_get", | ||||
| "rna_LayerEngineSettings_Eevee_motion_blur_enable_set"); | "rna_LayerEngineSettings_Eevee_motion_blur_enable_set"); | ||||
| RNA_def_property_ui_text(prop, "Motion Blur", "Enable motion blur effect (only in camera view)"); | RNA_def_property_ui_text(prop, "Motion Blur", "Enable motion blur effect (only in camera view)"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_UNSIGNED); | prop = RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_UNSIGNED); | ||||
| RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_motion_blur_samples_get", | RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_motion_blur_samples_get", | ||||
| "rna_LayerEngineSettings_Eevee_motion_blur_samples_set", NULL); | "rna_LayerEngineSettings_Eevee_motion_blur_samples_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Samples", "Number of samples to take with motion blur"); | RNA_def_property_ui_text(prop, "Samples", "Number of samples to take with motion blur"); | ||||
| RNA_def_property_range(prop, 1, 64); | RNA_def_property_range(prop, 1, 64); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_UNSIGNED); | prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_UNSIGNED); | ||||
| RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_motion_blur_shutter_get", | RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Eevee_motion_blur_shutter_get", | ||||
| "rna_LayerEngineSettings_Eevee_motion_blur_shutter_set", NULL); | "rna_LayerEngineSettings_Eevee_motion_blur_shutter_set", NULL); | ||||
| RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close"); | RNA_def_property_ui_text(prop, "Shutter", "Time taken in frames between shutter open and close"); | ||||
| RNA_def_property_ui_range(prop, 0.01f, 2.0f, 1, 2); | RNA_def_property_ui_range(prop, 0.01f, 2.0f, 1, 2); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| /* Shadows */ | /* Shadows */ | ||||
| prop = RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_shadow_method_get", "rna_LayerEngineSettings_Eevee_shadow_method_set", NULL); | RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_shadow_method_get", "rna_LayerEngineSettings_Eevee_shadow_method_set", NULL); | ||||
| RNA_def_property_enum_items(prop, eevee_shadow_method_items); | RNA_def_property_enum_items(prop, eevee_shadow_method_items); | ||||
| RNA_def_property_ui_text(prop, "Method", "Technique use to compute the shadows"); | RNA_def_property_ui_text(prop, "Method", "Technique use to compute the shadows"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "shadow_size", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "shadow_size", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_shadow_size_get", "rna_LayerEngineSettings_Eevee_shadow_size_set", NULL); | RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_shadow_size_get", "rna_LayerEngineSettings_Eevee_shadow_size_set", NULL); | ||||
| RNA_def_property_enum_items(prop, eevee_shadow_size_items); | RNA_def_property_enum_items(prop, eevee_shadow_size_items); | ||||
| RNA_def_property_ui_text(prop, "Size", "Size of every shadow maps"); | RNA_def_property_ui_text(prop, "Size", "Size of every shadow maps"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| prop = RNA_def_property(srna, "shadow_high_bitdepth", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "shadow_high_bitdepth", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_shadow_high_bitdepth_get", "rna_LayerEngineSettings_Eevee_shadow_high_bitdepth_set"); | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_Eevee_shadow_high_bitdepth_get", "rna_LayerEngineSettings_Eevee_shadow_high_bitdepth_set"); | ||||
| RNA_def_property_ui_text(prop, "High Bitdepth", "Use 32bit shadows"); | RNA_def_property_ui_text(prop, "High Bitdepth", "Use 32bit shadows"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_SceneLayerEngineSettings_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update"); | ||||
| RNA_define_verify_sdna(1); /* not in sdna */ | RNA_define_verify_sdna(1); /* not in sdna */ | ||||
| } | } | ||||
| #ifdef WITH_CLAY_ENGINE | #ifdef WITH_CLAY_ENGINE | ||||
| static void rna_def_layer_collection_engine_settings_clay(BlenderRNA *brna) | static void rna_def_layer_collection_engine_settings_clay(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| ▲ Show 20 Lines • Show All 241 Lines • ▼ Show 20 Lines | static void rna_def_layer_collection_mode_settings_paint_vertex(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Show Wire", "Whether to overlay wireframe onto the mesh"); | RNA_def_property_ui_text(prop, "Show Wire", "Whether to overlay wireframe onto the mesh"); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_PaintVertexMode_use_wire_get", "rna_LayerEngineSettings_PaintVertexMode_use_wire_set"); | RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_PaintVertexMode_use_wire_get", "rna_LayerEngineSettings_PaintVertexMode_use_wire_set"); | ||||
| RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_wire_update"); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_wire_update"); | ||||
| RNA_define_verify_sdna(1); /* not in sdna */ | RNA_define_verify_sdna(1); /* not in sdna */ | ||||
| } | } | ||||
| static void rna_def_scene_layer_settings(BlenderRNA *brna) | static void rna_def_view_layer_settings(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| srna = RNA_def_struct(brna, "SceneLayerSettings", NULL); | srna = RNA_def_struct(brna, "ViewLayerSettings", NULL); | ||||
| RNA_def_struct_sdna(srna, "IDProperty"); | RNA_def_struct_sdna(srna, "IDProperty"); | ||||
| RNA_def_struct_ui_text(srna, "Scene Layer Settings", | RNA_def_struct_ui_text(srna, "Scene Layer Settings", | ||||
| "Engine specific settings that can be overriden by SceneLayer"); | "Engine specific settings that can be overriden by ViewLayer"); | ||||
| RNA_def_struct_refine_func(srna, "rna_SceneLayerSettings_refine"); | RNA_def_struct_refine_func(srna, "rna_ViewLayerSettings_refine"); | ||||
| RNA_define_verify_sdna(0); | RNA_define_verify_sdna(0); | ||||
| prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_funcs(prop, "rna_SceneLayerSettings_name_get", "rna_SceneLayerSettings_name_length", NULL); | RNA_def_property_string_funcs(prop, "rna_ViewLayerSettings_name_get", "rna_ViewLayerSettings_name_length", NULL); | ||||
| RNA_def_property_ui_text(prop, "Name", "Engine Name"); | RNA_def_property_ui_text(prop, "Name", "Engine Name"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_struct_name_property(srna, prop); | RNA_def_struct_name_property(srna, prop); | ||||
| func = RNA_def_function(srna, "use", "rna_SceneLayerSettings_use"); | func = RNA_def_function(srna, "use", "rna_ViewLayerSettings_use"); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID); | RNA_def_function_flag(func, FUNC_USE_SELF_ID); | ||||
| RNA_def_function_ui_description(func, "Initialize this property to use"); | RNA_def_function_ui_description(func, "Initialize this property to use"); | ||||
| parm = RNA_def_string(func, "identifier", NULL, 0, "Property Name", "Name of the property to set"); | parm = RNA_def_string(func, "identifier", NULL, 0, "Property Name", "Name of the property to set"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| func = RNA_def_function(srna, "unuse", "rna_SceneLayerSettings_unuse"); | func = RNA_def_function(srna, "unuse", "rna_ViewLayerSettings_unuse"); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID); | RNA_def_function_flag(func, FUNC_USE_SELF_ID); | ||||
| RNA_def_function_ui_description(func, "Remove the property"); | RNA_def_function_ui_description(func, "Remove the property"); | ||||
| parm = RNA_def_string(func, "identifier", NULL, 0, "Property Name", "Name of the property to unset"); | parm = RNA_def_string(func, "identifier", NULL, 0, "Property Name", "Name of the property to unset"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); | ||||
| #ifdef WITH_CLAY_ENGINE | #ifdef WITH_CLAY_ENGINE | ||||
| rna_def_scene_layer_engine_settings_clay(brna); | rna_def_view_layer_engine_settings_clay(brna); | ||||
| #endif | #endif | ||||
| rna_def_scene_layer_engine_settings_eevee(brna); | rna_def_view_layer_engine_settings_eevee(brna); | ||||
| #if 0 | #if 0 | ||||
| rna_def_scene_layer_mode_settings_object(brna); | rna_def_view_layer_mode_settings_object(brna); | ||||
| rna_def_scene_layer_mode_settings_edit(brna); | rna_def_view_layer_mode_settings_edit(brna); | ||||
| rna_def_scene_layer_mode_settings_paint_weight(brna); | rna_def_view_layer_mode_settings_paint_weight(brna); | ||||
| rna_def_scene_layer_mode_settings_paint_vertex(brna); | rna_def_view_layer_mode_settings_paint_vertex(brna); | ||||
| #endif | #endif | ||||
| RNA_define_verify_sdna(1); | RNA_define_verify_sdna(1); | ||||
| } | } | ||||
| static void rna_def_layer_collection_settings(BlenderRNA *brna) | static void rna_def_layer_collection_settings(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| ▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| RNA_def_property_srna(cprop, "LayerCollections"); | RNA_def_property_srna(cprop, "LayerCollections"); | ||||
| srna = RNA_def_struct(brna, "LayerCollections", NULL); | srna = RNA_def_struct(brna, "LayerCollections", NULL); | ||||
| RNA_def_struct_sdna(srna, "SceneLayer"); | RNA_def_struct_sdna(srna, "ViewLayer"); | ||||
| RNA_def_struct_ui_text(srna, "Layer Collections", "Collections of render layer"); | RNA_def_struct_ui_text(srna, "Layer Collections", "Collections of render layer"); | ||||
| prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); | prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); | ||||
| RNA_def_property_int_sdna(prop, NULL, "active_collection"); | RNA_def_property_int_sdna(prop, NULL, "active_collection"); | ||||
| RNA_def_property_int_funcs(prop, "rna_LayerCollections_active_collection_index_get", | RNA_def_property_int_funcs(prop, "rna_LayerCollections_active_collection_index_get", | ||||
| "rna_LayerCollections_active_collection_index_set", | "rna_LayerCollections_active_collection_index_set", | ||||
| "rna_LayerCollections_active_collection_index_range"); | "rna_LayerCollections_active_collection_index_range"); | ||||
| RNA_def_property_ui_text(prop, "Active Collection Index", "Active index in layer collection array"); | RNA_def_property_ui_text(prop, "Active Collection Index", "Active index in layer collection array"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL); | ||||
| prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "LayerCollection"); | RNA_def_property_struct_type(prop, "LayerCollection"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_LayerCollections_active_collection_get", | RNA_def_property_pointer_funcs(prop, "rna_LayerCollections_active_collection_get", | ||||
| "rna_LayerCollections_active_collection_set", NULL, NULL); | "rna_LayerCollections_active_collection_set", NULL, NULL); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL); | RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL); | ||||
| RNA_def_property_ui_text(prop, "Active Layer Collection", "Active Layer Collection"); | RNA_def_property_ui_text(prop, "Active Layer Collection", "Active Layer Collection"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL); | ||||
| func = RNA_def_function(srna, "link", "rna_SceneLayer_collection_link"); | func = RNA_def_function(srna, "link", "rna_ViewLayer_collection_link"); | ||||
| RNA_def_function_ui_description(func, "Link a collection to render layer"); | RNA_def_function_ui_description(func, "Link a collection to render layer"); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); | RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); | ||||
| parm = RNA_def_pointer(func, "scene_collection", "SceneCollection", "", "Collection to add to render layer"); | parm = RNA_def_pointer(func, "scene_collection", "SceneCollection", "", "Collection to add to render layer"); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| parm = RNA_def_pointer(func, "result", "LayerCollection", "", "Newly created layer collection"); | parm = RNA_def_pointer(func, "result", "LayerCollection", "", "Newly created layer collection"); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| func = RNA_def_function(srna, "unlink", "rna_SceneLayer_collection_unlink"); | func = RNA_def_function(srna, "unlink", "rna_ViewLayer_collection_unlink"); | ||||
| RNA_def_function_ui_description(func, "Unlink a collection from render layer"); | RNA_def_function_ui_description(func, "Unlink a collection from render layer"); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS); | RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN | FUNC_USE_REPORTS); | ||||
| parm = RNA_def_pointer(func, "layer_collection", "LayerCollection", "", "Layer collection to remove from render layer"); | parm = RNA_def_pointer(func, "layer_collection", "LayerCollection", "", "Layer collection to remove from render layer"); | ||||
| RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); | ||||
| } | } | ||||
| static void rna_def_layer_objects(BlenderRNA *brna, PropertyRNA *cprop) | static void rna_def_layer_objects(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| RNA_def_property_srna(cprop, "LayerObjects"); | RNA_def_property_srna(cprop, "LayerObjects"); | ||||
| srna = RNA_def_struct(brna, "LayerObjects", NULL); | srna = RNA_def_struct(brna, "LayerObjects", NULL); | ||||
| RNA_def_struct_sdna(srna, "SceneLayer"); | RNA_def_struct_sdna(srna, "ViewLayer"); | ||||
| RNA_def_struct_ui_text(srna, "Layer Objects", "Collections of objects"); | RNA_def_struct_ui_text(srna, "Layer Objects", "Collections of objects"); | ||||
| prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "Object"); | RNA_def_property_struct_type(prop, "Object"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_LayerObjects_active_object_get", "rna_LayerObjects_active_object_set", NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_LayerObjects_active_object_get", "rna_LayerObjects_active_object_set", NULL, NULL); | ||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); | RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); | ||||
| RNA_def_property_ui_text(prop, "Active Object", "Active object for this layer"); | RNA_def_property_ui_text(prop, "Active Object", "Active object for this layer"); | ||||
| /* Could call: ED_object_base_activate(C, rl->basact); | /* Could call: ED_object_base_activate(C, rl->basact); | ||||
| * but would be a bad level call and it seems the notifier is enough */ | * but would be a bad level call and it seems the notifier is enough */ | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_OB_ACTIVE, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_OB_ACTIVE, NULL); | ||||
| prop = RNA_def_property(srna, "selected", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "selected", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL); | RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL); | ||||
| RNA_def_property_struct_type(prop, "Object"); | RNA_def_property_struct_type(prop, "Object"); | ||||
| RNA_def_property_collection_funcs(prop, "rna_LayerObjects_selected_begin", "rna_iterator_listbase_next", | RNA_def_property_collection_funcs(prop, "rna_LayerObjects_selected_begin", "rna_iterator_listbase_next", | ||||
| "rna_iterator_listbase_end", "rna_SceneLayer_objects_get", | "rna_iterator_listbase_end", "rna_ViewLayer_objects_get", | ||||
| NULL, NULL, NULL, NULL); | NULL, NULL, NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Selected Objects", "All the selected objects of this layer"); | RNA_def_property_ui_text(prop, "Selected Objects", "All the selected objects of this layer"); | ||||
| } | } | ||||
| static void rna_def_object_base(BlenderRNA *brna) | static void rna_def_object_base(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| ▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | static void rna_def_scene_view_render(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Use Spherical Stereo", "Active render engine supports spherical stereo rendering"); | RNA_def_property_ui_text(prop, "Use Spherical Stereo", "Active render engine supports spherical stereo rendering"); | ||||
| prop = RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_ViewRenderSettings_use_game_engine_get", NULL); | RNA_def_property_boolean_funcs(prop, "rna_ViewRenderSettings_use_game_engine_get", NULL); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine"); | RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine"); | ||||
| } | } | ||||
| void RNA_def_scene_layer(BlenderRNA *brna) | void RNA_def_view_layer(BlenderRNA *brna) | ||||
| { | { | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| srna = RNA_def_struct(brna, "SceneLayer", NULL); | srna = RNA_def_struct(brna, "ViewLayer", NULL); | ||||
| RNA_def_struct_ui_text(srna, "Render Layer", "Render layer"); | RNA_def_struct_ui_text(srna, "Render Layer", "Render layer"); | ||||
| RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS); | RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS); | ||||
| RNA_def_struct_idprops_func(srna, "rna_SceneLayer_idprops"); | RNA_def_struct_idprops_func(srna, "rna_ViewLayer_idprops"); | ||||
| rna_def_render_layer_common(srna, 1); | rna_def_view_layer_common(srna, 1); | ||||
| func = RNA_def_function(srna, "update_render_passes", "rna_SceneLayer_update_render_passes"); | func = RNA_def_function(srna, "update_render_passes", "rna_ViewLayer_update_render_passes"); | ||||
| RNA_def_function_ui_description(func, "Requery the enabled render passes from the render engine"); | RNA_def_function_ui_description(func, "Requery the enabled render passes from the render engine"); | ||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF); | RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF); | ||||
| prop = RNA_def_property(srna, "collections", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "collections", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_collection_sdna(prop, NULL, "layer_collections", NULL); | RNA_def_property_collection_sdna(prop, NULL, "layer_collections", NULL); | ||||
| RNA_def_property_struct_type(prop, "LayerCollection"); | RNA_def_property_struct_type(prop, "LayerCollection"); | ||||
| RNA_def_property_ui_text(prop, "Layer Collections", ""); | RNA_def_property_ui_text(prop, "Layer Collections", ""); | ||||
| rna_def_layer_collections(brna, prop); | rna_def_layer_collections(brna, prop); | ||||
| prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL); | RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL); | ||||
| RNA_def_property_struct_type(prop, "Object"); | RNA_def_property_struct_type(prop, "Object"); | ||||
| RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_SceneLayer_objects_get", NULL, NULL, NULL, NULL); | RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_ViewLayer_objects_get", NULL, NULL, NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Objects", "All the objects in this layer"); | RNA_def_property_ui_text(prop, "Objects", "All the objects in this layer"); | ||||
| rna_def_layer_objects(brna, prop); | rna_def_layer_objects(brna, prop); | ||||
| /* layer options */ | /* layer options */ | ||||
| prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SCENE_LAYER_RENDER); | RNA_def_property_boolean_sdna(prop, NULL, "flag", VIEW_LAYER_RENDER); | ||||
| RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer"); | RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL); | ||||
| prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SCENE_LAYER_FREESTYLE); | RNA_def_property_boolean_sdna(prop, NULL, "flag", VIEW_LAYER_FREESTYLE); | ||||
| RNA_def_property_ui_text(prop, "Freestyle", "Render stylized strokes in this Layer"); | RNA_def_property_ui_text(prop, "Freestyle", "Render stylized strokes in this Layer"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL); | ||||
| /* Freestyle */ | /* Freestyle */ | ||||
| rna_def_freestyle_settings(brna); | rna_def_freestyle_settings(brna); | ||||
| prop = RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_flag(prop, PROP_NEVER_NULL); | RNA_def_property_flag(prop, PROP_NEVER_NULL); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "freestyle_config"); | RNA_def_property_pointer_sdna(prop, NULL, "freestyle_config"); | ||||
| RNA_def_property_struct_type(prop, "FreestyleSettings"); | RNA_def_property_struct_type(prop, "FreestyleSettings"); | ||||
| RNA_def_property_ui_text(prop, "Freestyle Settings", ""); | RNA_def_property_ui_text(prop, "Freestyle Settings", ""); | ||||
| /* Override settings */ | /* Override settings */ | ||||
| prop = RNA_def_property(srna, "engine_overrides", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "engine_overrides", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_collection_sdna(prop, NULL, "properties->data.group", NULL); | RNA_def_property_collection_sdna(prop, NULL, "properties->data.group", NULL); | ||||
| RNA_def_property_struct_type(prop, "SceneLayerSettings"); | RNA_def_property_struct_type(prop, "ViewLayerSettings"); | ||||
| RNA_def_property_ui_text(prop, "Layer Settings", "Override of engine specific render settings"); | RNA_def_property_ui_text(prop, "Layer Settings", "Override of engine specific render settings"); | ||||
| /* debug update routine */ | /* debug update routine */ | ||||
| func = RNA_def_function(srna, "update", "rna_SceneLayer_update_tagged"); | func = RNA_def_function(srna, "update", "rna_ViewLayer_update_tagged"); | ||||
| RNA_def_function_flag(func, FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_USE_CONTEXT); | ||||
| RNA_def_function_ui_description(func, | RNA_def_function_ui_description(func, | ||||
| "Update data tagged to be updated from previous access to data or operators"); | "Update data tagged to be updated from previous access to data or operators"); | ||||
| /* Dependency Graph */ | /* Dependency Graph */ | ||||
| prop = RNA_def_property(srna, "depsgraph", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "depsgraph", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "Depsgraph"); | RNA_def_property_struct_type(prop, "Depsgraph"); | ||||
| RNA_def_property_ui_text(prop, "Dependency Graph", "Dependencies in the scene data"); | RNA_def_property_ui_text(prop, "Dependency Graph", "Dependencies in the scene data"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_SceneLayer_depsgraph_get", NULL, NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_ViewLayer_depsgraph_get", NULL, NULL, NULL); | ||||
| /* Nested Data */ | /* Nested Data */ | ||||
| /* *** Non-Animated *** */ | /* *** Non-Animated *** */ | ||||
| RNA_define_animate_sdna(false); | RNA_define_animate_sdna(false); | ||||
| rna_def_scene_collection(brna); | rna_def_scene_collection(brna); | ||||
| rna_def_layer_collection(brna); | rna_def_layer_collection(brna); | ||||
| rna_def_layer_collection_override(brna); | rna_def_layer_collection_override(brna); | ||||
| rna_def_object_base(brna); | rna_def_object_base(brna); | ||||
| RNA_define_animate_sdna(true); | RNA_define_animate_sdna(true); | ||||
| /* *** Animated *** */ | /* *** Animated *** */ | ||||
| rna_def_scene_layer_settings(brna); | rna_def_view_layer_settings(brna); | ||||
| rna_def_layer_collection_settings(brna); | rna_def_layer_collection_settings(brna); | ||||
| rna_def_scene_view_render(brna); | rna_def_scene_view_render(brna); | ||||
| } | } | ||||
| #endif | #endif | ||||