Geometry attributes inside TOPS
6019 10 3- yanndrevon
- Member
- 6 posts
- Joined: 7月 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,
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 - 2020年5月18日 21:39:25
Cheers,
Yann
Yann
- tpetrick
- スタッフ
- 600 posts
- Joined: 5月 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.
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 - 2020年5月19日 01:55:15
- nausicaa
- Member
- 6 posts
- Joined: 6月 2019
- Offline
- tpetrick
- スタッフ
- 600 posts
- Joined: 5月 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.
Construct an instance of that class and call the loadFromFile method to load the file into that geometry object.
Edited by tpetrick - 2020年5月20日 14:09:12
- nausicaa
- Member
- 6 posts
- Joined: 6月 2019
- Offline
- yanndrevon
- Member
- 6 posts
- Joined: 7月 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
Yann
- tpetrick
- スタッフ
- 600 posts
- Joined: 5月 2014
- Offline
- yanndrevon
- Member
- 6 posts
- Joined: 7月 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
Yann
- tpetrick
- スタッフ
- 600 posts
- Joined: 5月 2014
- Offline
- papsphilip
- Member
- 385 posts
- Joined: 7月 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?
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?
- HristoVelev
- Member
- 82 posts
- Joined: 11月 2017
- Offline
-
- Quick Links