Fix linux build #33

Merged
Bogdan Nagirniak merged 7 commits from BogdanNagirniak/blender:matx-linux-build-fix into matx-export-material 2023-09-24 07:42:31 +02:00
5 changed files with 33 additions and 29 deletions
Showing only changes of commit d91cc11fbe - Show all commits

View File

@ -31,16 +31,10 @@ NodeItem GroupNodeParser::compute()
graph = group_graph.get();
#endif
NodeItem out = GroupOutputNodeParser(graph,
depsgraph_,
material_,
node_out,
socket_out_,
to_type_,
this,
use_group_default_,
export_image_fn_)
.compute_full();
NodeItem out =
GroupOutputNodeParser(
graph, depsgraph_, material_, node_out, socket_out_, to_type_, this, export_image_fn_)
.compute_full();
#ifdef USE_MATERIALX_NODEGRAPH
/* We have to be in NodeParser's graph_, therefore copying output */
@ -114,6 +108,21 @@ std::string GroupOutputNodeParser::out_name(const bNodeSocket *out_socket)
return MaterialX::createValidName(std::string("out_") + out_socket->name);
}
GroupInputNodeParser::GroupInputNodeParser(MaterialX::GraphElement *graph,
const Depsgraph *depsgraph,
const Material *material,
const bNode *node,
const bNodeSocket *socket_out,
NodeItem::Type to_type,
GroupNodeParser *group_parser,
bool use_group_default,
ExportImageFunction export_image_fn)
: NodeParser(
graph, depsgraph, material, node, socket_out, to_type, group_parser, export_image_fn),
use_group_default_(use_group_default)
{
}
BogdanNagirniak marked this conversation as resolved
Review

get_input_value(...
Otherwise, the input socket's default value is ignored.

`get_input_value(...` Otherwise, the input socket's default value is ignored.
NodeItem GroupInputNodeParser::compute()
{
#ifdef USE_MATERIALX_NODEGRAPH

View File

@ -35,8 +35,19 @@ class GroupOutputNodeParser : public NodeParser {
};
class GroupInputNodeParser : public NodeParser {
private:
bool use_group_default_;
public:
using NodeParser::NodeParser;
GroupInputNodeParser(MaterialX::GraphElement *graph,
const Depsgraph *depsgraph,
const Material *material,
const bNode *node,
const bNodeSocket *socket_out,
NodeItem::Type to_type,
GroupNodeParser *group_parser,
bool use_group_default,
ExportImageFunction export_image_fn);
NodeItem compute() override;
NodeItem compute_full() override;

View File

@ -71,7 +71,6 @@ MaterialX::DocumentPtr export_to_materialx(Depsgraph *depsgraph,
NodeItem::Type::Material,
nullptr,
NodeItem(doc.get()),
false,
export_image_fn};
output_node->typeinfo->materialx_fn(&data, output_node, nullptr);
}
@ -83,7 +82,6 @@ MaterialX::DocumentPtr export_to_materialx(Depsgraph *depsgraph,
nullptr,
NodeItem::Type::Material,
nullptr,
false,
export_image_fn)
.compute_error();
}
@ -96,7 +94,6 @@ MaterialX::DocumentPtr export_to_materialx(Depsgraph *depsgraph,
nullptr,
NodeItem::Type::Material,
nullptr,
false,
export_image_fn)
.compute();
}

View File

@ -21,7 +21,6 @@ NodeParser::NodeParser(MaterialX::GraphElement *graph,
const bNodeSocket *socket_out,
NodeItem::Type to_type,
GroupNodeParser *group_parser,
bool use_group_default,
ExportImageFunction export_image_fn)
: graph_(graph),
depsgraph_(depsgraph),
@ -30,7 +29,6 @@ NodeParser::NodeParser(MaterialX::GraphElement *graph,
socket_out_(socket_out),
to_type_(to_type),
group_parser_(group_parser),
use_group_default_(use_group_default),
export_image_fn_(export_image_fn)
{
}
@ -229,7 +227,6 @@ NodeItem NodeParser::get_input_link(const bNodeSocket &socket,
link->fromsock,
to_type,
group_parser_,
use_group_default,
export_image_fn_)
.compute_full();
}
@ -254,14 +251,8 @@ NodeItem NodeParser::get_input_link(const bNodeSocket &socket,
return empty();
}
NodeParserData data = {graph_,
depsgraph_,
material_,
to_type,
group_parser_,
empty(),
use_group_default,
export_image_fn_};
NodeParserData data = {
graph_, depsgraph_, material_, to_type, group_parser_, empty(), export_image_fn_};
from_node->typeinfo->materialx_fn(&data, const_cast<bNode *>(from_node), link->fromsock);
return data.result;
}

View File

@ -33,7 +33,6 @@ class NodeParser {
const bNodeSocket *socket_out_;
NodeItem::Type to_type_;
GroupNodeParser *group_parser_;
bool use_group_default_;
ExportImageFunction export_image_fn_;
public:
@ -44,7 +43,6 @@ class NodeParser {
const bNodeSocket *socket_out,
NodeItem::Type to_type,
GroupNodeParser *group_parser,
bool use_group_default,
ExportImageFunction export_image_fn);
virtual ~NodeParser() = default;
@ -107,7 +105,6 @@ struct NodeParserData {
NodeItem::Type to_type;
GroupNodeParser *group_parser;
NodeItem result;
bool use_group_default;
ExportImageFunction export_image_fn;
};
@ -135,7 +132,6 @@ struct NodeParserData {
out, \
d->to_type, \
d->group_parser, \
d->use_group_default, \
d->export_image_fn) \
.compute_full(); \
}