Get attributes from second input in wrangle node

   29251   6   1
User Avatar
Member
8 posts
Joined: June 2017
Offline
How can I get attributes like “numpt” from input 2 in a wrangle?
Edited by iamchris - Feb. 14, 2018 15:55:30
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
If you want to get an attribute (lets say color) from a specific point number (lets say 123456) from input 2, you can use
@Cd = point(1, 'Cd', 123456);
If you have the same number of points on both inputs and you want to get an attribute from the corresponding point on input 2 you can use this shortcut
@Cd = v@opinput1_Cd;
Where the number 1 describes the input port.

-b
http://www.racecar.no [www.racecar.no]
User Avatar
Member
8 posts
Joined: June 2017
Offline
How can I get the “numpt” attribute from input2?

“i@opinput1_numpt” is not working for me.
Edited by iamchris - Feb. 14, 2018 15:56:48
User Avatar
Member
459 posts
Joined: Oct. 2011
Offline
Ah, you want the number of points on input 1?
@number_of_points_on_input_1 = npoints(1)
http://www.racecar.no [www.racecar.no]
User Avatar
Member
190 posts
Joined: Dec. 2016
Offline
i@group_test= i@group_grass + point(1,"group_grass",@ptnum) ;

doesnt seem to work for me to add the group from the second input.
User Avatar
Member
417 posts
Joined: Feb. 2012
Offline
that would be

i@group_test = i@opinput1_group_grass;
User Avatar
Member
8508 posts
Joined: July 2007
Online
alternatively also this, especially if you don't necessarily test for current point on second input:
i@group_test= i@group_grass || inpointgroup(1, "grass", @ptnum);
Edited by tamte - Dec. 15, 2022 20:13:34
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links