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

Using AiASSLoad function cannot read all node in ass file

2 REPLIES 2
Reply
Message 1 of 3
1804415315
195 Views, 2 Replies

Using AiASSLoad function cannot read all node in ass file

I try to use the AiASSLoad function to read to local ass file,first i create a independent atuniverse to load ass file because using default atuniverse will dirty Arnold rendering,but i found whatever i iterate the node point using the AiUniverseGetNodeIterator() fnuction,i always only get the root and option node,the rest node like polymesh and light are disappeard.So i try to use the default universe to load the ass file,and it show the rest of the node.If i want to use another universe to only load the ass file and destroy it when i finish read it,what operate should i prepare or is that my step right?

Tags (3)
Labels (3)
2 REPLIES 2
Message 2 of 3
Stephen.Blair
in reply to: 1804415315

Please post some code (Python?) to show what you are doing.

What do you want to do with these nodes? Are you running this code in an application like Maya?



// Stephen Blair
// Arnold Renderer Support
Message 3 of 3
1804415315
in reply to: 1804415315

Sorry It`s my fault.

AtUniverse* localUniverse = AiUniverse();
if(AiASSLoad(localUniverse,filePathToAssFile, AI_NODE_SHAPE) != -1)
{
  AtNodeIterator * iter = AiUniverseGetNodeIterator(localUniverse,AI_NODE_SHAPE);
  while(!AiNodeIteratorFinished(iter))
  {
    AtNode * node = AiNodeIteratorGetNext(iter);
    if(!node)
      continue;

    const char* nodeName = AiNodeGetName(node);
    if (!strcmp(nodeName, "root"))
        continue;

    // If this is a polymesh
    // Currently assuming matrix are all identity and all transformation are recorded in vertex position
    uint32_t numElem = AiArrayGetNumElements(AiNodeGetArray(node, AtString("vlist")));
    std::vector<AtVector> points;
    if(numElem)
    {

I forgot to add localUniverse point parameter to the AiUniverseGetNodeIterator function,so i always get the default Universe node info

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

Post to forums  

Autodesk Design & Make Report