forked from blender/blender
MaterialX: add convert nodes #15
@ -147,6 +147,7 @@ set(LIB
|
||||
if(WITH_MATERIALX)
|
||||
list(APPEND SRC
|
||||
materialx/material.cc
|
||||
materialx/nodes/blackbody.cc
|
||||
materialx/nodes/brightness.cc
|
||||
materialx/nodes/bsdf_principled.cc
|
||||
materialx/nodes/huesatval.cc
|
||||
|
22
source/blender/nodes/shader/materialx/nodes/blackbody.cc
Normal file
22
source/blender/nodes/shader/materialx/nodes/blackbody.cc
Normal file
@ -0,0 +1,22 @@
|
||||
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include "node_parser.h"
|
||||
|
||||
namespace blender::nodes::materialx {
|
||||
|
||||
NodeItem BlackbodyNodeParser::compute()
|
||||
{
|
||||
/* This node doesn't have an implementation in MaterialX 1.38.6.
|
||||
* It's added in MaterialX 1.38.8. Uncomment this code after switching to 1.38.8.
|
||||
*
|
||||
* NodeItem temperature = get_input_value("Temperature", NodeItem::Type::Float);
|
||||
|
||||
* NodeItem res = create_node("blackbody", "color3");
|
||||
* res.set_input("temperature", temperature);
|
||||
* return res; */
|
||||
return empty();
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::materialx
|
@ -132,6 +132,7 @@ NodeItem NodeParser::get_input_link(const bNodeSocket &socket)
|
||||
break;
|
||||
|
||||
switch (from_node->typeinfo->type) {
|
||||
CASE_NODE_TYPE(SH_NODE_BLACKBODY, BlackbodyNodeParser)
|
||||
CASE_NODE_TYPE(SH_NODE_BRIGHTCONTRAST, BrightContrastNodeParser)
|
||||
CASE_NODE_TYPE(SH_NODE_BSDF_PRINCIPLED, BSDFPrincipledNodeParser)
|
||||
CASE_NODE_TYPE(SH_NODE_COMBINE_COLOR, CombineColorNodeParser)
|
||||
|
@ -63,6 +63,7 @@ template<class T> NodeItem NodeParser::value(const T &data) const
|
||||
NodeItem compute() override; \
|
||||
};
|
||||
|
||||
DECLARE_PARSER(BlackbodyNodeParser)
|
||||
DECLARE_PARSER(BrightContrastNodeParser)
|
||||
DECLARE_PARSER(BSDFPrincipledNodeParser)
|
||||
DECLARE_PARSER(CombineColorNodeParser)
|
||||
|
Loading…
Reference in New Issue
Block a user