* Wrapped RenderResult, RenderLayer, RenderPass.
* Update RNA_access.h with new structs.
This commit is contained in:
Brecht Van Lommel 2009-07-21 14:11:51 +00:00
parent 0b49dc77de
commit b5457e8e70
11 changed files with 362 additions and 53 deletions

@ -62,6 +62,15 @@ extern StructRNA RNA_BevelModifier;
extern StructRNA RNA_BezierCurvePoint; extern StructRNA RNA_BezierCurvePoint;
extern StructRNA RNA_BlendTexture; extern StructRNA RNA_BlendTexture;
extern StructRNA RNA_BlenderRNA; extern StructRNA RNA_BlenderRNA;
extern StructRNA RNA_BoidRule;
extern StructRNA RNA_BoidRuleAverageSpeed;
extern StructRNA RNA_BoidRuleAvoid;
extern StructRNA RNA_BoidRuleAvoidCollision;
extern StructRNA RNA_BoidRuleFight;
extern StructRNA RNA_BoidRuleFollowLeader;
extern StructRNA RNA_BoidRuleGoal;
extern StructRNA RNA_BoidSettings;
extern StructRNA RNA_BoidState;
extern StructRNA RNA_Bone; extern StructRNA RNA_Bone;
extern StructRNA RNA_BoneGroup; extern StructRNA RNA_BoneGroup;
extern StructRNA RNA_BooleanModifier; extern StructRNA RNA_BooleanModifier;
@ -143,6 +152,7 @@ extern StructRNA RNA_CompositorNodeValue;
extern StructRNA RNA_CompositorNodeVecBlur; extern StructRNA RNA_CompositorNodeVecBlur;
extern StructRNA RNA_CompositorNodeViewer; extern StructRNA RNA_CompositorNodeViewer;
extern StructRNA RNA_CompositorNodeZcombine; extern StructRNA RNA_CompositorNodeZcombine;
extern StructRNA RNA_ConsoleLine;
extern StructRNA RNA_Constraint; extern StructRNA RNA_Constraint;
extern StructRNA RNA_ConstraintTarget; extern StructRNA RNA_ConstraintTarget;
extern StructRNA RNA_Context; extern StructRNA RNA_Context;
@ -171,23 +181,22 @@ extern StructRNA RNA_EnumProperty;
extern StructRNA RNA_EnumPropertyItem; extern StructRNA RNA_EnumPropertyItem;
extern StructRNA RNA_EnvironmentMap; extern StructRNA RNA_EnvironmentMap;
extern StructRNA RNA_EnvironmentMapTexture; extern StructRNA RNA_EnvironmentMapTexture;
extern StructRNA RNA_Event;
extern StructRNA RNA_ExplodeModifier; extern StructRNA RNA_ExplodeModifier;
extern StructRNA RNA_ExpressionController; extern StructRNA RNA_ExpressionController;
extern StructRNA RNA_Event;
extern StructRNA RNA_FCurve; extern StructRNA RNA_FCurve;
extern StructRNA RNA_FCurveSample; extern StructRNA RNA_FCurveSample;
extern StructRNA RNA_FileSelectParams;
extern StructRNA RNA_FModifier; extern StructRNA RNA_FModifier;
extern StructRNA RNA_FModifierCycles; extern StructRNA RNA_FModifierCycles;
extern StructRNA RNA_FModifierEnvelope; extern StructRNA RNA_FModifierEnvelope;
extern StructRNA RNA_FModifierEnvelopeControlPoint; extern StructRNA RNA_FModifierEnvelopeControlPoint;
extern StructRNA RNA_FModifierFunctionGenerator; extern StructRNA RNA_FModifierFunctionGenerator;
extern StructRNA RNA_FModifierGenerator; extern StructRNA RNA_FModifierGenerator;
extern StructRNA RNA_FModifierGenerator_PolyExpanded;
extern StructRNA RNA_FModifierLimits; extern StructRNA RNA_FModifierLimits;
extern StructRNA RNA_FModifierNoise; extern StructRNA RNA_FModifierNoise;
extern StructRNA RNA_FModifierPython; extern StructRNA RNA_FModifierPython;
extern StructRNA RNA_FieldSettings; extern StructRNA RNA_FieldSettings;
extern StructRNA RNA_FileSelectParams;
extern StructRNA RNA_FloatProperty; extern StructRNA RNA_FloatProperty;
extern StructRNA RNA_FloorConstraint; extern StructRNA RNA_FloorConstraint;
extern StructRNA RNA_FluidFluidSettings; extern StructRNA RNA_FluidFluidSettings;
@ -222,7 +231,6 @@ extern StructRNA RNA_Key;
extern StructRNA RNA_KeyboardSensor; extern StructRNA RNA_KeyboardSensor;
extern StructRNA RNA_KeyingSet; extern StructRNA RNA_KeyingSet;
extern StructRNA RNA_KeyingSetPath; extern StructRNA RNA_KeyingSetPath;
extern StructRNA RNA_ParticleTarget;
extern StructRNA RNA_KinematicConstraint; extern StructRNA RNA_KinematicConstraint;
extern StructRNA RNA_Lamp; extern StructRNA RNA_Lamp;
extern StructRNA RNA_LampSkySettings; extern StructRNA RNA_LampSkySettings;
@ -278,8 +286,8 @@ extern StructRNA RNA_MultiresModifier;
extern StructRNA RNA_MusgraveTexture; extern StructRNA RNA_MusgraveTexture;
extern StructRNA RNA_NandController; extern StructRNA RNA_NandController;
extern StructRNA RNA_NearSensor; extern StructRNA RNA_NearSensor;
extern StructRNA RNA_NlaTrack;
extern StructRNA RNA_NlaStrip; extern StructRNA RNA_NlaStrip;
extern StructRNA RNA_NlaTrack;
extern StructRNA RNA_Node; extern StructRNA RNA_Node;
extern StructRNA RNA_NodeTree; extern StructRNA RNA_NodeTree;
extern StructRNA RNA_NoiseTexture; extern StructRNA RNA_NoiseTexture;
@ -304,6 +312,7 @@ extern StructRNA RNA_ParticleKey;
extern StructRNA RNA_ParticleSettings; extern StructRNA RNA_ParticleSettings;
extern StructRNA RNA_ParticleSystem; extern StructRNA RNA_ParticleSystem;
extern StructRNA RNA_ParticleSystemModifier; extern StructRNA RNA_ParticleSystemModifier;
extern StructRNA RNA_ParticleTarget;
extern StructRNA RNA_PluginSequence; extern StructRNA RNA_PluginSequence;
extern StructRNA RNA_PluginTexture; extern StructRNA RNA_PluginTexture;
extern StructRNA RNA_PointCache; extern StructRNA RNA_PointCache;
@ -315,14 +324,18 @@ extern StructRNA RNA_PropertySensor;
extern StructRNA RNA_PythonConstraint; extern StructRNA RNA_PythonConstraint;
extern StructRNA RNA_PythonController; extern StructRNA RNA_PythonController;
extern StructRNA RNA_RadarSensor; extern StructRNA RNA_RadarSensor;
extern StructRNA RNA_Radiosity;
extern StructRNA RNA_RandomSensor; extern StructRNA RNA_RandomSensor;
extern StructRNA RNA_RaySensor; extern StructRNA RNA_RaySensor;
extern StructRNA RNA_Region; extern StructRNA RNA_Region;
extern StructRNA RNA_RenderLayer;
extern StructRNA RNA_RenderPass;
extern StructRNA RNA_RenderResult;
extern StructRNA RNA_RenderValue;
extern StructRNA RNA_RigidBodyJointConstraint; extern StructRNA RNA_RigidBodyJointConstraint;
extern StructRNA RNA_Scene; extern StructRNA RNA_Scene;
extern StructRNA RNA_SceneGameData; extern StructRNA RNA_SceneGameData;
extern StructRNA RNA_SceneRenderData; extern StructRNA RNA_SceneRenderData;
extern StructRNA RNA_SceneRenderLayer;
extern StructRNA RNA_SceneSequence; extern StructRNA RNA_SceneSequence;
extern StructRNA RNA_Screen; extern StructRNA RNA_Screen;
extern StructRNA RNA_ScriptLink; extern StructRNA RNA_ScriptLink;
@ -366,8 +379,8 @@ extern StructRNA RNA_ShrinkwrapConstraint;
extern StructRNA RNA_ShrinkwrapModifier; extern StructRNA RNA_ShrinkwrapModifier;
extern StructRNA RNA_SimpleDeformModifier; extern StructRNA RNA_SimpleDeformModifier;
extern StructRNA RNA_SmoothModifier; extern StructRNA RNA_SmoothModifier;
extern StructRNA RNA_SoftBodySettings;
extern StructRNA RNA_SoftBodyModifier; extern StructRNA RNA_SoftBodyModifier;
extern StructRNA RNA_SoftBodySettings;
extern StructRNA RNA_Sound; extern StructRNA RNA_Sound;
extern StructRNA RNA_SoundSequence; extern StructRNA RNA_SoundSequence;
extern StructRNA RNA_Space; extern StructRNA RNA_Space;
@ -375,13 +388,13 @@ extern StructRNA RNA_Space3DView;
extern StructRNA RNA_SpaceButtonsWindow; extern StructRNA RNA_SpaceButtonsWindow;
extern StructRNA RNA_SpaceConsole; extern StructRNA RNA_SpaceConsole;
extern StructRNA RNA_SpaceDopeSheetEditor; extern StructRNA RNA_SpaceDopeSheetEditor;
extern StructRNA RNA_SpaceFileBrowser;
extern StructRNA RNA_SpaceGraphEditor; extern StructRNA RNA_SpaceGraphEditor;
extern StructRNA RNA_SpaceImageEditor; extern StructRNA RNA_SpaceImageEditor;
extern StructRNA RNA_SpaceNLA; extern StructRNA RNA_SpaceNLA;
extern StructRNA RNA_SpaceOutliner; extern StructRNA RNA_SpaceOutliner;
extern StructRNA RNA_SpaceSequenceEditor; extern StructRNA RNA_SpaceSequenceEditor;
extern StructRNA RNA_SpaceTextEditor; extern StructRNA RNA_SpaceTextEditor;
extern StructRNA RNA_SpaceFileBrowser;
extern StructRNA RNA_SpaceUVEditor; extern StructRNA RNA_SpaceUVEditor;
extern StructRNA RNA_SpeedControlSequence; extern StructRNA RNA_SpeedControlSequence;
extern StructRNA RNA_SpotLamp; extern StructRNA RNA_SpotLamp;
@ -434,6 +447,7 @@ extern StructRNA RNA_ThemeFileBrowser;
extern StructRNA RNA_ThemeFontStyle; extern StructRNA RNA_ThemeFontStyle;
extern StructRNA RNA_ThemeGraphEditor; extern StructRNA RNA_ThemeGraphEditor;
extern StructRNA RNA_ThemeImageEditor; extern StructRNA RNA_ThemeImageEditor;
extern StructRNA RNA_ThemeLogicEditor;
extern StructRNA RNA_ThemeNLAEditor; extern StructRNA RNA_ThemeNLAEditor;
extern StructRNA RNA_ThemeNodeEditor; extern StructRNA RNA_ThemeNodeEditor;
extern StructRNA RNA_ThemeOutliner; extern StructRNA RNA_ThemeOutliner;
@ -445,6 +459,7 @@ extern StructRNA RNA_ThemeUserInterface;
extern StructRNA RNA_ThemeUserPreferences; extern StructRNA RNA_ThemeUserPreferences;
extern StructRNA RNA_ThemeView3D; extern StructRNA RNA_ThemeView3D;
extern StructRNA RNA_ThemeWidgetColors; extern StructRNA RNA_ThemeWidgetColors;
extern StructRNA RNA_ThemeWidgetStateColors;
extern StructRNA RNA_TimelineMarker; extern StructRNA RNA_TimelineMarker;
extern StructRNA RNA_ToolSettings; extern StructRNA RNA_ToolSettings;
extern StructRNA RNA_TouchSensor; extern StructRNA RNA_TouchSensor;
@ -452,6 +467,7 @@ extern StructRNA RNA_TrackToConstraint;
extern StructRNA RNA_TransformConstraint; extern StructRNA RNA_TransformConstraint;
extern StructRNA RNA_TransformSequence; extern StructRNA RNA_TransformSequence;
extern StructRNA RNA_UILayout; extern StructRNA RNA_UILayout;
extern StructRNA RNA_UIListItem;
extern StructRNA RNA_UVProjectModifier; extern StructRNA RNA_UVProjectModifier;
extern StructRNA RNA_UnknownType; extern StructRNA RNA_UnknownType;
extern StructRNA RNA_UserPreferences; extern StructRNA RNA_UserPreferences;
@ -468,6 +484,7 @@ extern StructRNA RNA_VertexGroup;
extern StructRNA RNA_VertexGroupElement; extern StructRNA RNA_VertexGroupElement;
extern StructRNA RNA_VoronoiTexture; extern StructRNA RNA_VoronoiTexture;
extern StructRNA RNA_WaveModifier; extern StructRNA RNA_WaveModifier;
extern StructRNA RNA_Window;
extern StructRNA RNA_WindowManager; extern StructRNA RNA_WindowManager;
extern StructRNA RNA_WipeSequence; extern StructRNA RNA_WipeSequence;
extern StructRNA RNA_WoodTexture; extern StructRNA RNA_WoodTexture;

