Community
Arnold General Rendering Forum
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Create Nodes within a Node

5 ANTWORTEN 5
GELÖST
Antworten
Nachricht 1 von 6
Anonymous
531 Aufrufe, 5 Antworten

Create Nodes within a Node

Hi all,

Say I wanted a custom Arnold node to also create some child nodes when it's made. (for instance, creating a geometry instance, material etc.)

Is this doable? Or is the only option for that DCC specific translators? If so, I notice MtoA's translator uses the naming convention CreateArnoldNodes, though has a return type of an AtNode *. Does is matter which one is returned? Is it safe from memory leaks so long as AddArnoldNode or AddExistingArnoldNode are called for/with each node created?

Cheers,

Alan.

Tags (2)
Beschriftungen (2)
5 ANTWORTEN 5
Nachricht 2 von 6
Stephen.Blair
als Antwort auf: Anonymous

You can do stuff like this in CreateArnoldNodes


   AddArnoldNode("mayaFluid", "shader");
   AddArnoldNode("MayaFluidData", "data");
   return AddArnoldNode("box")

With AddArnoldNode, the first argument is the node type. The second argument is an optional tag used to retrieve a given node later on during export

(with AtNode* node = GetArnoldNode(tag))


The last call to AddArnoldNode() doesn't have a tag because it's the "main" node, so just doing GetArnoldNode() during export will return this node. The "main" node is the node that should be returned by this AddArnoldNode()



// Stephen Blair
// Arnold Renderer Support
Nachricht 3 von 6
Anonymous
als Antwort auf: Stephen.Blair

Thanks very much, Stephen. Is anything equivalent possible inside node_initialize or node_update in the actual Arnold node, rather than the translator? (Main reason I'd prefer there if I can do it is because that would be DCC agnostic as opposed to needing implementation in every *toA)

Cheers,

Alan.

Nachricht 4 von 6
Stephen.Blair
als Antwort auf: Anonymous

Sure, you could use a custom procedural node to create all kinds of Arnold nodes.



// Stephen Blair
// Arnold Renderer Support
Nachricht 5 von 6
Anonymous
als Antwort auf: Stephen.Blair

Thanks, Stephen. I don't think that will serve my needs, as this is for a camera. So if I created a custom procedural, it wouldn't be able to be considered as a camera, right? (without just having the translator create it, in which case I'm back to needing to implement something per translator). Or have is there some magic I can do to use a procedural as a camera?

Cheers,

Alan.

Nachricht 6 von 6
Stephen.Blair
als Antwort auf: Anonymous

A procedural could create a camera, but the host application wouldn't know about that camera.

A camera shouldn't be creating nodes. I suppose you might get away with it, as long as you did it during scene initialization. But I'd be worried about node dependencies or links, a shader might not exist when try to assign it to a shape.



// Stephen Blair
// Arnold Renderer Support

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report