anicg Posted February 12, 2022 Share Posted February 12, 2022 I attach the hip file where I have a simple grid but I need to divide using the area (e.g. area/12), I get an error "Local variable 'area' not found. " although I'm using a measure sop that creates an area attribute. Any idea? area_divide.hiplc Quote Link to comment Share on other sites More sharing options...
Atom Posted February 12, 2022 Share Posted February 12, 2022 (edited) Very few of the nodes, allow you to reference vex attributes inside the parameter fields. The @ prefix is a vex construct, but the parameter fields for each node executes hScript. You can still reference an attribute using an hScript function, like this. prim("../measure1",0,"area",0)/12 The function reaches into the measure1 sop and grabs the value of @area for primitive #0. You may see the immediate problem with this approach. What if you have multiple primitives with different areas? How do you know which primitive to chose the value from? Edited February 12, 2022 by Atom 1 Quote Link to comment Share on other sites More sharing options...
ParticleSkull Posted February 15, 2022 Share Posted February 15, 2022 You may see the immediate problem with this approach. What if you have multiple primitives with different areas? How do you know which primitive to chose the value from? Exactly! And in some situations it's a good idea to promote the area attribute to detail, using the Sum of all primitives area I can see you have only one poligon so you shouldn't worry about and just the 0 one I added the 2 exemplos to your file: area_divide.hiplc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.