forked from blender/blender
MaterialX: add convert nodes #15
@ -13,7 +13,7 @@ NodeItem BlackbodyNodeParser::compute()
|
||||
*
|
||||
* NodeItem temperature = get_input_value("Temperature", NodeItem::Type::Float);
|
||||
|
||||
* NodeItem res = create_node("blackbody", "color3");
|
||||
* NodeItem res = create_node("blackbody", NodeItem::Type::Color3);
|
||||
* res.set_input("temperature", temperature);
|
||||
* return res; */
|
||||
return empty();
|
||||
|
@ -147,6 +147,7 @@ NodeItem NodeParser::get_input_link(const bNodeSocket &socket, NodeItem::Type to
|
||||
CASE_NODE_TYPE(SH_NODE_MATH, MathNodeParser)
|
||||
CASE_NODE_TYPE(SH_NODE_MIX_RGB_LEGACY, MixRGBNodeParser)
|
||||
CASE_NODE_TYPE(SH_NODE_NORMAL_MAP, NormalMapNodeParser)
|
||||
CASE_NODE_TYPE(SH_NODE_RGBTOBW, RGBToBWNodeParser)
|
||||
CASE_NODE_TYPE(SH_NODE_SEPARATE_COLOR, SeparateColorNodeParser)
|
||||
CASE_NODE_TYPE(SH_NODE_SEPXYZ, SeparateXYZNodeParser)
|
||||
CASE_NODE_TYPE(SH_NODE_TEX_CHECKER, TexCheckerNodeParser)
|
||||
|
@ -101,6 +101,7 @@ DECLARE_NODE_PARSER(MapRangeNodeParser)
|
||||
DECLARE_NODE_PARSER(MathNodeParser)
|
||||
DECLARE_NODE_PARSER(MixRGBNodeParser)
|
||||
DECLARE_NODE_PARSER(NormalMapNodeParser)
|
||||
DECLARE_NODE_PARSER(RGBToBWNodeParser)
|
||||
DECLARE_NODE_PARSER(SeparateColorNodeParser)
|
||||
DECLARE_NODE_PARSER(SeparateXYZNodeParser)
|
||||
DECLARE_NODE_PARSER(TexCheckerNodeParser)
|
||||
|
18
source/blender/nodes/shader/materialx/nodes/rgb_to_bw.cc
Normal file
18
source/blender/nodes/shader/materialx/nodes/rgb_to_bw.cc
Normal file
@ -0,0 +1,18 @@
|
||||
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include "node_parser.h"
|
||||
|
||||
namespace blender::nodes::materialx {
|
||||
|
||||
NodeItem RGBToBWNodeParser::compute()
|
||||
{
|
||||
NodeItem color = get_input_value("Color", NodeItem::Type::Color3);
|
||||
BogdanNagirniak marked this conversation as resolved
Outdated
|
||||
|
||||
NodeItem res = create_node("luminance", NodeItem::Type::Color3);
|
||||
res.set_input("in", color);
|
||||
return res;
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::materialx
|
Loading…
Reference in New Issue
Block a user
use Color4 type