multiply vector in VEX, houdini 16.5.432

   6227   2   1
User Avatar
Member
143 posts
Joined: Sept. 2017
Offline
Hi, I'm having a bit of trouble inverting a vector, namely the tangentu attribute created by a polyframe SOP using a wrangle node.
When I create “temp” attribute, using the piece of code:

v@temp = @tangentu * -1;

I'd expect to see 3 new lines next to the “tangentu” ones, that, if tangentu is (x, y, z), would read (-x, -y, -z), but instead, what I get is (-x, -x, -x). it's the same with the code:

v@temp = @tangentu * {-1, -1, -1};

When trying to multiply each component separately, like this:

@tangentu.x *= -1;

I get an error, that says: “incorrect subscript for type: float.x”, which, if I understand correctly, tells me, that @tangentu was identified as a float instead of a vector? Both the info tab of the previous SOP and the Geo Spreadsheet both say, tangentu is a vector.

I'm currently running Houdini version 16.5.432 and am too lazy to install another build ATM, so I'd appreciate, if anyone could point out my error or confirm a possible bug, before I bother support with it.

Steps to recreate:
  1. create random curve
  2. add the default polyframe SOP
  3. add point wrangle with the line: @tangentu *= {-1, -1, -1}; , only the x component gets multiplied in my case, the same with @tangentu *= -1; , if I change the code to: @tangentu.x *= -1; I get the invalid notation of float.x error

thanks in advance.
Cheers,
Ivan
User Avatar
Member
9687 posts
Joined: July 2007
Offline
use v@tangentu instead a it is a vector

so something like
v@tangentu *= -1;
should work
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
143 posts
Joined: Sept. 2017
Offline
tamte
use v@tangentu instead a it is a vector

so something like
v@tangentu *= -1;
should work


Ah, thanks Tomas, you saved the day again. That was a silly mistake on my part.

Cheers,
Ivan
  • Quick Links