Accessing Attributes on 2nd Input Geo in a Att. Wrangle

   2302   3   0
User Avatar
Member
2 posts
Joined: Jan. 2019
Offline
Hi,

This feels like such a despicable noob question, but i'm wondering what's the easiest way to access attributes on 2nd Input Geo in a attribute wrangle.

So, let's use a simple example of a single point coming into the 2nd input of my attribute wrangle. With a grid of points in the first input.

If I was using a point cloud to search for points on that grid I would want to write:

int points = pcfind(0, "P", v@pos, @ptnum);

However, this doesn't give the desired outcome. The correct working line in this case would be to just explicitly state the point number (0 in the case of a single point):

However, if the geo is any more complicated, I wouldn't want to manually input point numbers.

Is there a better way to access the point numbers on incoming geometry. Say I wanted maybe access any point(s) that is in a certain group or that has a certain attribute value in that geo coming in the 2nd input. How would I properly reference all/any of the points on the incoming geo on the 2nd input. My understanding is that @ptnum is designated for just the geo in the first input ).

Thanks in advance for any advice/explanation anyone can provide.
User Avatar
Member
731 posts
Joined: Dec. 2006
Offline
// this grabs width from second input
f@origwidth = @opinput1_width;

// or...
f@origwidth = point(1,"width", 0);
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
User Avatar
Member
8592 posts
Joined: July 2007
Offline
jmadams2
Say I wanted maybe access any point(s) that is in a certain group...
expandpointgroup(1, ...)

jmadams2
...or that has a certain attribute value in that geo coming in the 2nd input.
findattribval(1, ...)
Edited by tamte - Feb. 1, 2022 15:28:19
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
2 posts
Joined: Jan. 2019
Offline
Thanks to you both for that help. That's exactly what I was looking for!
  • Quick Links