Find FBX file geometry objects names

   3664   2   1
User Avatar
Member
17 posts
Joined: Nov. 2017
Offline
Hi !

I have a geometry file SOP node that I am changing using a parameter in my digital asset.
And I am stuck here: I don't know how to find the names of the geometry objects inside the FBX file.

And I need those names to set the proper Geometry File, that needs to be like this:
HIP/path/myfbx.FBX#MyGeometryObjectName,convertoff

Any tip on how to parse this FBX file to find the geometry objects it contains ?

Thank you very much !
User Avatar
Member
2625 posts
Joined: June 2008
Offline
The first thing that comes to mind would be to review the Blender python FBX importer. I don't think SideFX offers any open code on their FBX import process.
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
1 posts
Joined: Feb. 2017
Offline
Heya there !
This might be a bit late, but here goes :
You can try importing everything with your file sop. You're supposed to have a name attribute on the primitives. You can then parse over that with this
int primCount = detailintrinsic(0, "primitivecount");

string nameList[];

// Initialize the list with at least one item
string currName = prim(0, "name", 0);
append(nameList, currName);

// Run over all the primitive but the first one
for(int i=1; i<primCount; i++)
{
    // Grab the name attribute
    currName = prim(0, "name", i);
    
    // Run over the name list to see if the currentName is present
    int found = 0;
    for(int j=0; j<len(nameList); j++)
    {
        if(currName == nameList[j])
            found++;
    }
    if(found == 0) // If not, add it
        append(nameList, currName);
}

printf("%d ", nameList);
This needs to be in an attribute wrangle set to run over Detail, right after the file node.

Cheers !
  • Quick Links