2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2009-07-21 14:11:51 +00:00
|
|
|
* ***** 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-07-21 14:11:51 +00:00
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation (2009)
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-02-27 20:20:01 +00:00
|
|
|
/** \file blender/makesrna/intern/rna_render.c
|
|
|
|
* \ingroup RNA
|
|
|
|
*/
|
|
|
|
|
2009-07-21 14:11:51 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
2013-03-04 18:36:37 +00:00
|
|
|
#include "BLI_utildefines.h"
|
2012-09-03 22:04:14 +00:00
|
|
|
#include "BLI_path_util.h"
|
|
|
|
|
2009-07-21 14:11:51 +00:00
|
|
|
#include "RNA_define.h"
|
2011-05-17 15:20:12 +00:00
|
|
|
#include "RNA_enum_types.h"
|
2009-07-21 14:11:51 +00:00
|
|
|
|
|
|
|
#include "rna_internal.h"
|
|
|
|
|
2011-05-05 09:43:45 +00:00
|
|
|
#include "RE_engine.h"
|
2009-07-21 14:11:51 +00:00
|
|
|
#include "RE_pipeline.h"
|
|
|
|
|
2011-01-07 19:18:31 +00:00
|
|
|
|
2009-07-21 14:11:51 +00:00
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
#include "RNA_access.h"
|
|
|
|
|
|
|
|
#include "BKE_context.h"
|
|
|
|
#include "BKE_report.h"
|
|
|
|
|
2011-11-02 15:15:45 +00:00
|
|
|
/* RenderEngine Callbacks */
|
|
|
|
|
2012-10-22 17:34:16 +00:00
|
|
|
static void engine_tag_redraw(RenderEngine *engine)
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
{
|
2011-11-02 15:15:45 +00:00
|
|
|
engine->flag |= RE_ENGINE_DO_DRAW;
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
}
|
|
|
|
|
2012-10-22 17:34:16 +00:00
|
|
|
static void engine_tag_update(RenderEngine *engine)
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
{
|
2011-11-02 15:15:45 +00:00
|
|
|
engine->flag |= RE_ENGINE_DO_UPDATE;
|
2011-05-17 14:26:45 +00:00
|
|
|
}
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2011-05-17 14:26:45 +00:00
|
|
|
static void engine_update(RenderEngine *engine, Main *bmain, Scene *scene)
|
|
|
|
{
|
2011-10-21 20:13:12 +00:00
|
|
|
extern FunctionRNA rna_RenderEngine_update_func;
|
2011-05-17 14:26:45 +00:00
|
|
|
PointerRNA ptr;
|
|
|
|
ParameterList list;
|
|
|
|
FunctionRNA *func;
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2011-05-17 14:26:45 +00:00
|
|
|
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
|
2012-03-05 23:30:41 +00:00
|
|
|
func = &rna_RenderEngine_update_func;
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2011-05-17 14:26:45 +00:00
|
|
|
RNA_parameter_list_create(&list, &ptr, func);
|
|
|
|
RNA_parameter_set_lookup(&list, "data", &bmain);
|
|
|
|
RNA_parameter_set_lookup(&list, "scene", &scene);
|
|
|
|
engine->type->ext.call(NULL, &ptr, func, &list);
|
|
|
|
|
|
|
|
RNA_parameter_list_free(&list);
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
}
|
|
|
|
|
2011-11-02 15:15:45 +00:00
|
|
|
static void engine_render(RenderEngine *engine, struct Scene *scene)
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
{
|
2011-10-21 20:13:12 +00:00
|
|
|
extern FunctionRNA rna_RenderEngine_render_func;
|
2011-05-17 14:26:45 +00:00
|
|
|
PointerRNA ptr;
|
|
|
|
ParameterList list;
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
|
|
|
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
|
2012-03-05 23:30:41 +00:00
|
|
|
func = &rna_RenderEngine_render_func;
|
2011-05-17 14:26:45 +00:00
|
|
|
|
|
|
|
RNA_parameter_list_create(&list, &ptr, func);
|
2011-11-02 15:15:45 +00:00
|
|
|
RNA_parameter_set_lookup(&list, "scene", &scene);
|
2011-05-17 14:26:45 +00:00
|
|
|
engine->type->ext.call(NULL, &ptr, func, &list);
|
|
|
|
|
|
|
|
RNA_parameter_list_free(&list);
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
}
|
|
|
|
|
2011-05-17 14:26:45 +00:00
|
|
|
static void engine_view_update(RenderEngine *engine, const struct bContext *context)
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
{
|
2011-10-21 20:13:12 +00:00
|
|
|
extern FunctionRNA rna_RenderEngine_view_update_func;
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
PointerRNA ptr;
|
|
|
|
ParameterList list;
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
|
|
|
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
|
2012-03-05 23:30:41 +00:00
|
|
|
func = &rna_RenderEngine_view_update_func;
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
|
|
|
|
RNA_parameter_list_create(&list, &ptr, func);
|
2011-05-17 14:26:45 +00:00
|
|
|
RNA_parameter_set_lookup(&list, "context", &context);
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
engine->type->ext.call(NULL, &ptr, func, &list);
|
|
|
|
|
|
|
|
RNA_parameter_list_free(&list);
|
|
|
|
}
|
|
|
|
|
2011-05-17 14:26:45 +00:00
|
|
|
static void engine_view_draw(RenderEngine *engine, const struct bContext *context)
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
{
|
2011-10-21 20:13:12 +00:00
|
|
|
extern FunctionRNA rna_RenderEngine_view_draw_func;
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
PointerRNA ptr;
|
|
|
|
ParameterList list;
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
|
|
|
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
|
2012-03-05 23:30:41 +00:00
|
|
|
func = &rna_RenderEngine_view_draw_func;
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
|
|
|
|
RNA_parameter_list_create(&list, &ptr, func);
|
2011-05-17 14:26:45 +00:00
|
|
|
RNA_parameter_set_lookup(&list, "context", &context);
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
engine->type->ext.call(NULL, &ptr, func, &list);
|
|
|
|
|
|
|
|
RNA_parameter_list_free(&list);
|
|
|
|
}
|
|
|
|
|
2012-11-03 14:32:26 +00:00
|
|
|
static void engine_update_script_node(RenderEngine *engine, struct bNodeTree *ntree, struct bNode *node)
|
|
|
|
{
|
|
|
|
extern FunctionRNA rna_RenderEngine_update_script_node_func;
|
|
|
|
PointerRNA ptr, nodeptr;
|
|
|
|
ParameterList list;
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
|
|
|
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr);
|
2012-12-30 15:16:08 +00:00
|
|
|
RNA_pointer_create((ID *)ntree, &RNA_Node, node, &nodeptr);
|
2012-11-03 14:32:26 +00:00
|
|
|
func = &rna_RenderEngine_update_script_node_func;
|
|
|
|
|
|
|
|
RNA_parameter_list_create(&list, &ptr, func);
|
|
|
|
RNA_parameter_set_lookup(&list, "node", &nodeptr);
|
|
|
|
engine->type->ext.call(NULL, &ptr, func, &list);
|
|
|
|
|
|
|
|
RNA_parameter_list_free(&list);
|
|
|
|
}
|
|
|
|
|
2011-05-17 14:26:45 +00:00
|
|
|
/* RenderEngine registration */
|
|
|
|
|
2011-05-31 02:14:25 +00:00
|
|
|
static void rna_RenderEngine_unregister(Main *UNUSED(bmain), StructRNA *type)
|
2009-07-21 20:28:32 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
RenderEngineType *et = RNA_struct_blender_type_get(type);
|
2009-07-21 20:28:32 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (!et)
|
2009-07-21 20:28:32 +00:00
|
|
|
return;
|
|
|
|
|
2009-08-16 07:26:29 +00:00
|
|
|
RNA_struct_free_extension(type, &et->ext);
|
2009-07-21 20:28:32 +00:00
|
|
|
BLI_freelinkN(&R_engines, et);
|
|
|
|
RNA_struct_free(&BLENDER_RNA, type);
|
|
|
|
}
|
|
|
|
|
2012-03-18 09:27:36 +00:00
|
|
|
static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
|
|
|
|
StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
|
2009-07-21 20:28:32 +00:00
|
|
|
{
|
2011-03-03 17:58:06 +00:00
|
|
|
RenderEngineType *et, dummyet = {NULL};
|
2012-03-05 23:30:41 +00:00
|
|
|
RenderEngine dummyengine = {NULL};
|
2009-07-21 20:28:32 +00:00
|
|
|
PointerRNA dummyptr;
|
2012-11-03 14:32:26 +00:00
|
|
|
int have_function[5];
|
2009-07-21 20:28:32 +00:00
|
|
|
|
|
|
|
/* setup dummy engine & engine type to store static properties in */
|
2012-03-05 23:30:41 +00:00
|
|
|
dummyengine.type = &dummyet;
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_pointer_create(NULL, &RNA_RenderEngine, &dummyengine, &dummyptr);
|
|
|
|
|
|
|
|
/* validate the python class */
|
2012-03-05 23:30:41 +00:00
|
|
|
if (validate(&dummyptr, data, have_function) != 0)
|
2009-07-21 20:28:32 +00:00
|
|
|
return NULL;
|
2009-12-22 10:04:15 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (strlen(identifier) >= sizeof(dummyet.idname)) {
|
2012-10-20 10:28:34 +00:00
|
|
|
BKE_reportf(reports, RPT_ERROR, "Registering render engine class: '%s' is too long, maximum length is %d",
|
2012-03-18 09:27:36 +00:00
|
|
|
identifier, (int)sizeof(dummyet.idname));
|
2009-12-22 10:04:15 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2009-07-21 20:28:32 +00:00
|
|
|
/* check if we have registered this engine type before, and remove it */
|
2012-03-05 23:30:41 +00:00
|
|
|
for (et = R_engines.first; et; et = et->next) {
|
|
|
|
if (strcmp(et->idname, dummyet.idname) == 0) {
|
|
|
|
if (et->ext.srna)
|
2011-05-18 10:56:26 +00:00
|
|
|
rna_RenderEngine_unregister(bmain, et->ext.srna);
|
2009-07-21 20:28:32 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* create a new engine type */
|
2012-03-05 23:30:41 +00:00
|
|
|
et = MEM_callocN(sizeof(RenderEngineType), "python render engine");
|
2009-07-21 20:28:32 +00:00
|
|
|
memcpy(et, &dummyet, sizeof(dummyet));
|
|
|
|
|
2013-01-09 05:32:15 +00:00
|
|
|
et->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, et->idname, &RNA_RenderEngine);
|
2012-03-05 23:30:41 +00:00
|
|
|
et->ext.data = data;
|
|
|
|
et->ext.call = call;
|
|
|
|
et->ext.free = free;
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_struct_blender_type_set(et->ext.srna, et);
|
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
et->update = (have_function[0]) ? engine_update : NULL;
|
|
|
|
et->render = (have_function[1]) ? engine_render : NULL;
|
|
|
|
et->view_update = (have_function[2]) ? engine_view_update : NULL;
|
|
|
|
et->view_draw = (have_function[3]) ? engine_view_draw : NULL;
|
2012-11-03 14:32:26 +00:00
|
|
|
et->update_script_node = (have_function[4]) ? engine_update_script_node : NULL;
|
2009-07-21 20:28:32 +00:00
|
|
|
|
|
|
|
BLI_addtail(&R_engines, et);
|
|
|
|
|
|
|
|
return et->ext.srna;
|
|
|
|
}
|
|
|
|
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
static void **rna_RenderEngine_instance(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
RenderEngine *engine = ptr->data;
|
|
|
|
return &engine->py_instance;
|
|
|
|
}
|
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
static StructRNA *rna_RenderEngine_refine(PointerRNA *ptr)
|
2009-07-21 20:28:32 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
RenderEngine *engine = (RenderEngine *)ptr->data;
|
|
|
|
return (engine->type && engine->type->ext.srna) ? engine->type->ext.srna : &RNA_RenderEngine;
|
2009-07-21 20:28:32 +00:00
|
|
|
}
|
|
|
|
|
2013-03-14 07:38:37 +00:00
|
|
|
static PointerRNA rna_RenderEngine_render_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
RenderEngine *engine = (RenderEngine *)ptr->data;
|
|
|
|
|
|
|
|
if (engine->re) {
|
|
|
|
RenderData *r = RE_engine_get_render_data(engine->re);
|
|
|
|
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_RenderSettings, r);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return rna_pointer_inherit_refine(ptr, &RNA_RenderSettings, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-21 14:11:51 +00:00
|
|
|
static void rna_RenderResult_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
RenderResult *rr = (RenderResult *)ptr->data;
|
2009-07-21 14:11:51 +00:00
|
|
|
rna_iterator_listbase_begin(iter, &rr->layers, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_RenderLayer_passes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
RenderLayer *rl = (RenderLayer *)ptr->data;
|
2009-07-21 14:11:51 +00:00
|
|
|
rna_iterator_listbase_begin(iter, &rl->passes, NULL);
|
|
|
|
}
|
|
|
|
|
2009-09-09 19:40:46 +00:00
|
|
|
static int rna_RenderLayer_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
|
2009-07-21 14:11:51 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
RenderLayer *rl = (RenderLayer *)ptr->data;
|
2009-07-21 14:11:51 +00:00
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
length[0] = rl->rectx * rl->recty;
|
2012-03-05 23:30:41 +00:00
|
|
|
length[1] = 4;
|
2009-09-09 19:40:46 +00:00
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
return length[0] * length[1];
|
2009-07-21 14:11:51 +00:00
|
|
|
}
|
|
|
|
|
2009-09-09 19:40:46 +00:00
|
|
|
static void rna_RenderLayer_rect_get(PointerRNA *ptr, float *values)
|
2009-07-21 14:11:51 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
RenderLayer *rl = (RenderLayer *)ptr->data;
|
|
|
|
memcpy(values, rl->rectf, sizeof(float) * rl->rectx * rl->recty * 4);
|
2009-07-21 14:11:51 +00:00
|
|
|
}
|
|
|
|
|
2012-09-22 17:00:02 +00:00
|
|
|
void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values)
|
2009-07-21 14:11:51 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
RenderLayer *rl = (RenderLayer *)ptr->data;
|
|
|
|
memcpy(rl->rectf, values, sizeof(float) * rl->rectx * rl->recty * 4);
|
2009-07-21 14:11:51 +00:00
|
|
|
}
|
|
|
|
|
2009-09-09 19:40:46 +00:00
|
|
|
static int rna_RenderPass_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION])
|
2009-07-21 14:11:51 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
RenderPass *rpass = (RenderPass *)ptr->data;
|
2009-09-09 19:40:46 +00:00
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
length[0] = rpass->rectx * rpass->recty;
|
2012-03-05 23:30:41 +00:00
|
|
|
length[1] = rpass->channels;
|
2009-09-09 19:40:46 +00:00
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
return length[0] * length[1];
|
2009-07-21 14:11:51 +00:00
|
|
|
}
|
|
|
|
|
2009-09-09 19:40:46 +00:00
|
|
|
static void rna_RenderPass_rect_get(PointerRNA *ptr, float *values)
|
2009-07-21 14:11:51 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
RenderPass *rpass = (RenderPass *)ptr->data;
|
|
|
|
memcpy(values, rpass->rect, sizeof(float) * rpass->rectx * rpass->recty * rpass->channels);
|
2009-07-21 14:11:51 +00:00
|
|
|
}
|
|
|
|
|
2012-09-22 17:00:02 +00:00
|
|
|
void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values)
|
2009-09-09 19:40:46 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
RenderPass *rpass = (RenderPass *)ptr->data;
|
|
|
|
memcpy(rpass->rect, values, sizeof(float) * rpass->rectx * rpass->recty * rpass->channels);
|
2009-09-09 19:40:46 +00:00
|
|
|
}
|
2009-07-21 14:11:51 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
#else /* RNA_RUNTIME */
|
2009-07-21 14:11:51 +00:00
|
|
|
|
2009-07-21 20:28:32 +00:00
|
|
|
static void rna_def_render_engine(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "RenderEngine", NULL);
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_struct_sdna(srna, "RenderEngine");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Render Engine", "Render engine");
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_struct_refine_func(srna, "rna_RenderEngine_refine");
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_struct_register_funcs(srna, "rna_RenderEngine_register", "rna_RenderEngine_unregister",
|
|
|
|
"rna_RenderEngine_instance");
|
2009-07-21 20:28:32 +00:00
|
|
|
|
2011-05-17 14:26:45 +00:00
|
|
|
/* final render callbacks */
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "update", NULL);
|
2011-05-17 14:26:45 +00:00
|
|
|
RNA_def_function_ui_description(func, "Export scene data for render");
|
2013-02-28 15:33:26 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE);
|
2011-05-17 14:26:45 +00:00
|
|
|
RNA_def_pointer(func, "data", "BlendData", "", "");
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_pointer(func, "scene", "Scene", "", "");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "render", NULL);
|
2011-11-02 15:15:45 +00:00
|
|
|
RNA_def_function_ui_description(func, "Render scene into an image");
|
2013-02-28 15:33:26 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE);
|
2011-11-02 15:15:45 +00:00
|
|
|
RNA_def_pointer(func, "scene", "Scene", "", "");
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
|
2011-05-17 14:26:45 +00:00
|
|
|
/* viewport render callbacks */
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "view_update", NULL);
|
2011-05-17 14:26:45 +00:00
|
|
|
RNA_def_function_ui_description(func, "Update on data changes for viewport render");
|
2013-02-28 15:33:26 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE);
|
2011-05-17 14:26:45 +00:00
|
|
|
RNA_def_pointer(func, "context", "Context", "", "");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "view_draw", NULL);
|
2011-05-17 14:26:45 +00:00
|
|
|
RNA_def_function_ui_description(func, "Draw viewport render");
|
2011-11-02 15:15:45 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
|
2011-05-17 14:26:45 +00:00
|
|
|
RNA_def_pointer(func, "context", "Context", "", "");
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
|
2012-11-03 14:32:26 +00:00
|
|
|
/* shader script callbacks */
|
|
|
|
func = RNA_def_function(srna, "update_script_node", NULL);
|
|
|
|
RNA_def_function_ui_description(func, "Compile shader script node");
|
|
|
|
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE);
|
|
|
|
prop = RNA_def_pointer(func, "node", "Node", "", "");
|
|
|
|
RNA_def_property_flag(prop, PROP_RNAPTR);
|
|
|
|
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
/* tag for redraw */
|
|
|
|
RNA_def_function(srna, "tag_redraw", "engine_tag_redraw");
|
2011-11-02 15:15:45 +00:00
|
|
|
RNA_def_function_ui_description(func, "Request redraw for viewport rendering");
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
|
|
|
|
/* tag for update */
|
|
|
|
RNA_def_function(srna, "tag_update", "engine_tag_update");
|
2011-11-02 15:15:45 +00:00
|
|
|
RNA_def_function_ui_description(func, "Request update call for viewport rendering");
|
Blender modifications for Cycles integration.
Some notes about code status:
* The Blender modifications were fairly quickly put together, much more code
polish and work is needed to get this to a state where it can be committed
to trunk. Files created with this version may not work in future versions.
* Only simple path tracing is supported currently, but we intend to provide
finer control, and more options where it makes sense.
* For GPU rendering, only CUDA works currently. The intention is to have the
same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
get OpenCL functional.
* There are two shading backends: GPU compatible and Open Shading Language.
Unfortunately, OSL only runs on the CPU currently, getting this to run on
the GPU would be a major undertaking, and is unlikely to be supported soon.
Additionally, it's not possible yet to write custom OSL shaders.
* There is some code for adaptive subdivision and displacement, but it's far
from finished. The intention is to eventually have a nice unified bump and
displacement system.
* The code currently has a number of fairly heavy dependencies: Boost,
OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
to compile, we'll try to eliminate some, it may take a while before it
becomes easy to compile this.
2011-04-27 14:36:02 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "begin_result", "RE_engine_begin_result");
|
|
|
|
prop = RNA_def_int(func, "x", 0, 0, INT_MAX, "X", "", 0, INT_MAX);
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_int(func, "y", 0, 0, INT_MAX, "Y", "", 0, INT_MAX);
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_int(func, "w", 0, 0, INT_MAX, "Width", "", 0, INT_MAX);
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_int(func, "h", 0, 0, INT_MAX, "Height", "", 0, INT_MAX);
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
2012-09-04 18:27:47 +00:00
|
|
|
RNA_def_string(func, "layer", "", 0, "Layer", "Single layer to get render result for"); /* NULL ok here */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_function_return(func, prop);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "update_result", "RE_engine_update_result");
|
|
|
|
prop = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "end_result", "RE_engine_end_result");
|
|
|
|
prop = RNA_def_pointer(func, "result", "RenderResult", "Result", "");
|
2012-09-04 18:27:47 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
2012-11-01 09:54:00 +00:00
|
|
|
RNA_def_boolean(func, "cancel", 0, "Cancel", "Don't merge back results");
|
2009-07-21 20:28:32 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "test_break", "RE_engine_test_break");
|
|
|
|
prop = RNA_def_boolean(func, "do_break", 0, "Break", "");
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_function_return(func, prop);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "update_stats", "RE_engine_update_stats");
|
|
|
|
prop = RNA_def_string(func, "stats", "", 0, "Stats", "");
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_string(func, "info", "", 0, "Info", "");
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "update_progress", "RE_engine_update_progress");
|
|
|
|
prop = RNA_def_float(func, "progress", 0, 0.0f, 1.0f, "", "Percentage of render that's done", 0.0f, 1.0f);
|
2011-05-17 15:39:40 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
|
|
|
|
2012-11-05 08:04:57 +00:00
|
|
|
func = RNA_def_function(srna, "update_memory_stats", "RE_engine_update_memory_stats");
|
|
|
|
RNA_def_float(func, "memory_used", 0, 0.0f, FLT_MAX, "", "Current memory usage in megabytes", 0.0f, FLT_MAX);
|
|
|
|
RNA_def_float(func, "memory_peak", 0, 0.0f, FLT_MAX, "", "Peak memory usage in megabytes", 0.0f, FLT_MAX);
|
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "report", "RE_engine_report");
|
|
|
|
prop = RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", "");
|
2011-05-17 15:20:12 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_string(func, "message", "", 0, "Report Message", "");
|
2011-05-17 15:20:12 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
|
|
|
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_define_verify_sdna(0);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "is_animation", PROP_BOOLEAN, PROP_NONE);
|
2011-11-02 15:15:45 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_ANIMATION);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "is_preview", PROP_BOOLEAN, PROP_NONE);
|
2011-11-02 15:15:45 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_PREVIEW);
|
|
|
|
|
2012-04-15 13:41:07 +00:00
|
|
|
prop = RNA_def_property(srna, "camera_override", PROP_POINTER, PROP_NONE);
|
2012-04-13 17:42:03 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "camera_override");
|
|
|
|
RNA_def_property_struct_type(prop, "Object");
|
|
|
|
|
2012-09-04 13:29:07 +00:00
|
|
|
prop = RNA_def_property(srna, "tile_x", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "tile_x");
|
|
|
|
prop = RNA_def_property(srna, "tile_y", PROP_INT, PROP_UNSIGNED);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "tile_y");
|
|
|
|
|
|
|
|
prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "resolution_x");
|
|
|
|
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, "resolution_y");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
2013-03-14 07:38:37 +00:00
|
|
|
/* Render Data */
|
|
|
|
prop = RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE);
|
|
|
|
RNA_def_property_struct_type(prop, "RenderSettings");
|
|
|
|
RNA_def_property_pointer_funcs(prop, "rna_RenderEngine_render_get", NULL, NULL, NULL);
|
|
|
|
RNA_def_property_ui_text(prop, "Render Data", "");
|
|
|
|
|
2013-01-01 16:15:13 +00:00
|
|
|
prop = RNA_def_property(srna, "use_highlight_tiles", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_HIGHLIGHT_TILES);
|
|
|
|
|
2011-11-02 15:15:45 +00:00
|
|
|
/* registration */
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_property_string_sdna(prop, NULL, "type->idname");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REGISTER | PROP_NEVER_CLAMP);
|
2009-07-21 20:28:32 +00:00
|
|
|
|
2013-01-05 13:52:41 +00:00
|
|
|
prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_def_property_string_sdna(prop, NULL, "type->name");
|
|
|
|
RNA_def_property_flag(prop, PROP_REGISTER);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "bl_use_preview", PROP_BOOLEAN, PROP_NONE);
|
2011-10-11 17:19:55 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_PREVIEW);
|
2010-03-28 13:48:11 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "bl_use_postprocess", PROP_BOOLEAN, PROP_NONE);
|
2011-10-11 17:19:55 +00:00
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", RE_USE_POSTPROCESS);
|
|
|
|
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "bl_use_shading_nodes", PROP_BOOLEAN, PROP_NONE);
|
2011-10-11 17:19:55 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_SHADING_NODES);
|
2010-03-28 14:45:09 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
|
|
|
|
|
2013-06-10 13:53:38 +00:00
|
|
|
prop = RNA_def_property(srna, "bl_use_exclude_layers", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_EXCLUDE_LAYERS);
|
|
|
|
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
|
|
|
|
|
2013-07-11 12:22:29 +00:00
|
|
|
prop = RNA_def_property(srna, "bl_use_save_buffers", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_SAVE_BUFFERS);
|
|
|
|
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
|
|
|
|
|
2009-07-21 20:28:32 +00:00
|
|
|
RNA_define_verify_sdna(1);
|
|
|
|
}
|
|
|
|
|
2009-07-21 14:11:51 +00:00
|
|
|
static void rna_def_render_result(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
2009-08-16 22:53:15 +00:00
|
|
|
FunctionRNA *func;
|
2010-08-28 12:34:22 +00:00
|
|
|
PropertyRNA *parm;
|
2009-07-21 14:11:51 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "RenderResult", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes");
|
2009-07-21 14:11:51 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "load_from_file", "RE_result_load_from_file");
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file");
|
2009-08-16 22:53:15 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_string_file_name(func, "filename", "", FILE_MAX, "File Name",
|
2012-05-12 11:01:29 +00:00
|
|
|
"Filename to load into this render tile, must be no smaller than "
|
|
|
|
"the render result");
|
2010-08-28 12:34:22 +00:00
|
|
|
RNA_def_property_flag(parm, PROP_REQUIRED);
|
2009-08-16 22:53:15 +00:00
|
|
|
|
2009-07-21 14:11:51 +00:00
|
|
|
RNA_define_verify_sdna(0);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE);
|
2010-08-28 12:34:22 +00:00
|
|
|
RNA_def_property_int_sdna(parm, NULL, "rectx");
|
|
|
|
RNA_def_property_clear_flag(parm, PROP_EDITABLE);
|
2009-07-21 14:11:51 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE);
|
2010-08-28 12:34:22 +00:00
|
|
|
RNA_def_property_int_sdna(parm, NULL, "recty");
|
|
|
|
RNA_def_property_clear_flag(parm, PROP_EDITABLE);
|
2009-07-21 14:11:51 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
|
2010-08-28 12:34:22 +00:00
|
|
|
RNA_def_property_struct_type(parm, "RenderLayer");
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next",
|
|
|
|
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
|
|
|
|
NULL, NULL, NULL, NULL);
|
2009-07-21 14:11:51 +00:00
|
|
|
|
|
|
|
RNA_define_verify_sdna(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_render_layer(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
2009-07-27 18:50:10 +00:00
|
|
|
FunctionRNA *func;
|
2009-07-21 14:11:51 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "RenderLayer", NULL);
|
2009-07-21 14:11:51 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Render Layer", "");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "load_from_file", "RE_layer_load_from_file");
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file");
|
2009-07-27 18:50:10 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_string(func, "filename", "", 0, "Filename",
|
2012-05-12 11:01:29 +00:00
|
|
|
"Filename to load into this render tile, must be no smaller than the renderlayer");
|
2009-07-27 18:50:10 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_REQUIRED);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X",
|
|
|
|
"Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX);
|
|
|
|
RNA_def_int(func, "y", 0, 0, INT_MAX, "Offset Y",
|
|
|
|
"Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX);
|
2011-02-08 10:31:47 +00:00
|
|
|
|
2009-07-21 14:11:51 +00:00
|
|
|
RNA_define_verify_sdna(0);
|
|
|
|
|
|
|
|
rna_def_render_layer_common(srna, 0);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "passes", PROP_COLLECTION, PROP_NONE);
|
2009-07-21 14:11:51 +00:00
|
|
|
RNA_def_property_struct_type(prop, "RenderPass");
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_collection_funcs(prop, "rna_RenderLayer_passes_begin", "rna_iterator_listbase_next",
|
|
|
|
"rna_iterator_listbase_end", "rna_iterator_listbase_get",
|
|
|
|
NULL, NULL, NULL, NULL);
|
2009-07-21 14:11:51 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
|
2009-09-09 19:40:46 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_DYNAMIC);
|
|
|
|
RNA_def_property_multi_array(prop, 2, NULL);
|
|
|
|
RNA_def_property_dynamic_array_funcs(prop, "rna_RenderLayer_rect_get_length");
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_RenderLayer_rect_get", "rna_RenderLayer_rect_set", NULL);
|
2009-07-21 14:11:51 +00:00
|
|
|
|
|
|
|
RNA_define_verify_sdna(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_render_pass(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
static EnumPropertyItem pass_type_items[] = {
|
2009-07-21 14:11:51 +00:00
|
|
|
{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", ""},
|
2010-03-16 18:22:55 +00:00
|
|
|
{SCE_PASS_VECTOR, "VECTOR", 0, "Vector", ""},
|
2009-07-21 14:11:51 +00:00
|
|
|
{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", ""},
|
2010-01-27 21:40:08 +00:00
|
|
|
{SCE_PASS_EMIT, "EMIT", 0, "Emit", ""},
|
|
|
|
{SCE_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""},
|
2011-07-04 19:22:37 +00:00
|
|
|
{SCE_PASS_INDEXMA, "MATERIAL_INDEX", 0, "Material Index", ""},
|
Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
Diffuse/Glossy/Transmission x Direct/Indirect/Color
Not supported yet:
* UV, Vector, Mist
Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
|
|
|
{SCE_PASS_DIFFUSE_DIRECT, "DIFFUSE_DIRECT", 0, "Diffuse Direct", ""},
|
|
|
|
{SCE_PASS_DIFFUSE_INDIRECT, "DIFFUSE_INDIRECT", 0, "Diffuse Indirect", ""},
|
|
|
|
{SCE_PASS_DIFFUSE_COLOR, "DIFFUSE_COLOR", 0, "Diffuse Color", ""},
|
|
|
|
{SCE_PASS_GLOSSY_DIRECT, "GLOSSY_DIRECT", 0, "Glossy Direct", ""},
|
|
|
|
{SCE_PASS_GLOSSY_INDIRECT, "GLOSSY_INDIRECT", 0, "Glossy Indirect", ""},
|
|
|
|
{SCE_PASS_GLOSSY_COLOR, "GLOSSY_COLOR", 0, "Glossy Color", ""},
|
|
|
|
{SCE_PASS_TRANSM_DIRECT, "TRANSMISSION_DIRECT", 0, "Transmission Direct", ""},
|
|
|
|
{SCE_PASS_TRANSM_INDIRECT, "TRANSMISSION_INDIRECT", 0, "Transmission Indirect", ""},
|
|
|
|
{SCE_PASS_TRANSM_COLOR, "TRANSMISSION_COLOR", 0, "Transmission Color", ""},
|
2013-08-03 13:12:09 +00:00
|
|
|
{SCE_PASS_SUBSURFACE_DIRECT, "SUBSURFACE_DIRECT", 0, "Subsurface Direct", ""},
|
|
|
|
{SCE_PASS_SUBSURFACE_INDIRECT, "SUBSURFACE_INDIRECT", 0, "Subsurface Indirect", ""},
|
|
|
|
{SCE_PASS_SUBSURFACE_COLOR, "SUBSURFACE_COLOR", 0, "Subsurface Color", ""},
|
2012-05-12 11:01:29 +00:00
|
|
|
{0, NULL, 0, NULL, NULL}
|
|
|
|
};
|
2009-07-21 14:11:51 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "RenderPass", NULL);
|
2009-07-21 14:11:51 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Render Pass", "");
|
|
|
|
|
|
|
|
RNA_define_verify_sdna(0);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
2009-07-21 14:11:51 +00:00
|
|
|
RNA_def_property_string_sdna(prop, NULL, "name");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_struct_name_property(srna, prop);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "channel_id", PROP_STRING, PROP_NONE);
|
2009-07-21 14:11:51 +00:00
|
|
|
RNA_def_property_string_sdna(prop, NULL, "chan_id");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "channels", PROP_INT, PROP_NONE);
|
2009-07-21 14:11:51 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "channels");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
|
2009-07-21 14:11:51 +00:00
|
|
|
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);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
|
2009-09-09 19:40:46 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_DYNAMIC);
|
|
|
|
RNA_def_property_multi_array(prop, 2, NULL);
|
|
|
|
RNA_def_property_dynamic_array_funcs(prop, "rna_RenderPass_rect_get_length");
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_RenderPass_rect_get", "rna_RenderPass_rect_set", NULL);
|
2009-07-21 14:11:51 +00:00
|
|
|
|
|
|
|
RNA_define_verify_sdna(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void RNA_def_render(BlenderRNA *brna)
|
|
|
|
{
|
2009-07-21 20:28:32 +00:00
|
|
|
rna_def_render_engine(brna);
|
2009-07-21 14:11:51 +00:00
|
|
|
rna_def_render_result(brna);
|
|
|
|
rna_def_render_layer(brna);
|
|
|
|
rna_def_render_pass(brna);
|
|
|
|
}
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
#endif /* RNA_RUNTIME */
|