XaiJu
entagma
entagma

patreon


VEX 101 - Data Types & Accessing Attributes

EDIT: Aaand of course i forgot to attach the list of Houdini's built in attributes. Here it is.

We'll go over the basic data types we will be using when building VEX based setups. 

Also if you haven't heard of them yet - attributes allow you to attach arbitrary data to your geometry. A Point position is an attribute, as well as a point's number.

However you can also create custom attributes to drive your setup.

Or use special built-in attributes to control the functionality of some of Houdini's powerful nodes. Such as the Copy To Point SOP.

VEX 101 - Data Types & Accessing Attributes

Comments

Hi Hussain, check the rubber toy's position in regards to world space center. In this case, the rubber toy is slightly offset to +Y, that's why when scaling it up, you get the impression of the geometry being moved upwards. Cheers, Mo

Entagma

Thanks this is super helpful, makes life much easier! 1 small question based off what you did at the end, why did the ( f@pscale = i@ptnum; ) also move the rubbertoy position up, shouldn't it just scale up while starting from its original point on the grid?

Hussain Almossawi

Hi Ben, did you check you set up the rubber toy's transformations as we did? In our case it moves up as it doesn't sit at {0,0,0} and thus it's position in space gets scaled too. Cheers, Mo

Entagma

Hi guys, I'm really enjoying all of your tutorials. I have a question though when I update my f@pscale to equal i@ptnum. My rubber toy just duplicates 100 times in the same position whereas your rubber toy moves up. Am I doing something wrong?

Ben Weaver

Thanks for the popular attributes PDF; it's a really helpful quick reference!

Hans Palacios

Weird - does it work now? Cheers, Mo

Entagma

Hey, a bit late to the party. I can't access the Built In Attributes PDF, file not found. Is that still available somewhere? thanks

Adam Priester

Very well done. I love the hint you dropped about using a line of VEX to accomplish the work of an entire Houdini node. That's a big performance savings and helps clean up the network.

Draisey Digital

Amazingly explained, love the pace of this series so much, no wasted time!

EOB

Hi Sascha, when using Copy to Points, Houdini tries to find any info regarding how to orient your copies. When you feed a standard grid into the copy-to-point-SOP, Houdini tries to infer the copies' direction by looking for a normal. In this case it finds the grid's intrinsic vertex normals (highlight the grid & switch normal display on in your viewport to make them visible) and orients the rubber toy accordingly. When you use the add-SOP to delete everything but the points, Houdini can't find any normals (there are no intrinsic point normals in this case) and thus doesn't orient the rubber toy. Cheers, Mo

Entagma

Could you please explain me, why the orientation of the rubbertoy copies are influenced by the add node? I don`'t understand why the rubbertoys are rotating 90 degrees when I bypass the add node... Thank you!

Sash

thank you. this is such a great video. really helps explain vex coding in a simple manner for non-coders! :)

James Cowen

thank you so much !

LDtt

Hi Dope, for scaling (or translating, or orienting) the individual copies, the copy to points SOP onyl takes into account attributes of certain names that are written onto the template points - the points that are fed in through the SOP's right input. So there won't be any effect if you set a pscale attribute anywhere else. The position of the rubber toy changes as we scaled it down manually before feeding it into the copy to points sop and thus it's pivot is slightly offset in regard to its mesh, so when scaling the rubber toy it gets scaled with this offest pivot as center, thus it gets offset with increasing scale. More on all of this in upcoming tutorials. Cheers, Mo

Entagma

Hi guys, why the Attribute Wrangle not work when i connect left branch of copy sop or below ?And why position of copy rubbertoys changed?

LDtt

Seems like it's only a problem when defining pscale as ptnum that the copy to points sop kills it. Any other pscale attributes seem to pass through fine.

John Robson

Hey guys, for some reason I'm noticing that my custom pscale attribute is overwritten to 0 once it pipes into the copy sop, unless it's set to pack and instance. Curious if you've ever run into that.

John Robson

oooo, thanks for that pdf cheat sheet!

jeremy jozwik

Thanks for the quick reply - - my bad, I named wrongly my custom attribute 'Lookat', I wasn't looking for the point lookat at all. Thanks for the precision and the links, I'll check it out. Nice one!

Florian

Hi Florian, orient does not store a lookat point. It stores the rotation of an individual copy as a quaternion (<a href="http://www.chrobotics.com/library/understanding-quaternions)" rel="nofollow noopener" target="_blank">http://www.chrobotics.com/library/understanding-quaternions)</a>which is stored as a vec4 (vector with 4 components) which is abbreviated with p@yourname. The advantag of quaternions over euler angles is that you do not run into what's called "gimbal lock" which ususally manifests in flipping copies. For a bit more on this I can highly recommend Toad's blog on these topics: <a href="http://www.toadstorm.com/blog/?p=493" rel="nofollow noopener" target="_blank">http://www.toadstorm.com/blog/?p=493</a>

Entagma

Hi Moritz, one question came up as I was playing around with the Vex code to change to points of the grid orientation to get the rubber toy's copies to be randomized. I created an extra attribute (named 'Lookat¨') with a noise in a point vop to do so. Then in the wrangler I set the v¨@orient = v@Lookat;. This didn't work and after a quick look in the help I found out that I needed to get rid of the 'v' before the @orient or write p@orient instead. I've put that 'v' originally following your PDF. So my question is, where is that 'p' coming from and what does it refer to? thanks a lot! Cheerio

Florian

..This is the best way to explain the core of Houdini...Unparalleled!

Anna Tronci

When I ramble on about how/where to find those attrib names? There is definitely an edit but nope, there was nothing to add :) Is there anything that you think remains unclear? Cheers, Mo

Entagma

at 10:54 10:56 there is jump in the video not sure if this ok becouse i fell you are about to say something.

ata mutahar

D'oh! Of course I forgot to attach it. Should be there now. As an attachement to this post. Sorry. Also a float stays a float. What Houdini internally does when you assign an integer to a float (as in the pscale = ptnum example) is that it casts the integer to a float, thus automatically converting for example a ptnum of 1 to a float value of 1.0. Cheers, Mo

Entagma

Hello Moritz, Really liked it. So floats can be integers as pscale can be equal to ptnum. But it stays as a float "by essence". So your Attributes list is essential but i didn't find it, may you please telling me where to find it ? thanks Moritz, ++

arnaud giret


More Creators