# marvolo

Members

3

0 Neutral

• Rank
Peon

• Name
Tom Riddle
• Location
Toronto
1. ## VEX Vector Attribute Creation Type

Okay so there is some further confusion. Let's take this simple example. I have a single point at world origin (add sop), connected to a point wrangle: vector myNormal = normalize({0.25, 0, -1}); v@mydir = myNormal; setattribtypeinfo(0, "point", "mydir", "normal"); @N = myNormal; This appears to create two identical attributes, they are both 3-float normal attributes according to the node information pop up. They also both appear as [x, y, z] in the geometry spreadsheet. Now If I make another point wrangle down stream: @P += @N; I get the expected result. The point is translated in the expected direction a distance of 1 unit. However If I transform the point by the other attribute (mydir) instead: @P += @mydir; I get a completely different result. The point moves the right amount in the x-axis, but for some reason it moves in the opposite z-direction, and it also moves in the y-axis. And the overall distance is far less than 1. What am I missing here?? Maybe this is just my limited understanding of 3D math. Solution: I have to explicitly access the mydir attribute as v@. @P += v@mydir; I didn't realize this made a difference when accessing attributes through VEX. But I'm leaving the solution here for anyone else who gets stuck on this.
2. ## VEX Vector Attribute Creation Type

Cool, setattribtypeinfo is exactly what I needed. Not sure how I missed that with google and while looking through the vex function reference, but it works. Thanks!
3. ## VEX Vector Attribute Creation Type

Is it possible to create an arbitrarily-named transformation vector attribute through VEX? Let's say I do this in a point wrangle: v@test = {0.5, 1, -0.2}; From what I understand the resulting attribute is what's called an arbitrary vector (indexed by 0, 1, 2). How can I have this created as a transformation vector (indexed by x, y, z)? It seems all of the automatically-cast attributes are created as transformation vectors (@P, @accel, @center, @dPdx, @dPdy, @dPdz, @Cd, @N, @scale, @force, @rest, @torque, @up, @uv, @v), but I need to name the attribute something else. Interestingly, if I create the same attribute with an Attribute Create SOP, with type set to vector, the resulting attribute is a transformation vector (x, y, z). However, I cannot seem to create an arbitrary vector through Attribute Create. What I'm currently doing is first creating the attribute with an Attribute Create SOP, and then modifying it with the point wrangle. But there must be a way to do it without the wrangle? This seems like such a common question, but I've searched all over and looked through many of the vex functions that I thought may be relevant and I can't seem to find anything. Maybe I'm just using the wrong terms.
×
• Donations