point expression for vectors in pop wrangle

   3721   2   0
User Avatar
Member
20 posts
Joined: Nov. 2013
Offline
hi!

I'm trying to pull position information from my sop geometry into my pop sim to create some effects as my particles approach their individual goal positions.

I was having some success using this expression:

@test = point(@OpInput1, “P”, @ptnum)

with the @OpInput1 set to the sop geo I wanted. When I check the geometry spreadsheet I see that my attribute “@test” is set to a float by default. Upon some further testing the float seems to exactly equal the z value of the position info that I want to use.

How do I pull in the x and y values of the vector, or just correctly pull in all three “P” vector values?

Thanks for the help!
User Avatar
Staff
6169 posts
Joined: July 2005
Offline
VEX overloads functions by return type. There are many point() functions that return float, vector2, vector, etc. Which one is called is determined by what fits best the return value.

@test will create a float by default as test isn't on the short-list of attributes of known types.

To force @test to be a vector, you can proto-type it with:

vector @test;

Or use the v prefix:

v@test = point(…);

When test is a vector, the vector version of point will be called, and you will get the x/y/z values.
User Avatar
Member
20 posts
Joined: Nov. 2013
Offline
Well that was simple. Thanks for the help – works perfectly.
  • Quick Links