Fix #36755, EXR Layers are not fully updated on scene load or image refresh.
After discussion with Brecht decided that automatically updating the sockets of the node based on externally modified data (removed EXR file passes) is not desirable behavior. But at least making sure the correct passes are assigned to the output sockets of the Image node is possible. Now the passes are matched by name instead of using the faulty index stored in the socket data, which is more reliable. Still may break if changing pass names externally, but an image reload is highly recommended anyway and will fix that.
This commit is contained in:
@@ -38,19 +38,19 @@ ImageNode::ImageNode(bNode *editorNode) : Node(editorNode)
|
||||
/* pass */
|
||||
|
||||
}
|
||||
NodeOperation *ImageNode::doMultilayerCheck(ExecutionSystem *system, RenderLayer *rl, Image *image, ImageUser *user, int framenumber, int outputsocketIndex, int pass, DataType datatype)
|
||||
NodeOperation *ImageNode::doMultilayerCheck(ExecutionSystem *system, RenderLayer *rl, Image *image, ImageUser *user, int framenumber, int outputsocketIndex, int passindex, DataType datatype)
|
||||
{
|
||||
OutputSocket *outputSocket = this->getOutputSocket(outputsocketIndex);
|
||||
MultilayerBaseOperation *operation = NULL;
|
||||
switch (datatype) {
|
||||
case COM_DT_VALUE:
|
||||
operation = new MultilayerValueOperation(pass);
|
||||
operation = new MultilayerValueOperation(passindex);
|
||||
break;
|
||||
case COM_DT_VECTOR:
|
||||
operation = new MultilayerVectorOperation(pass);
|
||||
operation = new MultilayerVectorOperation(passindex);
|
||||
break;
|
||||
case COM_DT_COLOR:
|
||||
operation = new MultilayerColorOperation(pass);
|
||||
operation = new MultilayerColorOperation(passindex);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -93,10 +93,19 @@ void ImageNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
|
||||
socket = this->getOutputSocket(index);
|
||||
if (socket->isConnected() || index == 0) {
|
||||
bNodeSocket *bnodeSocket = socket->getbNodeSocket();
|
||||
NodeImageLayer *storage = (NodeImageLayer *)bnodeSocket->storage;
|
||||
int passindex = storage->pass_index;
|
||||
|
||||
/* Passes in the file can differ from passes stored in sockets (#36755).
|
||||
* Look up the correct file pass using the socket identifier instead.
|
||||
*/
|
||||
#if 0
|
||||
NodeImageLayer *storage = (NodeImageLayer *)bnodeSocket->storage;*/
|
||||
int passindex = storage->pass_index;*/
|
||||
RenderPass *rpass = (RenderPass *)BLI_findlink(&rl->passes, passindex);
|
||||
#endif
|
||||
int passindex;
|
||||
RenderPass *rpass;
|
||||
for (rpass = (RenderPass *)rl->passes.first, passindex = 0; rpass; rpass = rpass->next, ++passindex)
|
||||
if (STREQ(rpass->name, bnodeSocket->identifier))
|
||||
break;
|
||||
if (rpass) {
|
||||
imageuser->pass = passindex;
|
||||
switch (rpass->channels) {
|
||||
|
||||
Reference in New Issue
Block a user