Code cleanup: replace magic constant used for alpha ignore flag with a define.
This commit is contained in:
@@ -41,10 +41,11 @@ void CompositorNode::convertToOperations(ExecutionSystem *graph, CompositorConte
|
||||
compositorOperation->setSceneName(editorNode->id->name);
|
||||
compositorOperation->setRenderData(context->getRenderData());
|
||||
compositorOperation->setbNodeTree(context->getbNodeTree());
|
||||
compositorOperation->setIgnoreAlpha(editorNode->custom2 & 1);
|
||||
compositorOperation->setIgnoreAlpha(editorNode->custom2 & CMP_NODE_OUTPUT_IGNORE_ALPHA);
|
||||
imageSocket->relinkConnections(compositorOperation->getInputSocket(0), 0, graph);
|
||||
alphaSocket->relinkConnections(compositorOperation->getInputSocket(1));
|
||||
depthSocket->relinkConnections(compositorOperation->getInputSocket(2));
|
||||
graph->addOperation(compositorOperation);
|
||||
addPreviewOperation(graph, context, compositorOperation->getInputSocket(0));
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ void ViewerNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
|
||||
viewerOperation->setChunkOrder((OrderOfChunks)editorNode->custom1);
|
||||
viewerOperation->setCenterX(editorNode->custom3);
|
||||
viewerOperation->setCenterY(editorNode->custom4);
|
||||
viewerOperation->setIgnoreAlpha(editorNode->custom2 & 1);
|
||||
viewerOperation->setIgnoreAlpha(editorNode->custom2 & CMP_NODE_OUTPUT_IGNORE_ALPHA);
|
||||
|
||||
viewerOperation->setViewSettings(context->getViewSettings());
|
||||
viewerOperation->setDisplaySettings(context->getDisplaySettings());
|
||||
|
||||
@@ -860,4 +860,7 @@ typedef struct NodeShaderNormalMap {
|
||||
/* image */
|
||||
#define CMP_NODE_IMAGE_USE_STRAIGHT_OUTPUT 1
|
||||
|
||||
/* viewer and cmposite output */
|
||||
#define CMP_NODE_OUTPUT_IGNORE_ALPHA 1
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4134,7 +4134,7 @@ static void def_cmp_viewer(StructRNA *srna)
|
||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
||||
|
||||
prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "custom2", 1);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "custom2", CMP_NODE_OUTPUT_IGNORE_ALPHA);
|
||||
RNA_def_property_ui_text(prop, "Use Alpha", "Colors are treated alpha premultiplied, or colors output straight (alpha gets set to 1)");
|
||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
||||
}
|
||||
@@ -4144,7 +4144,7 @@ static void def_cmp_composite(StructRNA *srna)
|
||||
PropertyRNA *prop;
|
||||
|
||||
prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "custom2", 1);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "custom2", CMP_NODE_OUTPUT_IGNORE_ALPHA);
|
||||
RNA_def_property_ui_text(prop, "Use Alpha", "Colors are treated alpha premultiplied, or colors output straight (alpha gets set to 1)");
|
||||
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user