diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-03-01 11:56:15 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-03-01 11:56:15 +0400 |
commit | 2eb29e4788008c1346b3a757cccec503b73c9b90 (patch) | |
tree | 8b27a7524ad45b8cfcadff31cfa17d2885a0f18b /source/blender/makesrna | |
parent | 1d5a3886a175da808df1872f161e4eb8848ab358 (diff) |
A number of improvements for the file output node(s).
1) Old CMP_NODE_OUTPUT_FILE and CMP_NODE_OUTPUT_MULTI_FILE have been merged,
only CMP_NODE_OUTPUT_FILE remains. All functions renamed accordingly.
2) do_versions code for converting single-file output nodes into multi-file
output nodes. If a Z buffer input is used, the node is made into a multilayer
exr with two inputs. (see below). Also re-identifies multi-file output nodes
with the CMP_NODE_OUTPUT_FILE type.
3) "Global" format is stored in node now. By default this overrides any
per-socket settings.
4) Multilayer EXR output implemented. When M.EXR format is selected for node
format, all socket format details are ignored. Socket names are used for layer
names.
5) Input buffer types are used as-is when possible, i.e. stored as B/W, RGB or
RGBA. In regular file output the format dictates the number of actual channels,
so the CompBuf is typechecked to the right type first. For multilayer EXR the
number of channels is more flexible, so an input buffer will store only the
channels it actually uses.
6) The editor socket type is updated from linked sockets as an indicator of the
actual data written to files. This may not be totally accurate for regular file
output though, due to restrictions of format setting.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 89 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree_types.h | 1 |
3 files changed, 20 insertions, 72 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 67d27af8b41..596e348e3f6 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -347,7 +347,7 @@ extern StructRNA RNA_NlaTrack; extern StructRNA RNA_Node; extern StructRNA RNA_NodeForLoop; extern StructRNA RNA_NodeGroup; -extern StructRNA RNA_NodeImageMultiFileSocket; +extern StructRNA RNA_NodeImageFileSocket; extern StructRNA RNA_NodeLink; extern StructRNA RNA_NodeSocket; extern StructRNA RNA_NodeSocketPanel; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index a6a8d9f9a35..01131709f3b 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -245,32 +245,28 @@ static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr) return &RNA_NodeSocket##stypename##idname; \ } - if (sock->struct_type == SOCK_STRUCT_NONE) { + switch (sock->struct_type) { + case SOCK_STRUCT_NONE: switch (sock->type) { case SOCK_FLOAT: NODE_DEFINE_SUBTYPES_FLOAT - break; + break; case SOCK_INT: NODE_DEFINE_SUBTYPES_INT - break; + break; case SOCK_BOOLEAN: return &RNA_NodeSocketBoolean; - break; case SOCK_VECTOR: NODE_DEFINE_SUBTYPES_VECTOR - break; + break; case SOCK_RGBA: return &RNA_NodeSocketRGBA; - break; case SOCK_SHADER: return &RNA_NodeSocketShader; } - } - else { - switch (sock->struct_type) { - case SOCK_STRUCT_OUTPUT_MULTI_FILE: - return &RNA_NodeImageMultiFileSocket; - } + break; + case SOCK_STRUCT_OUTPUT_FILE: + return &RNA_NodeImageFileSocket; } #undef SUBTYPE @@ -332,24 +328,6 @@ static void rna_Matte_t2_set(PointerRNA *ptr, float value) chroma->t2 = value; } -static void rna_Image_start_frame_set(PointerRNA *ptr, int value) -{ - bNode *node= (bNode*)ptr->data; - NodeImageFile *image = node->storage; - - CLAMP(value, MINFRAME, image->efra); - image->sfra= value; -} - -static void rna_Image_end_frame_set(PointerRNA *ptr, int value) -{ - bNode *node= (bNode*)ptr->data; - NodeImageFile *image = node->storage; - - CLAMP(value, image->sfra, MAXFRAME); - image->efra= value; -} - static void rna_Node_scene_set(PointerRNA *ptr, PointerRNA value) { bNode *node= (bNode*)ptr->data; @@ -1770,61 +1748,29 @@ static void def_cmp_render_layers(StructRNA *srna) RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } -static void def_cmp_output_file(StructRNA *srna) -{ - PropertyRNA *prop; - - RNA_def_struct_sdna_from(srna, "NodeImageFile", "storage"); - - prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_sdna(prop, NULL, "name"); - RNA_def_property_ui_text(prop, "File Path", "Output path for the image, same functionality as render output"); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - - prop= RNA_def_property(srna, "image_settings", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "im_format"); - RNA_def_property_struct_type(prop, "ImageFormatSettings"); - RNA_def_property_ui_text(prop, "Image Format", ""); - - prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "sfra"); - RNA_def_property_int_funcs(prop, NULL, "rna_Image_start_frame_set", NULL); - RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Start Frame", ""); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - - prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "efra"); - RNA_def_property_int_funcs(prop, NULL, "rna_Image_end_frame_set", NULL); - RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "End Frame", ""); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); -} - -static void rna_def_cmp_output_multi_file_socket(BlenderRNA *brna) +static void rna_def_cmp_output_file_socket(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - srna = RNA_def_struct(brna, "NodeImageMultiFileSocket", "NodeSocketRGBA"); + srna = RNA_def_struct(brna, "NodeImageFileSocket", "NodeSocketRGBA"); RNA_def_struct_sdna(srna, "bNodeSocket"); RNA_def_struct_path_func(srna, "rna_NodeSocket_path"); - RNA_def_struct_ui_text(srna, "Node Image Multi File Socket", "Socket data of multi file output node"); + RNA_def_struct_ui_text(srna, "Node Image File Socket", "Socket data of file output node"); RNA_def_struct_ui_icon(srna, ICON_PLUG); RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); RNA_def_struct_sdna_from(srna, "NodeImageMultiFileSocket", "storage"); - prop = RNA_def_property(srna, "use_render_format", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "use_render_format", 1); - RNA_def_property_ui_text(prop, "Use Render Format", ""); + prop = RNA_def_property(srna, "use_node_format", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "use_node_format", 1); + RNA_def_property_ui_text(prop, "Use Node Format", ""); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_NodeSocket_update"); prop = RNA_def_property(srna, "format", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ImageFormatSettings"); } -static void def_cmp_output_multi_file(StructRNA *srna) +static void def_cmp_output_file(StructRNA *srna) { PropertyRNA *prop; @@ -1845,6 +1791,9 @@ static void def_cmp_output_multi_file(StructRNA *srna) RNA_def_property_int_sdna(prop, NULL, "active_input"); RNA_def_property_ui_text(prop, "Active Input Index", "Active input index in details view list"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "format", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "ImageFormatSettings"); } static void def_cmp_dilate_erode(StructRNA *srna) @@ -3477,7 +3426,7 @@ void RNA_def_nodetree(BlenderRNA *brna) define_specific_node(brna, NODE_FRAME, def_frame); /* special socket types */ - rna_def_cmp_output_multi_file_socket(brna); + rna_def_cmp_output_file_socket(brna); } /* clean up macro definition */ diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h index b336f864012..745a956d831 100644 --- a/source/blender/makesrna/intern/rna_nodetree_types.h +++ b/source/blender/makesrna/intern/rna_nodetree_types.h @@ -113,7 +113,6 @@ DefNode( CompositorNode, CMP_NODE_IMAGE, def_cmp_image, "IMAGE DefNode( CompositorNode, CMP_NODE_R_LAYERS, def_cmp_render_layers, "R_LAYERS", RLayers, "Render Layers", "" ) DefNode( CompositorNode, CMP_NODE_COMPOSITE, 0, "COMPOSITE", Composite, "Composite", "" ) DefNode( CompositorNode, CMP_NODE_OUTPUT_FILE, def_cmp_output_file, "OUTPUT_FILE", OutputFile, "Output File", "" ) -DefNode( CompositorNode, CMP_NODE_OUTPUT_MULTI_FILE, def_cmp_output_multi_file, "OUTPUT_MULTI_FILE", OutputMultiFile, "Output Multi File", "" ) DefNode( CompositorNode, CMP_NODE_TEXTURE, def_texture, "TEXTURE", Texture, "Texture", "" ) DefNode( CompositorNode, CMP_NODE_TRANSLATE, 0, "TRANSLATE", Translate, "Translate", "" ) DefNode( CompositorNode, CMP_NODE_ZCOMBINE, def_cmp_zcombine, "ZCOMBINE", Zcombine, "Z Combine", "" ) |