Jump to content

VOP Get Input Objects Position


Recommended Posts

Hey guys,

 

I have a VOP SOP, and I am trying to use it to calculate the angle between two vectors, and if the angle is too great I delete the point. I got the math and everything working, but what I am having trouble with is getting the position data from an object into the VOP. I am object merging the null into the Geometry SOP and that is then plugged into the 2nd (1st index) input. In the VOP I would like to take that null's position in space and calculate the vector from each point to the nulls position. If I create a vector constant INSIDE the VOP and hard code in the null's position the setup works beautifully and deletes the points I want. Once I try to use either Import Attrib or Get Attrib (using opinputpath) to get the null's position on the fly the setup fails. I would really like to be able to move the null around and have the VOP update magically. Thanks

 

 

Matt Pearson

Link to comment
Share on other sites

I see where youre going with this... But I don't know enough about this node yet.

 

So if optransform returns a matrix do I need to bind it to a variable?

matrix m = `optransform("../../null1")`;

How do I get the matrix out of this node and into the rest of my VOP network?

 

Is there really no other node that can import a position from a VOP input?

 

Thanks

Link to comment
Share on other sites

If you don't know about this node, the easiest thing to do would be to just output the matrix and then break it up using the Matrix to Vector VOP.

 

Set an output variable in the Inline Code VOP:

 

WTSJ4ru.png

 

Then assign the return value of optransform using:

$mat = optransform()

Unfortunately SESI didn't add a VOP for this if I am not wrong. It's a hit or miss whether something exist in VEX or VOPs.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...