nuclear_polygon
Dec. 7, 2020 22:53:52
I'm trying to access SOP data from TOP network. Hscript Parameter expression brings the value to AttribCreate TOP parameter, but work item value is zero(see attachment)
Houdini 18.5.351
tpetrick
Dec. 7, 2020 23:13:23
The only way to safely access SOP data from TOPs is to use a geometry import TOP node. You can use it to import points, prims or geometry, and select which attributes to copy onto work items.
nuclear_polygon
Dec. 8, 2020 01:02:14
Hmm… yep, it imports attributes. but how can I access them values?
nuclear_polygon
Dec. 8, 2020 01:03:59
or even not the attribs itself but only the list of their names?
tpetrick
Dec. 8, 2020 22:03:39
In your screenshot, you've configured the node to create a work item for the “specified group”. That means you get one work item for that group – it will list the attributes from elements in the group and the size, but it does not import the individual elements. If you want to import the attributes you'll need to either import “each element in the specified” group“ or ”each element".
tpetrick
Dec. 8, 2020 22:06:25
In order to use the attributes downsteam, you can access them in expressions using the work item @attribute accessor or of the pdgattrib(..) function. If you want to get all of the values of an array attribute, you can use pdgattribvals(“primitiveattribs”) in an HScript expression on a downstream node. Both the @ operator and pdg* functions are evaluated for each input work item.
nuclear_polygon
Jan. 12, 2021 01:06:38
Thanx a lot! This is very helpful reply. This thing is kind of hard to get clear without some guidance