About
A core node is a basic node of Cinema 4D's node material system. It represents a basic functionality that can be used in a node material.
The relevant interfaces needed to implement custom core nodes are found in the corenodes.framework.
Implementation
A simple custom core node is implemented as follows:
class MaximumComponentCoreNode
{
public:
{
public:
{
ports.result.Update(resultColor);
}
};
{
return group.AddChild<Impl>();
}
};
Definition: micronodes.h:208
#define MAXON_CORENODE_REGISTER_PURE(CLS, id,...)
Definition: corenodes.h:1034
PyObject PyObject * result
Definition: abstract.h:43
#define MAXON_ATTRIBUTE_FORCE_INLINE
Definition: apibase.h:115
return OK
Definition: apibase.h:2735
constexpr MAXON_ATTRIBUTE_FORCE_INLINE X Max(X a, X b)
Calculates the maximum of two values and return it.
Definition: apibasemath.h:349
#define MAXON_PORT_OUTPUT(T, name,...)
Definition: micronodes_ports.h:223
#define MAXON_PORT_INPUT(T, name,...)
Definition: micronodes_ports.h:61
This namespace contains the API of the nodes framework.
Definition: corenodes.h:10
#define iferr_scope
Definition: resultbase.h:1389
A color consisting of three components R, G, B and an alpha.
Definition: col4.h:16
Description
The description of the core node must be created with the Resource Editor.The new data type must have the ID of the core node.
The data type properties are:
- Classification: "node"
- Description Processor: "CoreNodeDescriptionProcessor"
- Processor Parameters: The core node ID.
- Menu Category: Select a category for the node.
The core node needs a new attribute:
- Command: "include"
- Identifier: "net.maxon.node.base"
- Include: "net.maxon.node.base"
The name of the node is set with net.maxon.node.base.
Port descriptions are created with new attributes:
- Command: "attribute"
- Identifier: the port ID
- Datatype: The port data type
- Classification: "input" or "output"
- Gui Type Id: The proper UI for that data type
- Group Id: The proper group, either "net.maxon.node.base.group.inputs" or "net.maxon.node.base.group.outputs"
- String: The name displayed in the UI.
Description Handling
The description of the core node must be loaded and handled properly:
{
{
err.CritStop();
return err;
};
}
static void HandleFreeModule()
{
g_coreNodeDescriptions.
Reset();
}
static MAXON_FUNCTION Result< Url > GetUrl(APPLICATION_URLTYPE urlType, const Char *maxonModuleID=MAXON_MODULE_ID)
Definition: application.h:173
Definition: basearray.h:415
void Reset()
Deletes all elements (calls destructors and frees memory).
Definition: basearray.h:553
static MAXON_METHOD Result< void > RegisterDatabaseWithUrl(const Id &databaseId, const Url &url, const CString &version=CString::DefaultValue())
Definition: apibaseid.h:243
#define MAXON_INITIALIZATION(...)
Definition: module.h:875
@ CURRENT_MODULE_RESOURCE_DIR
Resource directory of the module that invoked this call.
#define iferr_scope_handler
Definition: resultbase.h:1407
#define iferr_return
Definition: resultbase.h:1524
This is an extended version of the typical procedure to load MAXON API descriptions. See Loading Data Descriptions.
Further Reading