Using AiASSLoad function cannot read all node in ass file

Using AiASSLoad function cannot read all node in ass file

1804415315
Observer Observer
480 Views
2 Replies
Message 1 of 3

Using AiASSLoad function cannot read all node in ass file

1804415315
Observer
Observer

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?

0 Likes
481 Views
2 Replies
Replies (2)
Message 2 of 3

Stephen.Blair
Community Manager
Community Manager

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
0 Likes
Message 3 of 3

1804415315
Observer
Observer

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

0 Likes