Read attribute in AttribWrangle detail mode

   1930   1   1
User Avatar
Member
63 posts
Joined: Jan. 2008
Offline
Hello. I need you advice about AttribWrangle

I have the simple code:

setpointattrib(geoself(),“P”,0,{10,10,10},“set”);

So now I would like to get the attribute value from the current modified geometry.

How to do that?
Note again: We are in “Run over: detail”

I couldn't find any methods to get current attribute value trough geoself() identifier.

Please, help
Thank you
User Avatar
Member
1743 posts
Joined: March 2012
Offline
It's actually unsupported by design. I suppose that in the case of running over the detail, there's no multi-threading, so there isn't an issue of conflicting results depending on timing, but VEX may or may not have actually written to the attribute before reading, (many modifications are queued and made together at the end of the execution), and it may read from a cached version that's better suited to VEX operating on it. There could be a special case added for the single-threaded detail case, but it's currently optimized for the multi-threaded, vectorized cases of points, vertices, or primitives.

In many cases, the limitation of not being able to read attributes that have been “written” is okay, because you can do something like:

vector Pvalue = {10,10,10};
setpointattrib(geoself(),“P”,0,Pvalue,“set”);
vector Q = Pvalue + {5,5,5};

but in cases where you're doing non-trivial data modifications and you want to read those modifications again, you'll need to use a separate AttribWrangle node.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
  • Quick Links