What is the point of the geohandle on setpointattrib

   284   2   0
User Avatar
Member
129 posts
Joined: 9月 2021
Offline
Hi!

Reading the documentation [www.sidefx.com] for the setpointattribfunction, we see that the first input in its signature is geohandle:

int  setpointattrib(int geohandle, string name, int point_num, <type>value, string mode="set")

I'm confused though. Why would setting it to anything other 0 be useful? I don't see how those values could be retrieved, because the output of the wrangle only comes from geohandle 0, right?

Maybe I'm missing something, but a friend just asked me this question and it made me think a bit, haha.

Thanks!
Anson
Edited by AnsonSavage - 2024年3月22日 11:30:49
User Avatar
Member
129 posts
Joined: 9月 2021
Offline
Ah, I think I found the answer. From the documentation:

"A handle to the geometry to write to. Currently the only valid value is 0 or geoself, which means the current geometry in a node. (This argument may be used in the future to allow writing to other geometries.)"
User Avatar
Member
8555 posts
Joined: 7月 2007
Offline
AnsonSavage
I'm confused though. Why would setting it to anything other 0 be useful? I don't see how those values could be retrieved, because the output of the wrangle only comes from geohandle 0, right?

it feels natural that the functions that write to the geo would support writing to a specifically provided geo rather than assuming a hardcoded one based on context they run in
the fact that when such CVEX shader is used in geometry context in a wrangle it is currently only valid for 1st output should be irrelevant

in the ideal world you should be able to write to any geometry in the memory, so I consider having a gemetry handle a great implementation, that may be ahead of time, but definitely aligns with generic language that VEX or CVEX shaders are rather than adhering to current limitations of Wrangles in SOP since even those may one day gain ability to create a geo in place and send it 2nd+ output or write separate geo in memory and save to disk etc...

EDIT: exactly as you additionally found:
AnsonSavage
Ah, I think I found the answer...
Edited by tamte - 2024年3月22日 11:44:30
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links