VEX: what's the rule behide attribute interpolation?

   301   1   2
User Avatar
Member
447 posts
Joined: Aug. 2019
Offline
For example, let's say I create a square with Grid SOP.

I can access the P attribute with an Attribute Wrangler running over primitives:

printf("%g", vector(prim(0, "P", @primnum)));

However, the P attribute isn't on primitives. It's on points! Why is the above code working? And does it always work for every attribute other than P?
User Avatar
Member
333 posts
Joined: April 2018
Online
Primitives have a hidden, read-only P attribute too. The output you're seeing is the position of the prims, not the points. You can verify this by running it on a grid with a single prim.
  • Quick Links