@ -8,6 +8,7 @@ objs += o
incs = '#/intern/guardedalloc ../blenkernel ../blenlib ../makesdna intern .' incs = '#/intern/guardedalloc ../blenkernel ../blenlib ../makesdna intern .'
incs += ' ../windowmanager ../editors/include ../imbuf' incs += ' ../windowmanager ../editors/include ../imbuf'
incs += ' ../render/extern/include'
defs = [] defs = []

@ -39,7 +39,7 @@ SET(SRC
../../../../intern/guardedalloc/intern/mallocn.c ../../../../intern/guardedalloc/intern/mallocn.c
../../../../intern/guardedalloc/intern/mmap_win.c) ../../../../intern/guardedalloc/intern/mmap_win.c)
INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../windowmanager ../../editors/include ../../imbuf .) INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include .)
FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h) FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h)
IF(WITH_OPENEXR) IF(WITH_OPENEXR)

@ -52,6 +52,7 @@ CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../makesdna CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../windowmanager CPPFLAGS += -I../../windowmanager
CPPFLAGS += -I../../editors/include CPPFLAGS += -I../../editors/include
CPPFLAGS += -I../../render/extern/include
CPPFLAGS += -I.. CPPFLAGS += -I..
CPPFLAGS += -I. CPPFLAGS += -I.

