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

How to retrieve polymesh information?

3 ANTWORTEN 3
Antworten
Nachricht 1 von 4
carlosqg
455 Aufrufe, 3 Antworten

How to retrieve polymesh information?

I'm creating a shader using Arnold SDK, I have instances of a polymesh in a scene and I need to access some polymesh properties through the code.

I've been digging in the API looking for a way to retrieve the polymesh node given the the ginstance pointer, but I haven't been able to get it done.

Some things I have tried:

auto parent = AiNodeGetParent(sg->Op); if (parent != nullptr) {...} //it always returns null

auto it = AiUniverseGetNodeEntryIterator(AI_NODE_ALL);

while (!AiNodeEntryIteratorFinished(it)) {...} //doesn't seem to be in there

Update: more background.

This seems to return the polymesh as a NodeEntry:

auto nodeEntry = AiNodeGetNodeEntry(sg->Op);
const char * entryName = AiNodeEntryGetName(nodeEntry);

But I see parameters inside the polymesh in the .ass file I can't find here. I have looped through the params and metadata using the given iterators without any luck:

auto paramIt = AiNodeEntryGetParamIterator(nodeEntry);

while(!AiParamIteratorFinished(paramIt))
{
auto paramEntry = AiParamIteratorGetNext(paramIt); 
auto paramname = AiParamGetName(paramEntry);
printf("%s", paramname);
}
AiParamIteratorDestroy(paramIt);
auto metadataIt = AiNodeEntryGetMetaDataIterator(nodeEntry);

while(!AiMetaDataIteratorFinished(metadataIt))
{
auto metadataEntry = AiMetaDataIteratorGetNext(metadataIt);
printf("%s", metadataEntry->name);
}
AiMetaDataIteratorDestroy(metadataIt);

I guess if it is shown in the ass file should be somewhere...

Carlos Quintero
iToo Software
3 ANTWORTEN 3
Nachricht 2 von 4
Stephen.Blair
als Antwort auf: carlosqg

AiNodeGetPtr(instance_node, 'node')


// Stephen Blair
// Arnold Renderer Support
Nachricht 3 von 4
carlosqg
als Antwort auf: Stephen.Blair

This is returning null:

AiNodeGetPtr(sg->Op, "node");

I'm using MaxToA, and according to the ass file "node" is a string, but this is returning null as well

AiNodeGetStr(sg->Op, "node");

ginstance {

...

node "/iTooArnold_Mesh_000001E28ABACF90"

...

Carlos Quintero
iToo Software
Nachricht 4 von 4
Stephen.Blair
als Antwort auf: Stephen.Blair

node is not a string

bin\kick -info ginstance.node
node: ginstance
param: node
type: NODE
default: (null)


// 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