Support group nodes #22

Merged
Bogdan Nagirniak merged 18 commits from BogdanNagirniak/blender:matx-group-nodes into matx-export-material 2023-09-18 12:49:19 +02:00
3 changed files with 7 additions and 9 deletions
Showing only changes of commit 8a2461c6b2 - Show all commits

View File

@ -83,7 +83,7 @@ void MaterialData::init()
pxr::UsdMtlxRead(doc, stage);
/* Logging stage: creating lambda stage_str() for not to call stage->ExportToString()
* if log doesn't execute. */
* if log won't be printed. */
auto stage_str = [&stage]() {
std::string str;
stage->ExportToString(&str);

View File

@ -47,13 +47,11 @@ NodeItem GroupNodeParser::compute()
NodeItem GroupNodeParser::compute_full()
{
CLOG_INFO(LOG_MATERIALX_SHADER,
1,
"%s [%d] => %s",
node_->name,
node_->typeinfo->type,
NodeItem::type(to_type_).c_str());
return compute();
NodeItem res = compute();
if (NodeItem::is_arithmetic(to_type_)) {
res = res.convert(to_type_);
}
return res;
}
NodeItem GroupOutputNodeParser::compute()

View File

@ -8,7 +8,7 @@
/* TODO: pxr::UsdMtlxRead() doesn't perform nodegraphs.
* Uncomment USE_MATERIALX_NODEGRAPH after fixing it. */
#define USE_MATERIALX_NODEGRAPH
//#define USE_MATERIALX_NODEGRAPH
namespace blender::nodes::materialx {