diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-14 14:15:10 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-03-14 14:15:10 +0400 |
commit | cf3b3a1ba2159792fad7cc0c8ccb98a855534823 (patch) | |
tree | d47f68221eb1ff3cd9102186a977eb2249939736 /source/blender | |
parent | 0159647ada64591e4edbcb1284cf499fc2ae9c09 (diff) |
Code cleanup: replace magic constant used for alpha ignore flag with a define.
Diffstat (limited to 'source/blender')
4 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/compositor/nodes/COM_CompositorNode.cpp b/source/blender/compositor/nodes/COM_CompositorNode.cpp index fc4dea8cee3..a78f96adfc6 100644 --- a/source/blender/compositor/nodes/COM_CompositorNode.cpp +++ b/source/blender/compositor/nodes/COM_CompositorNode.cpp @@ -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)); } + diff --git a/source/blender/compositor/nodes/COM_ViewerNode.cpp b/source/blender/compositor/nodes/COM_ViewerNode.cpp index 94f3c2ebd80..8f9e58fee13 100644 --- a/source/blender/compositor/nodes/COM_ViewerNode.cpp +++ b/source/blender/compositor/nodes/COM_ViewerNode.cpp @@ -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()); diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index b2b23828cee..2e24b6ed78d 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -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 diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 0d460edd380..933b7a78b59 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -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"); } |