About
A NodeMaterial represents a material containing node system. It can contain a separate node system for each available node space.
Access
A node material is accessed by checking if a given material uses nodes. Then the material can be cast into NodeMaterial.
- BaseList2D::IsNodeBased(): Returns true if the object contains nodes.
 
  
 
  
  BaseMaterial* 
const material = 
doc->GetActiveMaterial();
 
  if (material == nullptr)
 
  
  if (material->IsNodeBased() == false)
 
  
  NodeMaterial* const nodeMaterial = static_cast<NodeMaterial*>(material);
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
 
const char * doc
Definition: pyerrors.h:226
 
  
Use
A node material can contain multiple node system; one system for each node space.
- NodeMaterial::HasSpace(): Returns true if the node space with the given ID was instantiated for the material.
 
- NodeMaterial::GetGraph(): Returns the node graph for the given node space ID.
 
  
 
  
 
 
  if (nodeMaterial->HasSpace(nodeSpaceID) == false)
 
  const maxon::nodes::NodesGraphModelRef& graph = nodeMaterial->GetGraph(nodeSpaceID) 
iferr_return;
 
Definition: apibaseid.h:243
 
maxon::Id GetActiveNodeSpaceId()
 
#define iferr_return
Definition: resultbase.h:1531
 
- NodeMaterial::GetMaterialNodePath(): Returns the node path to the material end node.
 
- NodeMaterial::GetSoloNodePath(): Returns the node path to the solo node.
 
  
  
 
 
  
  maxon::NodePath path;
  nodeMaterial->GetMaterialNodePath(nodeSpaceID, path) 
iferr_return;
 
 
  if (path.IsEmpty())
 
  
  const maxon::nodes::NodesGraphModelRef& graph = nodeMaterial->GetGraph(nodeSpaceID) 
iferr_return;
 
 
  
 
  
 
Definition: basearray.h:415
 
Result< Bool > GetChildren(const ValueReceiver< const GraphNode & > &callback, NODE_KIND mask=NODE_KIND::ALL_MASK) const
Definition: graph.h:1168
 
return OK
Definition: apibase.h:2740
 
@ INPUT
Input direction, i.e., an input port or an incoming connection.
 
 The node system does not store animation data. The animation data for a given node is stored in a BaseList2D object and its CTrack animation tracks.
- NodeMaterial::GetBaseListForNode(): Returns the corresponding BaseList2D element for the given maxon::NodePath.
 
- NodeMaterial::GetDescIDForNodePort(): Calculates the DescID for a given port.
 
  
 
  
  const BaseList2D* 
const baseList = nodeMaterial->GetBaseListForNode(nodeSpaceID, path) 
iferr_return;
 
  BaseList2D* const       listElementNonConst = const_cast<BaseList2D*>(baseList);
 
  
  {
    
    DescID paramterID;
    nodeMaterial->GetDescIDForNodePort(nodeSpaceID, 
node, port, paramterID) 
iferr_return;
 
 
    const CTrack* const track = listElementNonConst->FindCTrack(paramterID);
    if (track != nullptr)
    {
    }
  }
const char const char * name
Definition: abstract.h:195
 
Definition: string.h:1287
 
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:170
 
 Further functions are:
- NodeMaterial::GetTextureSearchPaths(): Gets the texture search paths.