Search - User list
Full Version: Geometry attributes inside TOPS
Root » PDG/TOPs » Geometry attributes inside TOPS
yanndrevon
Hi all,
I am working on a workflow to process a lot of assets, and push them inside a Database along with a lot of informations.

Latetly I have been working on a scene with around 500 kitbash assets. I did some cleaning, put everyone to the center of the scene, and finally added several attributes that would help me build the ID card of every assets inside the DataBase.
All attributes are on the primitives.



On the TOPS side part, I am using a ‘geometry import’ to get the geos from SOPS to process those.



So far so good, the geometry TOPS node create my 500 work items corresponding to my 500 assets thanks the class attribute I used as Piece Attribute.
I can also see that in my node info dialog that all my primitives attributes are there.



This is here were I am stuck, I can't seem to find a way to read any values from those primitives attributes.
For example for each work item/asset process inside TOPS I'd like to get the ‘tags’ attribute value to use it in a python script node.

I've tried to dive inside python methods to get to it but I didn't manage to find a solution.

I'd like to know if any of you ever came across that problem ?
What is the proper way to work with geometry attributes inside TOPS ?

Thanks for any help you can provide,
tpetrick
Your node has the “Create Work Item For” parameter set to “Piece Attribute Value”, which means that each work item represents a piece of geometry with multiple different points/prims in it. That geometry is stored in the file displayed in the work item attribute panel, so if you want to access the geometry directly from a Python Script TOP you'll need to load the file in your Python code. The work item doesn't contain the geometry itself, it's just a reference to some geometry with summary information about the contents of the geo.

Many TOP nodes run their tasks out of process (HDA Processor, all ROP Fetches, etc), either on the farm or as child processes of the Houdini session. One of the use cases for the Geometry Import is to cache data from a local SOP node so that it can be loaded by an out of process job on the farm.

If you're importing one primitive per work item, then the work item copies the attributes for that primitive to the item's attributes. If you're importing a potentially large chunk of geometry consisting of multiple primitives, the attributes for each individual primitive are not copied onto the work item. To do that the work item would need to have array attrib with a size matching the number of primitives, for each attribute being copied. That's possible to do and there's an existing RFE for it, but it's not yet implemented.
nausicaa
So how to load file into Python code in TOP
tpetrick
You can use the hou.Geometry API methods: https://www.sidefx.com/docs/houdini/hom/hou/Geometry.html [www.sidefx.com]

Construct an instance of that class and call the loadFromFile method to load the file into that geometry object.
nausicaa
thank you !look forward to your RFE.
yanndrevon
tpetrick
Your node has the “Create Work Item For” parameter set to “Piece Attribute Value”, which means that each work item represents a piece of geometry with multiple different points/prims in it. That geometry is stored in the file displayed in the work item attribute panel, so if you want to access the geometry directly from a Python Script TOP you'll need to load the file in your Python code. The work item doesn't contain the geometry itself, it's just a reference to some geometry with summary information about the contents of the geo.

Many TOP nodes run their tasks out of process (HDA Processor, all ROP Fetches, etc), either on the farm or as child processes of the Houdini session. One of the use cases for the Geometry Import is to cache data from a local SOP node so that it can be loaded by an out of process job on the farm.

If you're importing one primitive per work item, then the work item copies the attributes for that primitive to the item's attributes. If you're importing a potentially large chunk of geometry consisting of multiple primitives, the attributes for each individual primitive are not copied onto the work item. To do that the work item would need to have array attrib with a size matching the number of primitives, for each attribute being copied. That's possible to do and there's an existing RFE for it, but it's not yet implemented.

Thanks a lot for your answer.
You helped me understand a bit better how TOPS works.

I have been doing a workaround to achieve my goal.
IN SOPS I do another loop with all my assets in which I blast all but one primitive of each asset.
I then call this result into TOPS with a `geometry import` and all my geometry attributes are imported as work item attributes.
I finally do an attribute copy to transfert those attributes to my other geometry import containing all my assets.

Works fine, but it seems that my `tags` attribute is not going into TOPS. I can only suspect that is because it is an array…

What do you think ?

Thanks for your help

Yann
tpetrick
Is your tags attribute a string array? It looks like there's a bug with the geometry import and that attribute type – I'll get it fixed ASAP.
yanndrevon
tpetrick
Is your tags attribute a string array? It looks like there's a bug with the geometry import and that attribute type – I'll get it fixed ASAP.

Hi Taylor,
My tags attribute is a string array.
I did a work around, instead of a string array I put my tags in a single string seperated by a coma, In TOPS I did a split() in python to filter the string and get all the tags in an array.

But I be glad to know if you do a fix for that !

Thx

Yann
tpetrick
The issue with copying string arrays to work item attributes is fixed in today's daily build, so you should be able to import your tags attribute without needing the work around.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB