Community
Arnold General Rendering Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to retrieve polymesh information?

3 REPLIES 3
Reply
Message 1 of 4
carlosqg
313 Views, 3 Replies

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 REPLIES 3
Message 2 of 4
Stephen.Blair
in reply to: carlosqg

AiNodeGetPtr(instance_node, 'node')


// Stephen Blair
// Arnold Renderer Support
Message 3 of 4
carlosqg
in reply to: 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
Message 4 of 4

node is not a string

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


// Stephen Blair
// Arnold Renderer Support

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report