Jump to content

How to multiply vectors with the transform of another node in expressi


Recommended Posts

I don't know if expressions are the proper way to do this, but basically I have an operator path at the asset level where I want to transform my points in this object by the transform of another object.

Something like this (inside subnet):

Point SOP:

TX = ...
{
    matrix m = optransform("/obj/box1");
    vector v = vector3($TX, $TY, $TZ);
    return (m * v)[0];
}

When I do this, it seems to return everything as 0.

Is this the right way? Should I use python for this, or VEX? If VEX, how would one acquire the transform of another node inside VEX/VOPs?

Edited by magneto
Link to comment
Share on other sites

Thanks Graham, that's exactly what I was looking for. Out of curiosity, do you know if it's possible to do the same in hscript and VEX?

Also do you think this can be done as an inline Python? I will give it a try, because in my case, I don't have to extract the matrix beforehand, just use it as a whole so should be shorter to type inside the field.

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...