diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-07-27 22:50:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-07-27 22:50:10 +0400 |
commit | eb40d8ef0f49873a7f262af367decb7e652e7618 (patch) | |
tree | 0e705bf7f8b208360bf420629afb0c5193e32c48 /source/blender/makesrna/intern/rna_render.c | |
parent | 324187b61a92c0c02c0e528a3f918ea73345a28e (diff) |
render api utility function to initialize a render layer from an image rather then loading through python.
lay = result.layers[0]
lay.rect_from_file("somefile.png", part.x, part.y)
If the source image is bigger then the render layer x/y offsets can be used to choose the part of the image use.
Diffstat (limited to 'source/blender/makesrna/intern/rna_render.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 89c48230357..7268d560282 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -297,10 +297,21 @@ static void rna_def_render_layer(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; + FunctionRNA *func; srna= RNA_def_struct(brna, "RenderLayer", NULL); RNA_def_struct_ui_text(srna, "Render Layer", ""); + func= RNA_def_function(srna, "rect_from_file", "RE_layer_rect_from_file"); + RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file."); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + prop= RNA_def_string(func, "filename", "", 0, "Filename", "Filename to load into this render tile, must be no smaller then the renderlayer"); + RNA_def_property_flag(prop, PROP_REQUIRED); + prop= RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X", "Offset the position to copy from if the image is larger then the render layer", 0, INT_MAX); + RNA_def_property_flag(prop, PROP_REQUIRED); + prop= RNA_def_int(func, "y", 0, 0, INT_MAX, "Offset Y", "Offset the position to copy from if the image is larger then the render layer", 0, INT_MAX); + RNA_def_property_flag(prop, PROP_REQUIRED); + RNA_define_verify_sdna(0); rna_def_render_layer_common(srna, 0); |