@ -32,6 +32,7 @@ defs = []
incs = '#/intern/guardedalloc ../../blenlib ../../blenkernel' incs = '#/intern/guardedalloc ../../blenlib ../../blenkernel'
incs += ' ../../imbuf ../../makesdna ../../makesrna' incs += ' ../../imbuf ../../makesdna ../../makesrna'
incs += ' ../../windowmanager ../../editors/include' incs += ' ../../windowmanager ../../editors/include'
incs += ' ../../render/extern/include'
if env['WITH_BF_OPENEXR']: if env['WITH_BF_OPENEXR']:
defs.append('WITH_OPENEXR') defs.append('WITH_OPENEXR')

@ -1935,6 +1935,7 @@ RNAProcessItem PROCESS_ITEMS[]= {
{"rna_particle.c", NULL, RNA_def_particle}, {"rna_particle.c", NULL, RNA_def_particle},
{"rna_pose.c", NULL, RNA_def_pose}, {"rna_pose.c", NULL, RNA_def_pose},
{"rna_property.c", NULL, RNA_def_gameproperty}, {"rna_property.c", NULL, RNA_def_gameproperty},
{"rna_render.c", NULL, RNA_def_render},
{"rna_scene.c", NULL, RNA_def_scene}, {"rna_scene.c", NULL, RNA_def_scene},
{"rna_screen.c", NULL, RNA_def_screen}, {"rna_screen.c", NULL, RNA_def_screen},
{"rna_scriptlink.c", NULL, RNA_def_scriptlink}, {"rna_scriptlink.c", NULL, RNA_def_scriptlink},

@ -147,6 +147,7 @@ void RNA_def_object_force(struct BlenderRNA *brna);
void RNA_def_packedfile(struct BlenderRNA *brna); void RNA_def_packedfile(struct BlenderRNA *brna);
void RNA_def_particle(struct BlenderRNA *brna); void RNA_def_particle(struct BlenderRNA *brna);
void RNA_def_pose(struct BlenderRNA *brna); void RNA_def_pose(struct BlenderRNA *brna);
void RNA_def_render(struct BlenderRNA *brna);
void RNA_def_rna(struct BlenderRNA *brna); void RNA_def_rna(struct BlenderRNA *brna);
void RNA_def_scene(struct BlenderRNA *brna); void RNA_def_scene(struct BlenderRNA *brna);
void RNA_def_screen(struct BlenderRNA *brna); void RNA_def_screen(struct BlenderRNA *brna);
@ -171,6 +172,7 @@ void rna_def_animdata_common(struct StructRNA *srna);
void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable); void rna_def_texmat_common(struct StructRNA *srna, const char *texspace_editable);
void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname); void rna_def_mtex_common(struct StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *structname);
void rna_def_render_layer_common(struct StructRNA *srna, int scene);
void rna_ID_name_get(struct PointerRNA *ptr, char *value); void rna_ID_name_get(struct PointerRNA *ptr, char *value);
int rna_ID_name_length(struct PointerRNA *ptr); int rna_ID_name_length(struct PointerRNA *ptr);

