measure bounding box for each piece of geo //and get min and max value in Y axis Copy the code below into VEXpression field and hit Alt+Enter to apply it. To create ramp attribute for each connected piece we are going to write some VEX code inside Attribute Wrangle node.ĭrop down Attribute Wrangle node and place it inside the loop. The loop by default creates primitive integer attribute named class from 3D connected pices. To make an object space ramp attribute (position) for each individual piece of the geometry, drop down node loop For Each Connected Piece and connect it to the geometry. Make sure you are visualising attribute class which is primitive and since the values are integer (0,1,2… – depending on how many pieces are in the geo) the best way to visualise it is to select Color Type – Random from Attribute. Visualise the attribute by dropping down the visualise node. The Connectivity node creates primitive integer attribute named class from 3D connected pices. In the obj level drop down node Connectivity connect it to the geometry. To be able to process each piece of the input geometry individually we are going to use For Each Loops which allows us to run the same chain of nodes multiple times. Attributes based on primitive connectivityįollowing examples will demonstrate how to create attributes for each element based on primitive connectivity – in our case derived from 3D connected pieces, uvs or groups. Video tutorial series part 03 below is focused on procedural texturing of feather and demonstrates some features described in this article.Ĭheck my Handles Pixels album on Vimeo to watch all parts as I am going to be uploading them during following days. ![]() For texturing For example I find especially useful to target position and orientation of the object or it’s parts in the space, target the centre point, define some directional gradients, or generate random IDs to drive the shader later on. Geometry attributes can define any information that is related to the existing mesh. You can also work with your geometry attributes outside of Houdini if you bake them into mesh maps using Bake Texture render node. This article introduces methods how to generate some geometry attributes that can be useful for procedural texturing in Mantra or any other renderer within Houdini. Than you can measure bounding box minimum for your geometry in Y axis and exclude it from whatever number you have in the translate parameter in Y axis. Let say you wish the bottom of your geometry always sit on top of the grid of your scene and never goes below 0 in Y axis. You can than easily change your mind and place the pivot of your geometry for example to the bottom of the geometry by replacing centroid with bounding box (bbox) and choose whether to use min or max values in preffered axis (D_YMIN, D_XMIN…) bbox("./"+opinput(".",0), D_YMIN) Inside the transform node, Pivot Transform tab you can place the pivot of your geometry into the centre of the scene by typing following VEX code for each axis and save this setup as Preset for later: centroid("./"+opinput(".",0), D_X) centroid("./"+opinput(".",0), D_Y) centroid("./"+opinput(".",0), D_Z) Point('./foreach_begin1/', 0, 'lenght', 0) Center Pivot – Match transform to pivot – Safe preset When you are happy with parameters setup let’s randomize Bend parameter and Translate in Y axis parameter inside bend and transform node by writing following VEX code in their field. Drop down node Transform and do the same. Drop down node bend below the example geometry and set it up according your needs. You can now setup parameters for deformation/transformation your example geometry. ![]() That way we will be able to use iterations and in every one of the iteration generate random number as specified in the VEX code we’ve previously written in the AttributeWrangle node.Ģ. We need to drop down For-Each Point loop node preset and place the CopyToPoint node inside. It is time for placing everything inside loop node preset.īecause we want to give random bend to each piece of our example geometry that is currently being attached to each point of the line. – Store point number into attribute and create and attributes below the line geo inside AttributeWrangle node using VEX code below. ![]() Create few attributes that will drive the bend and length random deformations later on. Use node CopyToPoints to copy your geometry onto points of your line.ģ. Create simple example geometry and then use line node to create line with few points.Ģ. In the video below, I’d like to quickly demonstrate few practical examples on how to use VEX code to make life of Houdini beginner easier and more fun. Copy geometry to points – Give it random deformation – Centre pivot
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |