From 005dabbd9ad51b75aef260168c81d5a826d4eb4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20T=C3=B6nne?= Date: Fri, 25 Apr 2014 12:00:35 +0200 Subject: Fix T39799: Backdrop (compositor) ignores alpha. This issue is because of a somewhat "special" behavior in old code, which got lost during rB09874df: There was a variant of the `relinkConnections` function which would leave the socket completely unconnected. This is not a valid state really (given that each unconnected input must otherwise connected to a constant `Set` type node), but was used as a way to distinguish connected alpha/depth sockets in composite and viewer output nodes. https://developer.blender.org/diffusion/B/browse/master/source/blender/compositor/intern/COM_InputSocket.cpp;28a829893c702918afc5ac1945a06eaefa611594$69 After the large cleanup patch ({D309}) every socket is now automatically connected to a constant, such that `getInputSocketReader` will never return a NULL pointer. This breaks the previous test method, which needs to be replaced by more explicit flags. Luckily this was done only for very few output nodes (Composite, Viewer, Output-File). These now use the regular SetValueOperation default in case "use alpha" is disabled, but set this to an explicit 1.0 value instead of mapping to the node socket. --- source/blender/compositor/operations/COM_OutputFileOperation.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender/compositor/operations/COM_OutputFileOperation.h') diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.h b/source/blender/compositor/operations/COM_OutputFileOperation.h index 6bb2e7d7320..03278c5b149 100644 --- a/source/blender/compositor/operations/COM_OutputFileOperation.h +++ b/source/blender/compositor/operations/COM_OutputFileOperation.h @@ -62,11 +62,14 @@ public: /* extra info for OpenEXR layers */ struct OutputOpenExrLayer { - OutputOpenExrLayer(const char *name, DataType datatype); + OutputOpenExrLayer(const char *name, DataType datatype, bool use_layer); char name[EXR_TOT_MAXNAME - 2]; - float *outputBuffer; DataType datatype; + bool use_layer; + + /* internals */ + float *outputBuffer; SocketReader *imageInput; }; @@ -85,7 +88,7 @@ private: public: OutputOpenExrMultiLayerOperation(const RenderData *rd, const bNodeTree *tree, const char *path, char exr_codec); - void add_layer(const char *name, DataType datatype); + void add_layer(const char *name, DataType datatype, bool use_layer); void executeRegion(rcti *rect, unsigned int tileNumber); bool isOutputOperation(bool rendering) const { return true; } -- cgit v1.2.3