forked from blender/blender
Fix linux build #33
@ -31,15 +31,9 @@ NodeItem GroupNodeParser::compute()
|
|||||||
graph = group_graph.get();
|
graph = group_graph.get();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NodeItem out = GroupOutputNodeParser(graph,
|
NodeItem out =
|
||||||
depsgraph_,
|
GroupOutputNodeParser(
|
||||||
material_,
|
graph, depsgraph_, material_, node_out, socket_out_, to_type_, this, export_image_fn_)
|
||||||
node_out,
|
|
||||||
socket_out_,
|
|
||||||
to_type_,
|
|
||||||
this,
|
|
||||||
use_group_default_,
|
|
||||||
export_image_fn_)
|
|
||||||
.compute_full();
|
.compute_full();
|
||||||
|
|
||||||
#ifdef USE_MATERIALX_NODEGRAPH
|
#ifdef USE_MATERIALX_NODEGRAPH
|
||||||
@ -114,6 +108,21 @@ std::string GroupOutputNodeParser::out_name(const bNodeSocket *out_socket)
|
|||||||
return MaterialX::createValidName(std::string("out_") + out_socket->name);
|
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
|
|||||||
|
|
||||||
NodeItem GroupInputNodeParser::compute()
|
NodeItem GroupInputNodeParser::compute()
|
||||||
{
|
{
|
||||||
#ifdef USE_MATERIALX_NODEGRAPH
|
#ifdef USE_MATERIALX_NODEGRAPH
|
||||||
|
@ -35,8 +35,19 @@ class GroupOutputNodeParser : public NodeParser {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class GroupInputNodeParser : public NodeParser {
|
class GroupInputNodeParser : public NodeParser {
|
||||||
|
private:
|
||||||
|
bool use_group_default_;
|
||||||
|
|
||||||
public:
|
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() override;
|
||||||
NodeItem compute_full() override;
|
NodeItem compute_full() override;
|
||||||
|
|
||||||
|
@ -71,7 +71,6 @@ MaterialX::DocumentPtr export_to_materialx(Depsgraph *depsgraph,
|
|||||||
NodeItem::Type::Material,
|
NodeItem::Type::Material,
|
||||||
nullptr,
|
nullptr,
|
||||||
NodeItem(doc.get()),
|
NodeItem(doc.get()),
|
||||||
false,
|
|
||||||
export_image_fn};
|
export_image_fn};
|
||||||
output_node->typeinfo->materialx_fn(&data, output_node, nullptr);
|
output_node->typeinfo->materialx_fn(&data, output_node, nullptr);
|
||||||
}
|
}
|
||||||
@ -83,7 +82,6 @@ MaterialX::DocumentPtr export_to_materialx(Depsgraph *depsgraph,
|
|||||||
nullptr,
|
nullptr,
|
||||||
NodeItem::Type::Material,
|
NodeItem::Type::Material,
|
||||||
nullptr,
|
nullptr,
|
||||||
false,
|
|
||||||
export_image_fn)
|
export_image_fn)
|
||||||
.compute_error();
|
.compute_error();
|
||||||
}
|
}
|
||||||
@ -96,7 +94,6 @@ MaterialX::DocumentPtr export_to_materialx(Depsgraph *depsgraph,
|
|||||||
nullptr,
|
nullptr,
|
||||||
NodeItem::Type::Material,
|
NodeItem::Type::Material,
|
||||||
nullptr,
|
nullptr,
|
||||||
false,
|
|
||||||
export_image_fn)
|
export_image_fn)
|
||||||
.compute();
|
.compute();
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ NodeParser::NodeParser(MaterialX::GraphElement *graph,
|
|||||||
const bNodeSocket *socket_out,
|
const bNodeSocket *socket_out,
|
||||||
NodeItem::Type to_type,
|
NodeItem::Type to_type,
|
||||||
GroupNodeParser *group_parser,
|
GroupNodeParser *group_parser,
|
||||||
bool use_group_default,
|
|
||||||
ExportImageFunction export_image_fn)
|
ExportImageFunction export_image_fn)
|
||||||
: graph_(graph),
|
: graph_(graph),
|
||||||
depsgraph_(depsgraph),
|
depsgraph_(depsgraph),
|
||||||
@ -30,7 +29,6 @@ NodeParser::NodeParser(MaterialX::GraphElement *graph,
|
|||||||
socket_out_(socket_out),
|
socket_out_(socket_out),
|
||||||
to_type_(to_type),
|
to_type_(to_type),
|
||||||
group_parser_(group_parser),
|
group_parser_(group_parser),
|
||||||
use_group_default_(use_group_default),
|
|
||||||
export_image_fn_(export_image_fn)
|
export_image_fn_(export_image_fn)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -229,7 +227,6 @@ NodeItem NodeParser::get_input_link(const bNodeSocket &socket,
|
|||||||
link->fromsock,
|
link->fromsock,
|
||||||
to_type,
|
to_type,
|
||||||
group_parser_,
|
group_parser_,
|
||||||
use_group_default,
|
|
||||||
export_image_fn_)
|
export_image_fn_)
|
||||||
.compute_full();
|
.compute_full();
|
||||||
}
|
}
|
||||||
@ -254,14 +251,8 @@ NodeItem NodeParser::get_input_link(const bNodeSocket &socket,
|
|||||||
return empty();
|
return empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeParserData data = {graph_,
|
NodeParserData data = {
|
||||||
depsgraph_,
|
graph_, depsgraph_, material_, to_type, group_parser_, empty(), export_image_fn_};
|
||||||
material_,
|
|
||||||
to_type,
|
|
||||||
group_parser_,
|
|
||||||
empty(),
|
|
||||||
use_group_default,
|
|
||||||
export_image_fn_};
|
|
||||||
from_node->typeinfo->materialx_fn(&data, const_cast<bNode *>(from_node), link->fromsock);
|
from_node->typeinfo->materialx_fn(&data, const_cast<bNode *>(from_node), link->fromsock);
|
||||||
return data.result;
|
return data.result;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,6 @@ class NodeParser {
|
|||||||
const bNodeSocket *socket_out_;
|
const bNodeSocket *socket_out_;
|
||||||
NodeItem::Type to_type_;
|
NodeItem::Type to_type_;
|
||||||
GroupNodeParser *group_parser_;
|
GroupNodeParser *group_parser_;
|
||||||
bool use_group_default_;
|
|
||||||
ExportImageFunction export_image_fn_;
|
ExportImageFunction export_image_fn_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -44,7 +43,6 @@ class NodeParser {
|
|||||||
const bNodeSocket *socket_out,
|
const bNodeSocket *socket_out,
|
||||||
NodeItem::Type to_type,
|
NodeItem::Type to_type,
|
||||||
GroupNodeParser *group_parser,
|
GroupNodeParser *group_parser,
|
||||||
bool use_group_default,
|
|
||||||
ExportImageFunction export_image_fn);
|
ExportImageFunction export_image_fn);
|
||||||
virtual ~NodeParser() = default;
|
virtual ~NodeParser() = default;
|
||||||
|
|
||||||
@ -107,7 +105,6 @@ struct NodeParserData {
|
|||||||
NodeItem::Type to_type;
|
NodeItem::Type to_type;
|
||||||
GroupNodeParser *group_parser;
|
GroupNodeParser *group_parser;
|
||||||
NodeItem result;
|
NodeItem result;
|
||||||
bool use_group_default;
|
|
||||||
ExportImageFunction export_image_fn;
|
ExportImageFunction export_image_fn;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -135,7 +132,6 @@ struct NodeParserData {
|
|||||||
out, \
|
out, \
|
||||||
d->to_type, \
|
d->to_type, \
|
||||||
d->group_parser, \
|
d->group_parser, \
|
||||||
d->use_group_default, \
|
|
||||||
d->export_image_fn) \
|
d->export_image_fn) \
|
||||||
.compute_full(); \
|
.compute_full(); \
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user
get_input_value(...
Otherwise, the input socket's default value is ignored.