Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

magneto

How to get world coordinates at the geometry level?

I have a Geometry object and a Null object. I want to get the world coordinate position of the Null object that will always be at the position of the Null no matter the transformation of the Geometry object.

Currently I use origin expression but I get the position that's offset by the transformation of the Geometry object.

Any ideas?

Thanks :)

Share this post


Link to post
Share on other sites

in a vopnetwork, use the `optransform("path to object")` it gives you a matrix, that you can use to multiply the pointpostion to get it in global space

another thing would be (easier) use a object merge SOP and merge in the point of the null, and set it to transform into this object

this gives you the point in global space

1 person likes this

Share this post


Link to post
Share on other sites

Thanks sanostol. Do you mean using optransform in VEX? How can I use it in VOPs since you said in a vopnetwork?

I was gonna try the Object Merge, but it can be any object, i.e. very high res mesh, so that's why I didn't want to merge it just for this.

Share this post


Link to post
Share on other sites

You'll need to multiply by the transform of the null and the invert transform of your geometry object. It's definitely easy enough to do in Python so that might be a better bet. You can do this with 2 of the operators I posted in your other thread connected together.

1 person likes this

Share this post


Link to post
Share on other sites

Thanks Graham, in VEX/VOPs how would you get the transform matrix of an object? I looked at VOPs just to see but didn't see anything matrix related that has an object/operator path.

I will give your operator a try for this problem as well. origin expression also works, just had to figure out the path issue there :)

Share this post


Link to post
Share on other sites

The help has two listings for optransform, one is VEX and one is an expression. Occasionally you'll run into VEX functions that aren't mapped into VOPS, this appears to be one of them. You can just pop it into an inline code node to use it in VOPS.

opxform_vops.hip

4 people like this

Share this post


Link to post
Share on other sites

Thanks tjeeds, very helpful. I think that also happens when you go from VOPs into VEX, like there is no sign function in VEX.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now