Geometry attributes inside TOPS

   5032   9   2
User Avatar
Member
6 posts
Joined: July 2015
Offline
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,
Edited by yanndrevon - May 18, 2020 21:39:25

Attachments:
Annotation 2020-05-18 210436.png (52.6 KB)
Annotation 2020-05-18 210837.png (85.4 KB)
Annotation 2020-05-18 211231.png (43.0 KB)

Cheers,

Yann

User Avatar
Staff
585 posts
Joined: May 2014
Offline
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.
Edited by tpetrick - May 19, 2020 01:55:15
User Avatar
Member
6 posts
Joined: June 2019
Offline
So how to load file into Python code in TOP
User Avatar
Staff
585 posts
Joined: May 2014
Offline
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.
Edited by tpetrick - May 20, 2020 14:09:12
User Avatar
Member
6 posts
Joined: June 2019
Offline
thank you !look forward to your RFE.
User Avatar
Member
6 posts
Joined: July 2015
Offline
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
Cheers,

Yann

User Avatar
Staff
585 posts
Joined: May 2014
Offline
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.
User Avatar
Member
6 posts
Joined: July 2015
Offline
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
Cheers,

Yann

User Avatar
Staff
585 posts
Joined: May 2014
Offline
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.
Edited by tpetrick - May 28, 2020 18:22:42
User Avatar
Member
385 posts
Joined: July 2018
Offline
i am trying to bake textures from bake texture rop using TOPs but i want the resolution to be based on a primitive attribute and the output name on the name attribute.
So bake textures rop differentiates between udims but i haven't found a way to make each bake different based on primitive attributes.

How can i solve this?

Attachments:
untitled.hip (2.0 MB)

  • Quick Links