@ -0,0 +1,214 @@
/**
* $Id: rna_render.c 21648 2009-07-17 02:31:28Z campbellbarton $
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Contributor(s): Blender Foundation (2009)
*
* ***** END GPL LICENSE BLOCK *****
*/
#include <stdlib.h>
#include "DNA_scene_types.h"
#include "RNA_define.h"
#include "RNA_types.h"
#include "rna_internal.h"
#include "WM_types.h"
#include "RE_pipeline.h"
#include "RE_render_ext.h"
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
#include "RNA_access.h"
#include "BKE_context.h"
#include "BKE_report.h"
#include "WM_api.h"
static void rna_RenderResult_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
RenderResult *rr= (RenderResult*)ptr->data;
rna_iterator_listbase_begin(iter, &rr->layers, NULL);
}
static void rna_RenderLayer_passes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
RenderLayer *rl= (RenderLayer*)ptr->data;
rna_iterator_listbase_begin(iter, &rl->passes, NULL);
}
static float rna_RenderValue_value_get(PointerRNA *ptr)
{
return *(float*)ptr->data;
}
static void rna_RenderValue_value_set(PointerRNA *ptr, float value)
{
*(float*)ptr->data= value;
}
static void rna_RenderLayer_rect_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
RenderLayer *rl= (RenderLayer*)ptr->data;
rna_iterator_array_begin(iter, (void*)rl->rectf, sizeof(float), rl->rectx*rl->recty*4, 0, NULL);
}
static int rna_RenderLayer_rect_length(PointerRNA *ptr)
{
RenderLayer *rl= (RenderLayer*)ptr->data;
return rl->rectx*rl->recty*4;
}
static void rna_RenderPass_rect_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
RenderPass *rpass= (RenderPass*)ptr->data;
rna_iterator_array_begin(iter, (void*)rpass->rect, sizeof(float), rpass->rectx*rpass->recty*rpass->channels, 0, NULL);
}
static int rna_RenderPass_rect_length(PointerRNA *ptr)
{
RenderPass *rpass= (RenderPass*)ptr->data;
return rpass->rectx*rpass->recty*rpass->channels;
}
#else // RNA_RUNTIME
static void rna_def_render_result(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "RenderResult", NULL);
RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes.");
RNA_define_verify_sdna(0);
prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "rectx");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "recty");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "RenderLayer");
RNA_def_property_collection_funcs(prop, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0, 0);
RNA_define_verify_sdna(1);
}
static void rna_def_render_layer(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
srna= RNA_def_struct(brna, "RenderLayer", NULL);
RNA_def_struct_ui_text(srna, "Render Layer", "");
RNA_define_verify_sdna(0);
rna_def_render_layer_common(srna, 0);
prop= RNA_def_property(srna, "passes", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "RenderPass");
RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0, 0);
prop= RNA_def_property(srna, "rect", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "RenderValue");
RNA_def_property_collection_funcs(prop, "rna_RenderLayer_rect_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_RenderLayer_rect_length", 0, 0, 0, 0);
/* value */
srna= RNA_def_struct(brna, "RenderValue", NULL);
RNA_def_struct_ui_text(srna, "Render Value", "");
prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_funcs(prop, "rna_RenderValue_value_get", "rna_RenderValue_value_set", NULL);
RNA_define_verify_sdna(1);
}
static void rna_def_render_pass(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem pass_type_items[]= {
{SCE_PASS_COMBINED, "COMBINED", 0, "Combined", ""},
{SCE_PASS_Z, "Z", 0, "Z", ""},
{SCE_PASS_RGBA, "COLOR", 0, "Color", ""},
{SCE_PASS_DIFFUSE, "DIFFUSE", 0, "Diffuse", ""},
{SCE_PASS_SPEC, "SPECULAR", 0, "Specular", ""},
{SCE_PASS_SHADOW, "SHADOW", 0, "Shadow", ""},
{SCE_PASS_AO, "AO", 0, "AO", ""},
{SCE_PASS_REFLECT, "REFLECTION", 0, "Reflection", ""},
{SCE_PASS_NORMAL, "NORMAL", 0, "Normal", ""},
{SCE_PASS_VECTOR, "VECTOR", 0, "Vecotr", ""},
{SCE_PASS_REFRACT, "REFRACTION", 0, "Refraction", ""},
{SCE_PASS_INDEXOB, "OBJECT_INDEX", 0, "Object Index", ""},
{SCE_PASS_UV, "UV", 0, "UV", ""},
{SCE_PASS_MIST, "MIST", 0, "Mist", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "RenderPass", NULL);
RNA_def_struct_ui_text(srna, "Render Pass", "");
RNA_define_verify_sdna(0);
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_struct_name_property(srna, prop);
prop= RNA_def_property(srna, "channel_id", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "chan_id");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "channels", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "channels");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "passtype");
RNA_def_property_enum_items(prop, pass_type_items);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "rect", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_type(prop, "RenderValue");
RNA_def_property_collection_funcs(prop, "rna_RenderPass_rect_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_RenderPass_rect_length", 0, 0, 0, 0);
RNA_define_verify_sdna(1);
}
void RNA_def_render(BlenderRNA *brna)
{
rna_def_render_result(brna);
rna_def_render_layer(brna);
rna_def_render_pass(brna);
}
#endif // RNA_RUNTIME

@ -205,7 +205,7 @@ static void rna_SceneRenderLayer_pass_update(bContext *C, PointerRNA *ptr)
#else #else
void rna_def_sculpt(BlenderRNA *brna) static void rna_def_sculpt(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
@ -251,7 +251,7 @@ void rna_def_sculpt(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Partial Redraw", "Optimize sculpting by only refreshing modified faces."); RNA_def_property_ui_text(prop, "Partial Redraw", "Optimize sculpting by only refreshing modified faces.");
} }
void rna_def_tool_settings(BlenderRNA *brna) static void rna_def_tool_settings(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
@ -366,192 +366,228 @@ void rna_def_tool_settings(BlenderRNA *brna)
rna_def_sculpt(brna); rna_def_sculpt(brna);
} }
void rna_def_scene_render_layer(BlenderRNA *brna) void rna_def_render_layer_common(StructRNA *srna, int scene)
{ {
StructRNA *srna;
PropertyRNA *prop; 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); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
if(scene) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SceneRenderLayer_name_set");
else RNA_def_property_string_sdna(prop, NULL, "name");
RNA_def_property_ui_text(prop, "Name", "Render layer name."); 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); RNA_def_struct_name_property(srna, prop);
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE); prop= RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "mat_override"); RNA_def_property_pointer_sdna(prop, NULL, "mat_override");
RNA_def_property_struct_type(prop, "Material"); RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE); 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_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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE); prop= RNA_def_property(srna, "light_override", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "light_override");
RNA_def_property_struct_type(prop, "Group"); RNA_def_property_struct_type(prop, "Group");
RNA_def_property_flag(prop, PROP_EDITABLE); 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_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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* layers */ /* layers */
prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_NONE); prop= RNA_def_property(srna, "visible_layers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "lay", 1); RNA_def_property_boolean_sdna(prop, NULL, "lay", 1);
RNA_def_property_array(prop, 20); RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Visible Layers", "Scene layers included in this render layer."); 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"); if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_layer_set");
else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_layer_set");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "zmask_layers", PROP_BOOLEAN, PROP_NONE); prop= RNA_def_property(srna, "zmask_layers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1); RNA_def_property_boolean_sdna(prop, NULL, "lay_zmask", 1);
RNA_def_property_array(prop, 20); RNA_def_property_array(prop, 20);
RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers."); RNA_def_property_ui_text(prop, "Zmask Layers", "Zmask scene layers.");
RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_zmask_layer_set"); if(scene) RNA_def_property_boolean_funcs(prop, NULL, "rna_SceneRenderLayer_zmask_layer_set");
else RNA_def_property_boolean_funcs(prop, NULL, "rna_RenderLayer_zmask_layer_set");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* layer options */ /* layer options */
prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); 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_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_ui_text(prop, "Enabled", "Disable or enable the render layer.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "zmask", PROP_BOOLEAN, PROP_NONE); prop= RNA_def_property(srna, "zmask", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK); 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_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); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "zmask_negate", PROP_BOOLEAN, PROP_NONE); 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_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_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); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "all_z", PROP_BOOLEAN, PROP_NONE); 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_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_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); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "solid", PROP_BOOLEAN, PROP_NONE); prop= RNA_def_property(srna, "solid", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID); 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_ui_text(prop, "Solid", "Render Solid faces in this Layer.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE); prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO); RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of 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); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "ztransp", PROP_BOOLEAN, PROP_NONE); prop= RNA_def_property(srna, "ztransp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA); RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
RNA_def_property_ui_text(prop, "ZTransp", "Render Z-Transparent faces in this Layer (On top of Solid and Halos)."); 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); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE); prop= RNA_def_property(srna, "sky", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY); RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer."); RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE); prop= RNA_def_property(srna, "edge", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE); RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
RNA_def_property_ui_text(prop, "Edge", "Render Edge-enhance in this Layer (only works for Solid faces)."); 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); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "strand", PROP_BOOLEAN, PROP_NONE); prop= RNA_def_property(srna, "strand", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND); RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer."); RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* passes */ /* passes */
prop= RNA_def_property(srna, "pass_combined", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_COMBINED);
RNA_def_property_ui_text(prop, "Combined", "Deliver full combined RGBA buffer."); 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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_z", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_Z);
RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass."); 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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_vector", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR);
RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass."); 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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_normal", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_NORMAL);
RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass."); RNA_def_property_ui_text(prop, "Normal", "Deliver normal pass.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_uv", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_UV);
RNA_def_property_ui_text(prop, "UV", "Deliver texture UV pass."); 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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_mist", PROP_BOOLEAN, PROP_NONE); 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_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_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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_object_index", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXOB);
RNA_def_property_ui_text(prop, "Object Index", "Deliver object index pass."); 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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_color", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA);
RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass."); 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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_diffuse", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_DIFFUSE);
RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass."); RNA_def_property_ui_text(prop, "Diffuse", "Deliver diffuse pass.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_specular", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SPEC);
RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass."); RNA_def_property_ui_text(prop, "Specular", "Deliver specular pass.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_shadow", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SHADOW);
RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass."); RNA_def_property_ui_text(prop, "Shadow", "Deliver shadow pass.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_ao", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_AO);
RNA_def_property_ui_text(prop, "AO", "Deliver AO pass."); RNA_def_property_ui_text(prop, "AO", "Deliver AO pass.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_reflection", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT);
RNA_def_property_ui_text(prop, "Reflection", "Deliver ratraced reflection pass."); 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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_refraction", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFRACT);
RNA_def_property_ui_text(prop, "Refraction", "Deliver ratraced refraction pass."); 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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_specular_exclude", PROP_BOOLEAN, PROP_NONE); 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_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_ui_text(prop, "Specular Exclude", "Exclude specular pass from combined.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_shadow_exclude", PROP_BOOLEAN, PROP_NONE); 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_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_ui_text(prop, "Shadow Exclude", "Exclude shadow pass from combined.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_ao_exclude", PROP_BOOLEAN, PROP_NONE); 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_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_ui_text(prop, "AO Exclude", "Exclude AO pass from combined.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_reflection_exclude", PROP_BOOLEAN, PROP_NONE); 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_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_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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
prop= RNA_def_property(srna, "pass_refraction_exclude", PROP_BOOLEAN, PROP_NONE); 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_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_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"); if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update");
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
} }
void rna_def_scene_game_data(BlenderRNA *brna) void rna_def_scene_game_data(BlenderRNA *brna)
@ -764,7 +800,18 @@ void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled"); RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled");
RNA_def_property_update(prop, NC_SCENE, NULL); RNA_def_property_update(prop, NC_SCENE, NULL);
} }
void rna_def_scene_render_data(BlenderRNA *brna)
static void rna_def_scene_render_layer(BlenderRNA *brna)
{
StructRNA *srna;
srna= RNA_def_struct(brna, "SceneRenderLayer", NULL);
RNA_def_struct_ui_text(srna, "Scene Render Layer", "Render layer.");
rna_def_render_layer_common(srna, 1);
}
static void rna_def_scene_render_data(BlenderRNA *brna)
{ {
StructRNA *srna; StructRNA *srna;
PropertyRNA *prop; PropertyRNA *prop;
@ -1378,6 +1425,8 @@ void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "pic"); RNA_def_property_string_sdna(prop, NULL, "pic");
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_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); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* stamp */
prop= RNA_def_property(srna, "stamp_time", PROP_BOOLEAN, PROP_NONE); 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_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME);
@ -1453,6 +1502,8 @@ void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_range(prop,0.0,1.0); RNA_def_property_range(prop,0.0,1.0);
RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text"); 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); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* layers */
prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "layers", NULL); RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);

