Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-02-22 16:24:04 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-02-22 16:24:04 +0400
commit3bae60d0c9e7629d29d1569201dd07e968acd600 (patch)
tree7164d84e77bed4f92e2d935865be9cae1518b057 /source/blender/makesdna
parentdadc2a26e33fc2046438d4532468783ed8485a6b (diff)
Adds a new node type for saving multiple image files from a single node.
Unlike the existing file output node this node has an arbitrary number of possible input slots. It has a base path string that can be set to a general base folder. Every input socket then uses its name as an extension of the base path for file organization. This can include further subfolders on top of the base path. Example: Base path: '/home/user/myproject' Input 1: 'Compo' Input 2: 'Diffuse/' Input 3: 'details/Normals' would create output files in /home/user/myproject: Compo0001.png, Compo0002.png, ... in /home/user/myproject/Diffuse: 0001.png, 0002.png, ... (no filename base given) in /home/user/myproject/details: Normals0001.png, Normals0002.png, ... Most settings for the node can be found in the sidebar (NKEY). New input sockets can be added with the "Add Input" button. There is a list of input sockets and below that the details for each socket can be changed, including the sub-path and filename. Sockets can be removed here as well. By default each socket uses the render settings file output format, but each can use its own format if necessary. To my knowledge this is the first node making use of such dynamic sockets in trunk. So this is also a design test, other nodes might use this in the future. Adding operator buttons on top of a node is a bit unwieldy atm, because all node operators generally work on selected and/or active node(s). The operator button would therefore either have to make sure the node is activated before the operator is called (block callback maybe?) OR it has to store the node name (risky, weak reference). For now it is only used in the sidebar, where only the active node's buttons are displayed. Also adds a new struct_type value to bNodeSocket, in order to distinguish different socket types with the same data type (file inputs are SOCK_RGBA color sockets). Would be nicer to use data type only for actual data evaluation, but used in too many places, this works ok for now.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_node_types.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 361aca4a572..05a469916a6 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -77,7 +77,7 @@ typedef struct bNodeSocket {
short type, flag;
short limit; /* max. number of links */
- short pad1;
+ short struct_type; /* optional identifier for RNA struct subtype */
float locx, locy;
@@ -112,6 +112,10 @@ typedef struct bNodeSocket {
#define SOCK_INT 6
#define NUM_SOCKET_TYPES 7 /* must be last! */
+/* sock->struct_type */
+#define SOCK_STRUCT_NONE 0 /* default, type is defined by sock->type only */
+#define SOCK_STRUCT_OUTPUT_MULTI_FILE 1 /* multi file output node socket */
+
/* socket side (input/output) */
#define SOCK_IN 1
#define SOCK_OUT 2
@@ -354,6 +358,18 @@ typedef struct NodeImageFile {
int sfra, efra;
} NodeImageFile;
+typedef struct NodeImageMultiFile {
+ char base_path[1024]; /* 1024 = FILE_MAX */
+ int active_input; /* selected input in details view list */
+ int pad;
+} NodeImageMultiFile;
+typedef struct NodeImageMultiFileSocket {
+ short use_render_format; /* use global render settings instead of own format */
+ short pad1;
+ int pad2;
+ ImageFormatData format;
+} NodeImageMultiFileSocket;
+
typedef struct NodeChroma {
float t1,t2,t3;
float fsize,fstrength,falpha;