VEX-function dot(vector a, vector b) not working

   2520   4   0
User Avatar
Member
18 posts
Joined: Oct. 2017
Offline
Hello,

I'm getting a weird issue over here. In my point wrangle the first line works, the second doesn't.

vector axis = cross(@dir, @N); <- takes two vectors, works
float dot = dot(@dir, @N); <- takes two vectors, fails

Am I missing something horribly obvious?

- - - - - - - - - -

What I am trying to do:

Even though there is a “Bones from Curve”-Tool in the Shelf, it creates bones with a fixed length. What I want is a tool, that takes the points and creates for every point a bone - with proper length and rotation of course. To keep it procedural I want all the information needed in the points so that I can reference them with a point-expression in my bone-rig.

The file is attached. Houdini-Version: 17.0.416, thank you for your help.

Attachments:
ProceduralRig.hipnc (6.8 MB)
dot-error.jpg (642.9 KB)
Houdini_Info.txt (13.0 KB)

User Avatar
Member
899 posts
Joined: Feb. 2016
Offline
hi,
try v@dir

It's good practice to always specify the type of the attribute that you are referencing from the geo, when the attribute is not created in the same wrangle.
Houdini would assume it is a single float attr otherwise.
Edited by Andr - June 12, 2019 06:50:35
User Avatar
Member
899 posts
Joined: Feb. 2016
Offline
A better explanation on the topic has been given here by ndickson
https://www.sidefx.com/forum/topic/51174/#post-261146 [www.sidefx.com]


cheers
User Avatar
Member
18 posts
Joined: Oct. 2017
Offline
Thank you very much, now it works. It's just very confusing that you can explicitly set the dir-attribute in the “attribute create”-SOP as a vector but then have to type v@dir, while @N works without specifying that it is a vector…
User Avatar
Member
899 posts
Joined: Feb. 2016
Offline
OliverStock
Thank you very much, now it works. It's just very confusing that you can explicitly set the dir-attribute in the “attribute create”-SOP as a vector but then have to type v@dir, while @N works without specifying that it is a vector…


@N, @Cd, etc are a public/known attributes, so no need to do the formal presentations to mr. Houdini every time.
If you created a v@myVect in a wrangle, you can use @myVect afterwards in the same wrangle.

Have a look at the linked post if you want to go technical.


cheers
  • Quick Links