Describes how to define the viewport representation of a node material.
The viewport material preview defines how the node material is displayed in the viewport. The preview is defined by implementing a MaterialExchangeInterface and maxon::nodes::MaterialExchangeInterface::LoadMaterialDefaults() allows to load the material description of a given type. The interface contains the static function templates Extract(), Insert() and InsertData(). These functions are used to edit the DataDictionary containing the material description in GetMaterialParameters().
{
{
};
const maxon::NodePath rootNodePath = (_soloNodePath.IsPopulated() == true) ? _soloNodePath : _endNodePath;
}
BUNDLE
The data type is a bundle type.
Definition: apibase.h:83
const GraphModelRef & GetGraph() const
Definition: graph.h:1992
Definition: resultbase.h:766
static MAXON_METHOD Result< DataDictionary > LoadMaterialDefaults(const Id &materialType)
static Result< void > Insert(DataDictionary ¶meters, KEY &&id, T &&value, Bool isConstant, UInt dynamicTimestamp)
Definition: nodematerialexchange.h:203
#define parameters
Definition: graminit.h:11
UInt64 UInt
unsigned 32/64 bit int, size depends on the platform
Definition: apibase.h:189
#define MAXON_METHOD
Definition: interfacebase.h:1001
static constexpr LiteralId NODESPACE
Neutron node space identifier.
Definition: neutron_ids.h:108
The maxon namespace contains all declarations of the MAXON API.
Definition: autoweight.h:14
#define iferr_scope_handler
Definition: resultbase.h:1402
#define iferr_return
Definition: resultbase.h:1519
The class has to be registered with a macro.
static maxon::nodes::NodeSystemClass g_nodeSystemClass;
{
{
{
}, g_nodeSystemClass);
});
}
static maxon::Result<void> CreateMaterialGraphDefaultSetup(
const maxon::nodes::NodesGraphModelRef& graph)
{
maxon::GraphNode valuePort = shaderNode.GetInputs().FindChild(
maxon::Id("usernode_shade.colorB"))
iferr_return;
}
static
maxon::Result<
void> ConfigurePreviewImageRequest(
maxon::DataDictionaryObjectRef request)
{
request.Set(maxon::nodes::PREVIEWIMAGEREQUEST::PROVIDER, PreviewImageProviderExampleHandbook::GetClass())
iferr_return;
}
{
_class = NodeRendererNodeSystemClassImpl::GetClass().Create()
iferr_return;
spaceData.Set(maxon::nodes::NODESPACE::NODESYSTEMCLASS, _class)
iferr_return;
spaceData.Set(maxon::nodes::NODESPACE::MATERIALENDNODEIDS, std::move(materialEndNodeIds))
iferr_return;
spaceData.Set(maxon::nodes::NODESPACE::RENDERERS, std::move(supportedRenderers))
iferr_return;
spaceData.Set(maxon::nodes::NODESPACE::MATERIALPREVIEWIDS, std::move(materialPreviewNodes))
iferr_return;
materialExchangeBundleIds.
Append(maxon::NODESPACE::EXCHANGE::BUNDLE::VIEWPORTMATERIAL::GetId())
iferr_return;
spaceData.Set(maxon::nodes::NODESPACE::MATERIALEXCHANGEBUNDLEIDS, std::move(materialExchangeBundleIds))
iferr_return;
spaceData.Set(maxon::nodes::NODESPACE::MATERIALEXCHANGECLASS, NodeRendererViewPortMaterialHandbookImpl::GetClass())
iferr_return;
}
static maxon::Id g_nodeRendererDatabaseID =
maxon::Id(
"net.maxonexample.handbook.nodes.registereddatabase");
{
{
err.CritStop();
return err;
};
const maxon::Url& binaryUrl = maxon::g_maxon.GetUrl();
const maxon::Id spaceDescriptionId =
maxon::Id(
"net.maxonexample.handbook.nodespace.node_renderer");
maxon::nodes::NodeSpaceRef nodeRendererSpace = NodeRendererNodeSpaceImpl::CreateInit(nodeRendererData)
iferr_return;
g_exampleNodeSpace = maxon::nodes::MaterialNodeSpaces::Register(NodeRendererNodeSpaceImpl::GetDescriptor().GetId(), nodeRendererSpace)
iferr_return;
}
static void FreeResources()
{
{
err.CritStop();
return;
};
g_nodeSystemClass = nullptr;
}
static MAXON_METHOD const AssetRepositoryRef & GetBuiltinRepository()
MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< T > Append(ARG &&x)
Definition: basearray.h:677
static MAXON_METHOD Result< void > RegisterDatabaseWithUrl(const Id &databaseId, const Url &url, const CString &version=CString::NullValue())
static MAXON_METHOD Result< void > UnregisterDatabase(const Id &databaseId)
Definition: delegate.h:240
Definition: genericdata.h:20
Definition: apibaseid.h:253
static MAXON_METHOD Result< DataDictionary > LoadDescription(const Id &spaceDescriptionId)
static MAXON_METHOD Result< NodeTemplate > CreateLazyTemplate(const Id &nodeId, Delegate< Result< NodeTemplate >()> &&creator, Delegate< Result< Bool >(const NodeSystemClass &cls)> &&support={})
static MAXON_METHOD Result< DescriptionProcessor > CreateNodeDescriptionProcessor(Delegate< Result< NodeTemplate >(const Id &descriptionId, const DataDescription &dataDescription)> &&delegate)
static MAXON_METHOD Result< NodeTemplate > LoadTemplate(const AssetRepositoryRef &repo, const Id &assetId)
static MAXON_METHOD Result< NodeSystemBasedNodeTemplate > BuildNodeFromDescription(const Id &id, const NodeSystemClass &nodeClass, Bool addDependencies=true, const Delegate< Result< void >(const MutableRoot &root, const TemplateArguments &args)> &finalizer={})
OK
Ok.
Definition: ge_prepass.h:0
return OK
Definition: apibase.h:2690
Col4< Float, 1 > ColorA
Definition: vector4d.h:60
#define MAXON_DECLARATION_REGISTER(...)
Definition: module.h:933
#define MAXON_INITIALIZATION(...)
Definition: module.h:795
Definition: animation_attributes.h:10
#define iferr_scope
Definition: resultbase.h:1384