diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-13 23:09:13 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-13 23:09:13 +0400 |
commit | 41fb3626f3d7c1e75a31aebeb1e488f59aeedf68 (patch) | |
tree | 3a8498514cc822ab4adfe924400efbdad94bbab8 /source/blender/makesrna | |
parent | 689abe000dae8a36e4afe29ad01528408ae20e8c (diff) |
2.5: Render
* UI layout for scene buttons has quite some changes, I tried to
better organize things according to the pipeline, and also showing
important properties by default, and collapsing less important ones.
Some changes compared to 2.4x:
* Panorama is now a Camera property.
* Sequence and Compositing are now enabled by default, but will only
do something when there is a node tree using nodes, or a strip in the
sequence editor.
* Enabling Full Sample now automatically enables Save Buffers too.
* Stamp option to include info in file is removed, it now simply always
does this if one of the stamp infos is enabled.
* Xvid, H.264 and Ogg Theora are now directly in the file format menu,
but still using FFMPEG. Unfortunately Ogg is broken at the moment
(also in 2.4x), so that's disabled. And Xvid crashes on 64bit linux,
maybe solvable by upgrading extern/xvidcore/, using ubuntu libs makes
it work.
* Organized file format menu by image/movie types.
Added:
* Render layers RNA wrapped, operatorized, layouted.
* FFMPEG format/codec options are now working.
Defaults changed:
* Compositing & Sequencer enabled.
* Tiles set to 8x8.
* Time/Date/Frame/Scene/Camera/Filename enabled for stamp.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/SConscript | 26 | ||||
-rw-r--r-- | source/blender/makesrna/intern/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/Makefile | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/SConscript | 17 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_camera.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 444 |
6 files changed, 417 insertions, 77 deletions
diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 967636fe36b..89118850b20 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -9,4 +9,28 @@ objs += o incs = '#/intern/guardedalloc ../blenkernel ../blenlib ../makesdna intern .' incs += ' ../windowmanager ../editors/include ../imbuf' -env.BlenderLib ( 'bf_rna', objs, Split(incs), [], libtype=['core'], priority = [195] ) +defs = [] + +if env['WITH_BF_OPENEXR']: + defs.append('WITH_OPENEXR') + +if env['WITH_BF_OPENJPEG']: + defs.append('WITH_OPENJPEG') + +if env['WITH_BF_DDS']: + defs.append('WITH_DDS') + +if env['WITH_BF_FFMPEG']: + defs.append('WITH_FFMPEG') + incs += ' ' + env['BF_FFMPEG_INC'] + +if env['WITH_BF_OGG']: + defs.append('WITH_OGG') + +if env['WITH_BF_QUICKTIME']: + defs.append('WITH_QUICKTIME') + +if env['WITH_BF_LCMS']: + defs.append('WITH_LCMS') + +env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core'], priority = [195] ) diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 3400b69ee38..85505d546c4 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -59,6 +59,7 @@ IF(WITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) + SET(INC ${INC} ${FFMPEG_INC}) ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile index 1694e55ed4c..7f9bfbfea67 100644 --- a/source/blender/makesrna/intern/Makefile +++ b/source/blender/makesrna/intern/Makefile @@ -57,6 +57,7 @@ CPPFLAGS += -I. ifeq ($(WITH_FFMPEG),true) CPPFLAGS += -DWITH_FFMPEG + CPPFLAGS += $(NAN_FFMPEGCFLAGS) endif ifeq ($(WITH_OPENEXR), true) diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 03f0afdb2cc..7cd3fde21be 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -29,6 +29,10 @@ makesrna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesrna/\\"" ' defs = [] +incs = '#/intern/guardedalloc ../../blenlib ../../blenkernel' +incs += ' ../../imbuf ../../makesdna ../../makesrna' +incs += ' ../../windowmanager ../../editors/include' + if env['WITH_BF_OPENEXR']: defs.append('WITH_OPENEXR') @@ -40,6 +44,10 @@ if env['WITH_BF_DDS']: if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') + incs += ' ' + env['BF_FFMPEG_INC'] + +if env['WITH_BF_OGG']: + defs.append('WITH_OGG') if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') @@ -49,14 +57,7 @@ if env['WITH_BF_LCMS']: makesrna_tool.Append(CPPDEFINES=defs) -makesrna_tool.Append (CPPPATH = ['#/intern/guardedalloc', - '../../blenlib', - '../../blenkernel', - '../../imbuf', - '../../makesdna', - '../../makesrna', - '../../windowmanager', - '../../editors/include']) +makesrna_tool.Append (CPPPATH = Split(incs)) if env['OURPLATFORM'] == 'linuxcross': USE_WINE = True # when cross compiling on linux 64bit this is useful diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 4814f9583a9..9c33b0afb00 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -153,6 +153,11 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_lens_unit_items); RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface."); + prop= RNA_def_property(srna, "panorama", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_PANORAMA); + RNA_def_property_ui_text(prop, "Panorama", "Render the scene with a cylindrical camera for pseudo-fisheye lens effects."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + /* pointers */ rna_def_animdata_common(srna); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 6e2a6e27928..9c9fbf0e3cf 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -31,11 +31,11 @@ #include "DNA_scene_types.h" -/* +#ifdef WITH_FFMPEG #include "BKE_writeffmpeg.h" #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> -*/ +#endif #include "WM_types.h" @@ -52,8 +52,13 @@ EnumPropertyItem prop_mode_items[] ={ #ifdef RNA_RUNTIME +#include "DNA_node_types.h" + #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_node.h" + +#include "BLI_threads.h" PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter) { @@ -63,9 +68,8 @@ PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter) return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((Base*)internal->link)->object); } -static void rna_Scene_layer_set(PointerRNA *ptr, const int *values) +static int layer_set(int lay, const int *values) { - Scene *scene= (Scene*)ptr->data; int i, tot= 0; /* ensure we always have some layer selected */ @@ -74,12 +78,21 @@ static void rna_Scene_layer_set(PointerRNA *ptr, const int *values) tot++; if(tot==0) - return; + return lay; for(i=0; i<20; i++) { - if(values[i]) scene->lay |= (1<<i); - else scene->lay &= ~(1<<i); + if(values[i]) lay |= (1<<i); + else lay &= ~(1<<i); } + + return lay; +} + +static void rna_Scene_layer_set(PointerRNA *ptr, const int *values) +{ + Scene *scene= (Scene*)ptr->data; + + scene->lay= layer_set(scene->lay, values); } static void rna_Scene_start_frame_set(PointerRNA *ptr, int value) @@ -102,6 +115,92 @@ static void rna_Scene_frame_update(bContext *C, PointerRNA *ptr) //update_for_newframe(); } +static int rna_SceneRenderData_threads_get(PointerRNA *ptr) +{ + RenderData *rd= (RenderData*)ptr->data; + + if(rd->mode & R_FIXED_THREADS) + return rd->threads; + else + return BLI_system_thread_count(); +} + +static int rna_SceneRenderData_save_buffers_get(PointerRNA *ptr) +{ + RenderData *rd= (RenderData*)ptr->data; + + return (rd->scemode & (R_EXR_TILE_FILE|R_FULL_SAMPLE)) != 0; +} + +static void rna_SceneRenderData_file_format_set(PointerRNA *ptr, int value) +{ + RenderData *rd= (RenderData*)ptr->data; + + rd->imtype= value; + ffmpeg_verify_image_type(rd); +} + +static int rna_SceneRenderData_active_layer_index_get(PointerRNA *ptr) +{ + RenderData *rd= (RenderData*)ptr->data; + return rd->actlay; +} + +static void rna_SceneRenderData_active_layer_index_set(PointerRNA *ptr, int value) +{ + RenderData *rd= (RenderData*)ptr->data; + rd->actlay= value; +} + +static void rna_SceneRenderData_active_layer_index_range(PointerRNA *ptr, int *min, int *max) +{ + RenderData *rd= (RenderData*)ptr->data; + + *min= 0; + *max= BLI_countlist(&rd->layers)-1; + *max= MAX2(0, *max); +} + +static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value) +{ + Scene *scene= (Scene*)ptr->id.data; + SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data; + + BLI_strncpy(rl->name, value, sizeof(rl->name)); + + if(scene->nodetree) { + bNode *node; + int index= BLI_findindex(&scene->r.layers, rl); + + for(node= scene->nodetree->nodes.first; node; node= node->next) { + if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) { + if(node->custom1==index) + BLI_strncpy(node->name, rl->name, NODE_MAXSTR); + } + } + } +} + +static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values) +{ + SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data; + rl->lay= layer_set(rl->lay, values); +} + +static void rna_SceneRenderLayer_zmask_layer_set(PointerRNA *ptr, const int *values) +{ + SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data; + rl->lay_zmask= layer_set(rl->lay_zmask, values); +} + +static void rna_SceneRenderLayer_pass_update(bContext *C, PointerRNA *ptr) +{ + Scene *scene= (Scene*)ptr->id.data; + + if(scene->nodetree) + ntreeCompositForceHidden(scene->nodetree, scene); +} + #else void rna_def_sculpt(BlenderRNA *brna) @@ -257,6 +356,194 @@ void rna_def_tool_settings(BlenderRNA *brna) rna_def_sculpt(brna); } +void rna_def_scene_render_layer(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "SceneRenderLayer", NULL); + RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer."); + + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_property_ui_text(prop, "Name", "Render layer name."); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + RNA_def_struct_name_property(srna, prop); + + prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "mat_override"); + RNA_def_property_struct_type(prop, "Material"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Material Override", "Material to override all other materials in this render layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "Group"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Light Override", "Group to override all other lights in this render layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + /* layers */ + prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "lay", 1); + RNA_def_property_array(prop, 20); + RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer."); + RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set"); + + prop= RNA_def_property(srna, "zmask_layers", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1); + RNA_def_property_array(prop, 20); + RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers."); + RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_zmask_layer_set"); + + /* layer options */ + prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE); + RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "zmask", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK); + RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "zmask_negate", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK); + RNA_def_property_ui_text(prop, "Zmask Negate", "For Zmask, only render what is behind solid z values instead of in front."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "all_z", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z); + RNA_def_property_ui_text(prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "solid", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); + RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); + RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "ztransp", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); + RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); + RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); + RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "strand", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); + RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + /* passes */ + prop= RNA_def_property(srna, "pass_combined", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED); + RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_z", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z); + RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_vector", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR); + RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_normal", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL); + RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_uv", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV); + RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_mist", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_MIST); + RNA_def_property_ui_text(prop, "Mist", "Deliver mist factor pass (0.0-1.0)."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_object_index", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB); + RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_color", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA); + RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_diffuse", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE); + RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_specular", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC); + RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_shadow", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW); + RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_ao", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO); + RNA_def_property_ui_text(prop, "AO", "Deliver AO pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_reflection", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT); + RNA_def_property_ui_text(prop, "Reflection", "Deliver ratraced reflection pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_refraction", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT); + RNA_def_property_ui_text(prop, "Refraction", "Deliver ratraced refraction pass."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_specular_exclude", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SPEC); + RNA_def_property_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_shadow_exclude", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_SHADOW); + RNA_def_property_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_ao_exclude", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_AO); + RNA_def_property_ui_text(prop, "AO Exclude", "Exclude AO pass from combined."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_reflection_exclude", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT); + RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude ratraced reflection pass from combined."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + + prop= RNA_def_property(srna, "pass_refraction_exclude", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFRACT); + RNA_def_property_ui_text(prop, "Refraction Exclude", "Exclude ratraced refraction pass from combined."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); +} + void rna_def_scene_render_data(BlenderRNA *brna) { StructRNA *srna; @@ -324,10 +611,27 @@ void rna_def_scene_render_data(BlenderRNA *brna) static EnumPropertyItem image_type_items[] = { - {R_FRAMESERVER, "FRAMESERVER", 0, "Frame Server", ""}, -#ifdef WITH_FFMPEG - {R_FFMPEG, "FFMPEG", 0, "FFMpeg", ""}, + {R_PNG, "PNG", 0, "PNG", ""}, + {R_JPEG90, "JPEG", 0, "JPEG", ""}, +#ifdef WITH_OPENJPEG + {R_JP2, "JPEG2000", 0, "JPEG 2000", ""}, +#endif + {R_TIFF, "TIFF", 0, "TIFF", ""}, // XXX only with G.have_libtiff + {R_BMP, "BMP", 0, "BMP", ""}, + {R_TARGA, "TARGA", 0, "Targa", ""}, + {R_RAWTGA, "RAWTARGA", 0, "Targa Raw", ""}, + //{R_DDS, "DDS", 0, "DDS", ""}, // XXX not yet implemented + {R_HAMX, "HAMX", 0, "HamX", ""}, + {R_IRIS, "IRIS", 0, "Iris", ""}, + {0, "", 0, NULL, NULL}, +#ifdef WITH_OPENEXR + {R_OPENEXR, "OPENEXR", 0, "OpenEXR", ""}, + {R_MULTILAYER, "MULTILAYER", 0, "MultiLayer", ""}, #endif + {R_RADHDR, "RADHDR", 0, "Radiance HDR", ""}, + {R_CINEON, "CINEON", 0, "Cineon", ""}, + {R_DPX, "DPX", 0, "DPX", ""}, + {0, "", 0, NULL, NULL}, {R_AVIRAW, "AVIRAW", 0, "AVI Raw", ""}, {R_AVIJPEG, "AVIJPEG", 0, "AVI JPEG", ""}, #ifdef _WIN32 @@ -336,31 +640,25 @@ void rna_def_scene_render_data(BlenderRNA *brna) #ifdef WITH_QUICKTIME {R_QUICKTIME, "QUICKTIME", 0, "QuickTime", ""}, #endif - {R_TARGA, "TARGA", 0, "Targa", ""}, - {R_RAWTGA, "RAWTARGA", 0, "Targa Raw", ""}, - {R_PNG, "PNG", 0, "PNG", ""}, - //{R_DDS, "DDS", 0, "DDS", ""}, // XXX not yet implemented -//#ifdef WITH_OPENJPEG - {R_JP2, "JPEG2000", 0, "JPEG 2000", ""}, -//#endif - {R_BMP, "BMP", 0, "BMP", ""}, - {R_JPEG90, "JPEG", 0, "JPEG", ""}, - {R_HAMX, "HAMX", 0, "HamX", ""}, - {R_IRIS, "IRIS", 0, "Iris", ""}, - {R_RADHDR, "RADHDR", 0, "Radiance HDR", ""}, - {R_CINEON, "CINEON", 0, "Cineon", ""}, - {R_DPX, "DPX", 0, "DPX", ""}, #ifdef __sgi {R_MOVIE, "MOVIE", 0, "Movie", ""}, #endif -//#ifdef WITH_OPENEXR - {R_OPENEXR, "OPENEXR", 0, "OpenEXR", ""}, - {R_MULTILAYER, "MULTILAYER", 0, "MultiLayer", ""}, -//#endif - {R_TIFF, "TIFF", 0, "TIFF", ""}, // XXX only with G.have_libtiff +#ifdef WITH_FFMPEG + {R_H264, "H264", 0, "H.264", ""}, + {R_XVID, "XVID", 0, "Xvid", ""}, + // XXX broken +#if 0 +#ifdef WITH_OGG + {R_THEORA, "THEORA", 0, "Ogg Theora", ""}, +#endif +#endif + {R_FFMPEG, "FFMPEG", 0, "FFMpeg", ""}, +#endif + {0, "", 0, NULL, NULL}, + {R_FRAMESERVER, "FRAMESERVER", 0, "Frame Server", ""}, {0, NULL, 0, NULL, NULL}}; -//#ifdef WITH_OPENEXR +#ifdef WITH_OPENEXR static EnumPropertyItem exr_codec_items[] = { {0, "NONE", 0, "None", ""}, {1, "PXR24", 0, "Pxr24 (lossy)", ""}, @@ -368,9 +666,9 @@ void rna_def_scene_render_data(BlenderRNA *brna) {3, "PIZ", 0, "PIZ (lossless)", ""}, {4, "RLE", 0, "RLE (lossless)", ""}, {0, NULL, 0, NULL, NULL}}; -//#endif +#endif -//#ifdef WITH_OPENJPEG +#ifdef WITH_OPENJPEG static EnumPropertyItem jp2_preset_items[] = { {0, "NO_PRESET", 0, "No Preset", ""}, {1, "R_JPEG2K_CINE_PRESET", 0, "Cinema 24fps 2048x1080", ""}, @@ -387,20 +685,24 @@ void rna_def_scene_render_data(BlenderRNA *brna) {R_JPEG2K_12BIT, "16", 0, "16", ""}, {R_JPEG2K_16BIT, "32", 0, "32", ""}, {0, NULL, 0, NULL, NULL}}; -//#endif +#endif -/* #ifdef WITH_FFMPEG static EnumPropertyItem ffmpeg_format_items[] = { {FFMPEG_MPEG1, "MPEG1", 0, "MPEG-1", ""}, {FFMPEG_MPEG2, "MPEG2", 0, "MPEG-2", ""}, {FFMPEG_MPEG4, "MPEG4", 0, "MPEG-4", ""}, - {FFMPEG_AVI, "AVI", 0, "Avi", ""}, + {FFMPEG_AVI, "AVI", 0, "AVI", ""}, {FFMPEG_MOV, "QUICKTIME", 0, "Quicktime", ""}, {FFMPEG_DV, "DV", 0, "DV", ""}, - {FFMPEG_H264, "H264", 0, "H264", ""}, - {FFMPEG_XVID, "XVID", 0, "XVid", ""}, - {FFMPEG_OGG, "OGG", 0, "OGG", ""}, + {FFMPEG_H264, "H264", 0, "H.264", ""}, + {FFMPEG_XVID, "XVID", 0, "Xvid", ""}, + // XXX broken +#if 0 +#ifdef WITH_OGG + {FFMPEG_OGG, "OGG", 0, "Ogg", ""}, +#endif +#endif {FFMPEG_FLV, "FLASH", 0, "Flash", ""}, {0, NULL, 0, NULL, NULL}}; @@ -410,10 +712,12 @@ void rna_def_scene_render_data(BlenderRNA *brna) {CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""}, {CODEC_ID_HUFFYUV, "HUFFYUV", 0, "HuffYUV", ""}, {CODEC_ID_DVVIDEO, "DV", 0, "DV", ""}, - {CODEC_ID_H264, "H264", 0, "H264", ""}, - {CODEC_ID_XVID, "XVID", 0, "XVid", ""}, - {CODEC_ID_THEORA, "THEORA", 0, "OGG Theora", ""}, - {CODEC_ID_FLV1, "FLASH", 0, "FlashVideo1", ""}, + {CODEC_ID_H264, "H264", 0, "H.264", ""}, + {CODEC_ID_XVID, "XVID", 0, "Xvid", ""}, +#ifdef WITH_OGG + {CODEC_ID_THEORA, "THEORA", 0, "Theora", ""}, +#endif + {CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem ffmpeg_audio_codec_items[] = { @@ -425,7 +729,6 @@ void rna_def_scene_render_data(BlenderRNA *brna) {CODEC_ID_PCM_S16LE, "PCM", 0, "PCM", ""}, {0, NULL, 0, NULL, NULL}}; #endif -*/ srna= RNA_def_struct(brna, "SceneRenderData", NULL); RNA_def_struct_sdna(srna, "RenderData"); @@ -518,7 +821,7 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "G", "Log conversion gamma"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); -//#ifdef WITH_OPENEXR +#ifdef WITH_OPENEXR /* OpenEXR */ prop= RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE); @@ -541,9 +844,9 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_PREVIEW_JPG); RNA_def_property_ui_text(prop, "Preview", "When rendering animations, save JPG preview images in same directory"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); -//#endif +#endif -//#ifdef WITH_OPENJPEG +#ifdef WITH_OPENJPEG /* Jpeg 2000 */ prop= RNA_def_property(srna, "jpeg_preset", PROP_ENUM, PROP_NONE); @@ -562,12 +865,11 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_JPEG2K_YCC); RNA_def_property_ui_text(prop, "YCC", "Save luminance-chrominance-chrominance channels instead of RGB colors"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); -//#endif +#endif #ifdef WITH_FFMPEG /* FFMPEG Video*/ - /* prop= RNA_def_property(srna, "ffmpeg_format", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.type"); RNA_def_property_enum_items(prop, ffmpeg_format_items); @@ -579,7 +881,6 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_enum_items(prop, ffmpeg_codec_items); RNA_def_property_ui_text(prop, "Codec", "FFMpeg codec to use"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - */ prop= RNA_def_property(srna, "ffmpeg_video_bitrate", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.video_bitrate"); @@ -630,13 +931,11 @@ void rna_def_scene_render_data(BlenderRNA *brna) /* FFMPEG Audio*/ - /* prop= RNA_def_property(srna, "ffmpeg_audio_codec", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "ffcodecdata.audio_codec"); RNA_def_property_enum_items(prop, ffmpeg_audio_codec_items); - RNA_def_property_ui_text(prop, Codec", "FFMpeg codec to use"); + RNA_def_property_ui_text(prop, "Audio Codec", "FFMpeg audio codec to use"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - */ prop= RNA_def_property(srna, "ffmpeg_audio_bitrate", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ffcodecdata.audio_bitrate"); @@ -765,14 +1064,10 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Edge Color", ""); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "panorama", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", R_PANORAMA); - RNA_def_property_ui_text(prop, "Panorama", "Render the scene with a cylindrical camera for pseudo-fisheye lens effects"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "threads", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "threads"); RNA_def_property_range(prop, 1, 8); + RNA_def_property_int_funcs(prop, "rna_SceneRenderData_threads_get", NULL, NULL); RNA_def_property_ui_text(prop, "Threads", "Number of CPU threads to use simultaneously while rendering (for multi-core/CPU systems)"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); @@ -806,14 +1101,14 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "No Overwrite", "Skip and don't overwrite existing files while rendering"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "do_composite", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP); - RNA_def_property_ui_text(prop, "Do Composite", "Process the render result through the compositing pipeline"); + RNA_def_property_ui_text(prop, "Compositing", "Process the render result through the compositing pipeline, if a compositing nodes are enabled."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "do_sequence", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ); - RNA_def_property_ui_text(prop, "Do Sequence", "Process the render (and composited) result through the video sequence editor pipeline"); + RNA_def_property_ui_text(prop, "Sequencer", "Process the render (and composited) result through the video sequence editor pipeline, if sequencer strips exist."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "file_extensions", PROP_BOOLEAN, PROP_NONE); @@ -824,6 +1119,7 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "imtype"); RNA_def_property_enum_items(prop, image_type_items); + RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_file_format_set", NULL); RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); @@ -834,12 +1130,13 @@ void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "save_buffers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE); - RNA_def_property_ui_text(prop, "Save Buffers","Save tiles for all RenderLayers and SceneNodes to files in the temp directory (saves memory, allows Full Sampling)."); + RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_save_buffers_get", NULL); + RNA_def_property_ui_text(prop, "Save Buffers","Save tiles for all RenderLayers and SceneNodes to files in the temp directory (saves memory, required for Full Sample)."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "full_sample", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE); - RNA_def_property_ui_text(prop, "Full Sample","Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing"); + RNA_def_property_ui_text(prop, "Full Sample","Save for every anti-aliasing sample the entire RenderLayer results. This solves anti-aliasing issues with compositing."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "backbuf", PROP_BOOLEAN, PROP_NONE); @@ -857,11 +1154,6 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "stamp", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_STAMP_INFO); - RNA_def_property_ui_text(prop, "Stamp", "Embed metadata into the rendered image"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "stamp_time", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME); RNA_def_property_ui_text(prop, "Stamp Time", "Include the current time in image metadata"); @@ -935,6 +1227,21 @@ void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "layers", NULL); + RNA_def_property_struct_type(prop, "SceneRenderLayer"); + RNA_def_property_ui_text(prop, "Render Layers", ""); + + prop= RNA_def_property(srna, "single_layer", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER); + RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "actlay"); + RNA_def_property_int_funcs(prop, "rna_SceneRenderData_active_layer_index_get", "rna_SceneRenderData_active_layer_index_set", "rna_SceneRenderData_active_layer_index_range"); + RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); } void RNA_def_scene(BlenderRNA *brna) @@ -1038,6 +1345,7 @@ void RNA_def_scene(BlenderRNA *brna) rna_def_tool_settings(brna); rna_def_scene_render_data(brna); + rna_def_scene_render_layer(brna); } #endif |