Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c296
1 files changed, 267 insertions, 29 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 70ce87ab68b..3e7ffcd8cf0 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -82,6 +82,11 @@ EnumPropertyItem exr_codec_items[] = {
{R_IMF_EXR_CODEC_ZIP, "ZIP", 0, "ZIP (lossless)", ""},
{R_IMF_EXR_CODEC_PIZ, "PIZ", 0, "PIZ (lossless)", ""},
{R_IMF_EXR_CODEC_RLE, "RLE", 0, "RLE (lossless)", ""},
+ {R_IMF_EXR_CODEC_ZIPS, "ZIPS", 0, "ZIPS (lossless)", ""},
+ {R_IMF_EXR_CODEC_B44, "B44", 0, "B44 (lossy)", ""},
+ {R_IMF_EXR_CODEC_B44A, "B44A", 0, "B44A (lossy)", ""},
+ {R_IMF_EXR_CODEC_DWAA, "DWAA", 0, "DWAA (lossy)", ""},
+ {R_IMF_EXR_CODEC_DWAB, "DWAB", 0, "DWAB (lossy)", ""},
{0, NULL, 0, NULL, NULL}
};
#endif
@@ -112,6 +117,7 @@ EnumPropertyItem proportional_falloff_items[] = {
{PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"},
{PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"},
{PROP_ROOT, "ROOT", ICON_ROOTCURVE, "Root", "Root falloff"},
+ {PROP_INVSQUARE, "INVERSE_SQUARE", ICON_ROOTCURVE, "Inverse Square", "Inverse Square falloff"},
{PROP_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", "Sharp falloff"},
{PROP_LIN, "LINEAR", ICON_LINCURVE, "Linear", "Linear falloff"},
{PROP_CONST, "CONSTANT", ICON_NOCURVE, "Constant", "Constant falloff"},
@@ -385,7 +391,7 @@ static int rna_Scene_object_bases_lookup_string(PointerRNA *ptr, const char *key
Base *base;
for (base = scene->base.first; base; base = base->next) {
- if (strncmp(base->object->id.name + 2, key, sizeof(base->object->id.name) - 2) == 0) {
+ if (STREQLEN(base->object->id.name + 2, key, sizeof(base->object->id.name) - 2)) {
*r_ptr = rna_pointer_inherit_refine(ptr, &RNA_ObjectBase, base);
return true;
}
@@ -737,7 +743,7 @@ static int rna_RenderSettings_threads_mode_get(PointerRNA *ptr)
return (rd->mode & R_FIXED_THREADS);
}
-static int rna_RenderSettings_is_movie_fomat_get(PointerRNA *ptr)
+static int rna_RenderSettings_is_movie_format_get(PointerRNA *ptr)
{
RenderData *rd = (RenderData *)ptr->data;
return BKE_imtype_is_movie(rd->im_format.imtype);
@@ -753,7 +759,7 @@ static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr)
else if (!BKE_scene_use_new_shading_nodes(scene))
return (rd->scemode & (R_EXR_TILE_FILE | R_FULL_SAMPLE)) != 0;
else
- return (rd->scemode & R_EXR_TILE_FILE);
+ return (rd->scemode & R_EXR_TILE_FILE) != 0;
}
static int rna_RenderSettings_full_sample_get(PointerRNA *ptr)
@@ -937,12 +943,41 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_depth_itemf(bContext *UNU
}
}
+#ifdef WITH_OPENEXR
+ /* OpenEXR */
+
+static EnumPropertyItem *rna_ImageFormatSettings_exr_codec_itemf(bContext *UNUSED(C), PointerRNA *ptr,
+PropertyRNA *UNUSED(prop), bool *r_free)
+{
+ ImageFormatData *imf = (ImageFormatData *)ptr->data;
+
+ EnumPropertyItem *item = NULL;
+ int i = 1, totitem = 0;
+
+ if (imf->depth == 16)
+ return exr_codec_items; /* All compression types are defined for halfs */
+
+ for (i = 0; i < R_IMF_EXR_CODEC_MAX; i++) {
+ if ((i == R_IMF_EXR_CODEC_B44 || i == R_IMF_EXR_CODEC_B44A)) {
+ continue; /* B44 and B44A are not defined for 32 bit floats */
+ }
+
+ RNA_enum_item_add(&item, &totitem, &exr_codec_items[i]);
+ }
+
+ RNA_enum_item_end(&item, &totitem);
+ *r_free = true;
+
+ return item;
+}
+
+#endif
static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
{
RenderData *rd = (RenderData *)ptr->data;
char ext[8];
ext[0] = '\0';
- BKE_add_image_extension(ext, &rd->im_format);
+ BKE_image_path_ensure_ext_from_imformat(ext, &rd->im_format);
return strlen(ext);
}
@@ -950,7 +985,7 @@ static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
{
RenderData *rd = (RenderData *)ptr->data;
str[0] = '\0';
- BKE_add_image_extension(str, &rd->im_format);
+ BKE_image_path_ensure_ext_from_imformat(str, &rd->im_format);
}
#ifdef WITH_QUICKTIME
@@ -1063,7 +1098,7 @@ static int rna_RenderSettings_active_layer_index_get(PointerRNA *ptr)
static void rna_RenderSettings_active_layer_index_set(PointerRNA *ptr, int value)
{
RenderData *rd = (RenderData *)ptr->data;
- int num_layers = BLI_countlist(&rd->layers);
+ int num_layers = BLI_listbase_count(&rd->layers);
rd->actlay = min_ff(value, num_layers - 1);
}
@@ -1073,7 +1108,7 @@ static void rna_RenderSettings_active_layer_index_range(PointerRNA *ptr, int *mi
RenderData *rd = (RenderData *)ptr->data;
*min = 0;
- *max = max_ii(0, BLI_countlist(&rd->layers) - 1);
+ *max = max_ii(0, BLI_listbase_count(&rd->layers) - 1);
}
static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr)
@@ -1158,7 +1193,7 @@ static int rna_RenderSettings_engine_get(PointerRNA *ptr)
int a = 0;
for (type = R_engines.first; type; type = type->next, a++)
- if (strcmp(type->idname, rd->engine) == 0)
+ if (STREQ(type->idname, rd->engine))
return a;
return 0;
@@ -1228,7 +1263,7 @@ static char *rna_SceneRenderLayer_path(PointerRNA *ptr)
static int rna_RenderSettings_multiple_engines_get(PointerRNA *UNUSED(ptr))
{
- return (BLI_countlist(&R_engines) > 1);
+ return (BLI_listbase_count(&R_engines) > 1);
}
static int rna_RenderSettings_use_shading_nodes_get(PointerRNA *ptr)
@@ -1243,8 +1278,8 @@ static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
RenderEngineType *type;
for (type = R_engines.first; type; type = type->next)
- if (strcmp(type->idname, rd->engine) == 0)
- return (type->flag & RE_GAME);
+ if (STREQ(type->idname, rd->engine))
+ return (type->flag & RE_GAME) != 0;
return 0;
}
@@ -1375,7 +1410,7 @@ static void rna_Scene_use_persistent_data_update(Main *UNUSED(bmain), Scene *UNU
static int rna_Scene_use_audio_get(PointerRNA *ptr)
{
Scene *scene = (Scene *)ptr->data;
- return scene->audio.flag & AUDIO_MUTE;
+ return (scene->audio.flag & AUDIO_MUTE) != 0;
}
static void rna_Scene_use_audio_set(PointerRNA *ptr, int value)
@@ -1417,10 +1452,7 @@ static void rna_Scene_sync_mode_set(PointerRNA *ptr, int value)
static int rna_GameSettings_auto_start_get(PointerRNA *UNUSED(ptr))
{
- if (G.fileflags & G_FILE_AUTOPLAY)
- return 1;
-
- return 0;
+ return (G.fileflags & G_FILE_AUTOPLAY) != 0;
}
static void rna_GameSettings_auto_start_set(PointerRNA *UNUSED(ptr), int value)
@@ -1485,7 +1517,7 @@ static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, cons
ks = BKE_keyingset_add(&sce->keyingsets, idname, name, KEYINGSET_ABSOLUTE, 0);
if (ks) {
- sce->active_keyingset = BLI_countlist(&sce->keyingsets);
+ sce->active_keyingset = BLI_listbase_count(&sce->keyingsets);
return ks;
}
else {
@@ -1645,7 +1677,7 @@ static void rna_FreestyleSettings_active_lineset_index_range(PointerRNA *ptr, in
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
*min = 0;
- *max = max_ii(0, BLI_countlist(&config->linesets) - 1);
+ *max = max_ii(0, BLI_listbase_count(&config->linesets) - 1);
}
static int rna_FreestyleSettings_active_lineset_index_get(PointerRNA *ptr)
@@ -1691,6 +1723,28 @@ static void rna_FreestyleSettings_module_remove(ID *id, FreestyleSettings *confi
WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL);
}
+char *rna_GPUDOF_path(PointerRNA *ptr)
+{
+ /* if there is ID-data, resolve the path using the index instead of by name,
+ * since the name used is the name of the texture assigned, but the texture
+ * may be used multiple times in the same stack
+ */
+ if (ptr->id.data) {
+ if (GS(((ID *)ptr->id.data)->name) == ID_CA) {
+ return BLI_strdup("gpu_dof");
+ }
+ }
+
+ return BLI_strdup("");;
+}
+
+static void rna_GPUFXSettings_fx_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
+{
+ GPUFXSettings *fx_settings = ptr->data;
+
+ BKE_screen_gpu_fx_validate(fx_settings);
+}
+
#else
static void rna_def_transform_orientation(BlenderRNA *brna)
@@ -1773,6 +1827,14 @@ static void rna_def_tool_settings(BlenderRNA *brna)
{WT_VGROUP_BONE_DEFORM_OFF, "OTHER_DEFORM", 0, "Other", "Vertex Groups assigned to non Deform Bones"},
{0, NULL, 0, NULL, NULL}
};
+
+ static EnumPropertyItem gpencil_source_3d_items[] = {
+ {GP_TOOL_SOURCE_SCENE, "SCENE", 0, "Scene",
+ "Grease Pencil data attached to the current scene is used, unless the active object already has Grease Pencil data (i.e. for old files)"},
+ {GP_TOOL_SOURCE_OBJECT, "OBJECT", 0, "Object",
+ "Grease Pencil datablocks attached to the active object are used (required using pre 2.73 add-ons, e.g. BSurfaces)"},
+ {0, NULL, 0, NULL, NULL}
+ };
srna = RNA_def_struct(brna, "ToolSettings", NULL);
@@ -1965,6 +2027,13 @@ static void rna_def_tool_settings(BlenderRNA *brna)
"Allow drawing multiple strokes at a time with Grease Pencil");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* xxx: need toolbar to be redrawn... */
+ prop = RNA_def_property(srna, "grease_pencil_source", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_src");
+ RNA_def_property_enum_items(prop, gpencil_source_3d_items);
+ RNA_def_property_ui_text(prop, "Grease Pencil Source",
+ "Datablock where active Grease Pencil data is found from");
+ RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
+
/* Auto Keying */
prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
@@ -3192,7 +3261,7 @@ static void rna_def_scene_game_recast_data(BlenderRNA *brna)
prop = RNA_def_property(srna, "slope_max", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "agentmaxslope");
- RNA_def_property_range(prop, 0, M_PI / 2);
+ RNA_def_property_range(prop, 0, M_PI_2);
RNA_def_property_ui_text(prop, "Max Slope", "Maximum walkable slope angle");
RNA_def_property_update(prop, NC_SCENE, NULL);
@@ -3607,8 +3676,8 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop = RNA_def_property(srna, "logic_step_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxlogicstep");
- RNA_def_property_ui_range(prop, 1, 5, 1, 1);
- RNA_def_property_range(prop, 1, 5);
+ RNA_def_property_range(prop, 1, 10000);
+ RNA_def_property_ui_range(prop, 1, 50, 1, 1);
RNA_def_property_ui_text(prop, "Max Logic Steps",
"Maximum number of logic frame per game frame if graphics slows down the game, "
"higher value allows better synchronization with physics");
@@ -3616,8 +3685,8 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
prop = RNA_def_property(srna, "physics_step_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "maxphystep");
- RNA_def_property_ui_range(prop, 1, 5, 1, 1);
- RNA_def_property_range(prop, 1, 5);
+ RNA_def_property_range(prop, 1, 10000);
+ RNA_def_property_ui_range(prop, 1, 50, 1, 1);
RNA_def_property_ui_text(prop, "Max Physics Steps",
"Maximum number of physics step per game frame if graphics slows down the game, "
"higher value allows physics to keep up with realtime");
@@ -3806,6 +3875,114 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
rna_def_scene_game_recast_data(brna);
}
+static void rna_def_gpu_dof_fx(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "GPUDOFSettings", NULL);
+ RNA_def_struct_ui_text(srna, "GPU DOF", "Settings for GPU based depth of field");
+ RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
+ RNA_def_struct_path_func(srna, "rna_GPUDOF_path");
+
+ prop = RNA_def_property(srna, "focus_distance", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_ui_text(prop, "Focus distance", "Viewport depth of field focus distance");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0f, 5000.0f, 1, 2);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ prop = RNA_def_property(srna, "focal_length", PROP_FLOAT, PROP_DISTANCE_CAMERA);
+ RNA_def_property_ui_text(prop, "Focal Length", "Focal length for dof effect");
+ RNA_def_property_range(prop, 1.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 1.0f, 5000.0f, 1, 2);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ prop = RNA_def_property(srna, "sensor", PROP_FLOAT, PROP_DISTANCE_CAMERA);
+ RNA_def_property_ui_text(prop, "Sensor", "Size of sensor");
+ RNA_def_property_range(prop, 1.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 1.0f, 5000.0f, 1, 2);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ prop = RNA_def_property(srna, "fstop", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Viewport F-stop", "F-stop for dof effect");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.1f, 128.0f, 10, 1);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+}
+
+static void rna_def_gpu_ssao_fx(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna = RNA_def_struct(brna, "GPUSSAOSettings", NULL);
+ RNA_def_struct_ui_text(srna, "GPU SSAO", "Settings for GPU based screen space ambient occlusion");
+ RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
+
+ prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Strength", "Strength of the SSAO effect");
+ RNA_def_property_range(prop, 0.0f, 250.0f);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ prop = RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Distance", "Distance of object that contribute to the SSAO effect");
+ RNA_def_property_range(prop, 0.0f, 100000.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, 3);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ prop = RNA_def_property(srna, "attenuation", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Attenuation", "Attenuation constant");
+ RNA_def_property_range(prop, 1.0f, 100000.0f);
+ RNA_def_property_ui_range(prop, 1.0f, 100.0f, 1, 3);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Samples", "Number of samples");
+ RNA_def_property_range(prop, 1, 500);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_ui_text(prop, "Color", "Color for screen space ambient occlusion effect");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+}
+
+
+static void rna_def_gpu_fx(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ rna_def_gpu_ssao_fx(brna);
+ rna_def_gpu_dof_fx(brna);
+
+ srna = RNA_def_struct(brna, "GPUFXSettings", NULL);
+ RNA_def_struct_ui_text(srna, "GPU FX Settings", "Settings for GPU based compositing");
+ RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
+
+ prop = RNA_def_property(srna, "dof", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
+ RNA_def_property_struct_type(prop, "GPUDOFSettings");
+ RNA_def_property_ui_text(prop, "Depth Of Field settings", "");
+
+ prop = RNA_def_property(srna, "use_dof", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "fx_flag", GPU_FX_FLAG_DOF);
+ RNA_def_property_ui_text(prop, "Depth Of Field", "Use depth of field on viewport using the values from active camera");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPUFXSettings_fx_update");
+
+
+ prop = RNA_def_property(srna, "ssao", PROP_POINTER, PROP_NONE);
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
+ RNA_def_property_struct_type(prop, "GPUSSAOSettings");
+ RNA_def_property_ui_text(prop, "Screen Space Ambient Occlusion settings", "");
+
+ prop = RNA_def_property(srna, "use_ssao", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "fx_flag", GPU_FX_FLAG_SSAO);
+ RNA_def_property_ui_text(prop, "SSAO", "Use screen space ambient occlusion of field on viewport");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPUFXSettings_fx_update");
+}
+
+
static void rna_def_scene_render_layer(BlenderRNA *brna)
{
StructRNA *srna;
@@ -3958,6 +4135,7 @@ static void rna_def_scene_image_format_data(BlenderRNA *brna)
prop = RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "exr_codec");
RNA_def_property_enum_items(prop, exr_codec_items);
+ RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ImageFormatSettings_exr_codec_itemf");
RNA_def_property_ui_text(prop, "Codec", "Codec settings for OpenEXR");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
@@ -4666,6 +4844,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE_FRS);
RNA_def_property_ui_text(prop, "Edge", "Draw stylized strokes using Freestyle");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
@@ -4801,7 +4980,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop = RNA_def_property(srna, "is_movie_format", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_fomat_get", NULL);
+ RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_is_movie_format_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Movie Format", "When true the format is a movie");
@@ -5375,6 +5554,55 @@ static void rna_def_selected_uv_element(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Face Index", "");
}
+static void rna_def_display_safe_areas(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ static float default_title[2] = {0.035f, 0.035f};
+ static float default_action[2] = {0.1f, 0.05f};
+
+ static float default_title_center[2] = {0.175f, 0.05f};
+ static float default_action_center[2] = {0.15f, 0.05f};
+
+ srna = RNA_def_struct(brna, "DisplaySafeAreas", NULL);
+ RNA_def_struct_ui_text(srna, "Safe Areas", "Safe Areas used in 3D view and the VSE");
+ RNA_def_struct_sdna(srna, "DisplaySafeAreas");
+
+ /* SAFE AREAS */
+ prop = RNA_def_property(srna, "title", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "title");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_float_array_default(prop, default_title);
+ RNA_def_property_ui_text(prop, "Title Safe margins", "Safe area for text and graphics");
+ RNA_def_property_update(prop, NC_SCENE | ND_DRAW_RENDER_VIEWPORT, NULL);
+
+ prop = RNA_def_property(srna, "action", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "action");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_float_array_default(prop, default_action);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Action Safe Margins", "Safe area for general elements");
+ RNA_def_property_update(prop, NC_SCENE | ND_DRAW_RENDER_VIEWPORT, NULL);
+
+
+ prop = RNA_def_property(srna, "title_center", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "title_center");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_float_array_default(prop, default_title_center);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Center Title Safe Margins", "Safe area for text and graphics in a different aspect ratio");
+ RNA_def_property_update(prop, NC_SCENE | ND_DRAW_RENDER_VIEWPORT, NULL);
+
+ prop = RNA_def_property(srna, "action_center", PROP_FLOAT, PROP_XYZ);
+ RNA_def_property_float_sdna(prop, NULL, "action_center");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_float_array_default(prop, default_action_center);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Center Action Safe Margins", "Safe area for general elements in a different aspect ratio");
+ RNA_def_property_update(prop, NC_SCENE | ND_DRAW_RENDER_VIEWPORT, NULL);
+}
void RNA_def_scene(BlenderRNA *brna)
@@ -5459,7 +5687,7 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20);
RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set");
- RNA_def_property_ui_text(prop, "Layers", "Visible layers - Shift-Click to select multiple layers");
+ RNA_def_property_ui_text(prop, "Layers", "Visible layers - Shift-Click/Drag to select multiple layers");
RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_Scene_layer_update");
/* active layer */
@@ -5670,6 +5898,13 @@ void RNA_def_scene(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "RenderSettings");
RNA_def_property_ui_text(prop, "Render Data", "");
+ /* Safe Areas */
+ prop = RNA_def_property(srna, "safe_areas", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "safe_areas");
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
+ RNA_def_property_struct_type(prop, "DisplaySafeAreas");
+ RNA_def_property_ui_text(prop, "Safe Areas", "");
+
/* Markers */
prop = RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "markers", NULL);
@@ -5717,7 +5952,7 @@ void RNA_def_scene(BlenderRNA *brna)
prop = RNA_def_property(srna, "audio_volume", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "audio.volume");
- RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_range(prop, 0.0f, 100.0f);
RNA_def_property_ui_text(prop, "Volume", "Audio volume");
RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_ID_SOUND);
RNA_def_property_update(prop, NC_SCENE, NULL);
@@ -5738,10 +5973,10 @@ void RNA_def_scene(BlenderRNA *brna)
/* Grease Pencil */
prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "gpd");
- RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "GreasePencil");
+ RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock");
- RNA_def_property_update(prop, NC_SCENE, NULL);
+ RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
/* Transform Orientations */
prop = RNA_def_property(srna, "orientations", PROP_COLLECTION, PROP_NONE);
@@ -5784,11 +6019,14 @@ void RNA_def_scene(BlenderRNA *brna)
rna_def_scene_game_data(brna);
rna_def_transform_orientation(brna);
rna_def_selected_uv_element(brna);
+ rna_def_display_safe_areas(brna);
RNA_define_animate_sdna(true);
/* *** Animated *** */
rna_def_scene_render_data(brna);
rna_def_scene_render_layer(brna);
-
+
+ rna_def_gpu_fx(brna);
+
/* Scene API */
RNA_api_scene(srna);
}