@ -64,6 +64,7 @@ typedef struct RenderPass {
char name[16]; /* amount defined in openexr_multi.h */ char name[16]; /* amount defined in openexr_multi.h */
char chan_id[8]; /* amount defined in openexr_multi.h */ char chan_id[8]; /* amount defined in openexr_multi.h */
float *rect; float *rect;
int rectx, recty;
} RenderPass; } RenderPass;
/* a renderlayer is a full image, but with all passes and samples */ /* a renderlayer is a full image, but with all passes and samples */
@ -83,6 +84,7 @@ typedef struct RenderLayer {
float *rectf; /* 4 float, standard rgba buffer (read not above!) */ float *rectf; /* 4 float, standard rgba buffer (read not above!) */
float *acolrect; /* 4 float, optional transparent buffer, needs storage for display updates */ float *acolrect; /* 4 float, optional transparent buffer, needs storage for display updates */
float *scolrect; /* 4 float, optional strand buffer, needs storage for display updates */ float *scolrect; /* 4 float, optional strand buffer, needs storage for display updates */
int rectx, recty;
ListBase passes; ListBase passes;

@ -426,6 +426,8 @@ static void render_layer_add_pass(RenderResult *rr, RenderLayer *rl, int channel
BLI_addtail(&rl->passes, rpass); BLI_addtail(&rl->passes, rpass);
rpass->passtype= passtype; rpass->passtype= passtype;
rpass->channels= channels; rpass->channels= channels;
rpass->rectx= rl->rectx;
rpass->recty= rl->recty;
if(rr->exrhandle) { if(rr->exrhandle) {
int a; int a;
@ -528,6 +530,8 @@ static RenderResult *new_render_result(Render *re, rcti *partrct, int crop, int
rl->pass_xor= srl->pass_xor; rl->pass_xor= srl->pass_xor;
rl->light_override= srl->light_override; rl->light_override= srl->light_override;
rl->mat_override= srl->mat_override; rl->mat_override= srl->mat_override;
rl->rectx= rectx;
rl->recty= recty;
if(rr->exrhandle) { if(rr->exrhandle) {
IMB_exr_add_channel(rr->exrhandle, rl->name, "Combined.R", 0, 0, NULL); IMB_exr_add_channel(rr->exrhandle, rl->name, "Combined.R", 0, 0, NULL);
@ -573,6 +577,9 @@ static RenderResult *new_render_result(Render *re, rcti *partrct, int crop, int
rl= MEM_callocN(sizeof(RenderLayer), "new render layer"); rl= MEM_callocN(sizeof(RenderLayer), "new render layer");
BLI_addtail(&rr->layers, rl); BLI_addtail(&rr->layers, rl);
rl->rectx= rectx;
rl->recty= recty;
/* duplicate code... */ /* duplicate code... */
if(rr->exrhandle) { if(rr->exrhandle) {
IMB_exr_add_channel(rr->exrhandle, rl->name, "Combined.R", 0, 0, NULL); IMB_exr_add_channel(rr->exrhandle, rl->name, "Combined.R", 0, 0, NULL);
@ -810,7 +817,7 @@ static void ml_addpass_cb(void *base, void *lay, char *str, float *rect, int tot
BLI_addtail(&rl->passes, rpass); BLI_addtail(&rl->passes, rpass);
rpass->channels= totchan; rpass->channels= totchan;
rpass->passtype= passtype_from_name(str); rpass->passtype= passtype_from_name(str);
if(rpass->passtype==0) printf("unknown pass %s\n", str); if(rpass->passtype==0) printf("unknown pass %s\n", str);
rl->passflag |= rpass->passtype; rl->passflag |= rpass->passtype;
@ -827,11 +834,23 @@ static void ml_addpass_cb(void *base, void *lay, char *str, float *rect, int tot
RenderResult *RE_MultilayerConvert(void *exrhandle, int rectx, int recty) RenderResult *RE_MultilayerConvert(void *exrhandle, int rectx, int recty)
{ {
RenderResult *rr= MEM_callocN(sizeof(RenderResult), "loaded render result"); RenderResult *rr= MEM_callocN(sizeof(RenderResult), "loaded render result");
RenderLayer *rl;
RenderPass *rpass;
rr->rectx= rectx; rr->rectx= rectx;
rr->recty= recty; rr->recty= recty;
IMB_exr_multilayer_convert(exrhandle, rr, ml_addlayer_cb, ml_addpass_cb); IMB_exr_multilayer_convert(exrhandle, rr, ml_addlayer_cb, ml_addpass_cb);
for(rl=rr->layers.first; rl; rl=rl->next) {
rl->rectx= rectx;
rl->recty= recty;
for(rpass=rl->passes.first; rpass; rpass=rpass->next) {
rpass->rectx= rectx;
rpass->recty= recty;
}
}
return rr; return rr;
} }