About
An implementation of maxon::nodes::NodeSpaceInterface allows to define and customize a node space. This node space defines how the node material will behave, e.g., defining the preview image generation, viewport representation, etc.
An implementation of maxon::nodes::NodeSpaceInterface references further implementations of these interfaces:
Description
The resource data type describing the node space must have the attribute "net.maxon.nodespace.base". The name of the node space is defined with "net.maxon.object.base.name".
Implementation
An implementation must define the Init() method:
Further methods are:
Within the Init() method, the properties of the node space are configured and stored in the given maxon::DataDictionary.
Further components are registered with:
See maxon::nodes::NODESPACE.
- Note
- The maxon::nodes::NodeSystemClass instance is stored as a member variable of the implementation class.
The creation of the default node setup is defined in a function:
- maxon::nodes::NODESPACE::CREATEMATERIALGRAPHFUNC: Callback to a function creating the default node graph.
Material (end) nodes are registered with:
- maxon::nodes::NODESPACE::MATERIALENDNODEIDS: List with the IDs of this material's end nodes.
Certain nodes may require different preview scenes:
- maxon::nodes::NODESPACE::MATERIALPREVIEWIDS: List of nodes that require a right-click menu for scene choices. The selected scene type is then stored as PREVIEWIMAGEREQUEST::SCENETYPE (see maxon::nodes::PRVIEW::SCENETYPE).
The Ids of the renderers, supported by this node space, are defined in a BaseArray stored at:
- maxon::nodes::NODESPACE::RENDERERS: List of all supported renderers.
A special texture node can be registered. This texture node will automatically be created when a texture is dropped onto the Node Editor window.
- maxon::nodes::NODESPACE::IMAGENODEASSETID: Defines the ID of an image node.
- maxon::nodes::NODESPACE::IMAGENODEPORTIDS: Defines the ports of the image node.
Further settings are:
- maxon::nodes::NODESPACE::SPACEID: The node space ID.
- maxon::nodes::NODESPACE::SPACENAME: the node space name.
class ExampleNodeSpaceImpl :
public maxon::Component<ExampleNodeSpaceImpl, maxon::nodes::NodeSpaceInterface>
{
public:
{
}
static
maxon::Result<
void> ConfigurePreviewImageRequest(
maxon::DataDictionaryObjectRef request)
{
request.Set(maxon::nodes::PREVIEWIMAGEREQUEST::PROVIDER, ExampleImageProviderImpl::GetClass())
iferr_return;
}
{
_class = ExampleNodeSystemClassImpl::GetClass().Create()
iferr_return;
spaceData.Set(maxon::nodes::NODESPACE::MATERIALENDNODEIDS, std::move(materialEndNodeIds))
iferr_return;
spaceData.Set(maxon::nodes::NODESPACE::MATERIALPREVIEWIDS, std::move(materialPreviewNodeIds))
iferr_return;
spaceData.Set(maxon::nodes::NODESPACE::NODESYSTEMCLASS, _class)
iferr_return;
}
private:
maxon::nodes::NodeSystemClass _class;
};
static MAXON_METHOD const AssetRepositoryRef & GetBuiltinRepository()
MAXON_ATTRIBUTE_FORCE_INLINE ResultRef< T > Append(ARG &&x)
Appends a new element at the end of the array and constructs it using the forwarded value.
Definition: basearray.h:628
Definition: objectbase.h:2655
Definition: delegate.h:240
Definition: apibaseid.h:243
static MAXON_METHOD Result< NodeTemplate > LoadTemplate(const AssetRepositoryRef &repo, const Id &assetId)
@ OK
User has selected a font.
@ NORMAL
Normal Tag morphing.
return OK
Definition: apibase.h:2735
#define MAXON_COMPONENT(KIND,...)
Definition: objectbase.h:2212
#define MAXON_METHOD
Definition: interfacebase.h:1012
#define MAXON_COMPONENT_OBJECT_REGISTER(C,...)
Definition: objectbase.h:2473
The maxon namespace contains all declarations of the MAXON API.
Definition: autoweight.h:14
#define iferr_scope
Definition: resultbase.h:1389
#define iferr_return
Definition: resultbase.h:1524