Effecteur pour l’échelle, la rotation, la couleur


If you're gonna do it, may as well go all the way. Someone asked how to create a random effector C4D style in Houdini, the examples above didn't show how to add randomisation nor animation, so here they are.


Two different perfectly valid methods, one mostly node based with vops and attrib transfers, the other with vex wrangles.


The vops one goes something like:


  1. Create a cube of points, and a separate 'effector' point that will be used to drive the effect
  2. Set a weight attribute to be 0 on the cube points, and 1 on the effector point
  3. Attribtransfer weight from the effector to the cube points, using the attribtransfer parameters to control the blend falloff
  4. In a point vop network, setup a random colour (or scale or rotation) per point, and blend to it using the weight value
  5. Drive a copy sop to copy a small cube to each point.


The vex one is similar, but more of the grunt work is done in code:


  1. Create a cube of points, and a separate 'effector' point that will be used to drive the effect
  2. In a wrangle do the following...
  3. Measure the length between each point and the effector
  4. Fit that length to the required falloff distance, and pass it through a ramp to adjust the falloff shape, fit it to a value between 0 and 1
  5. Create a random scale/colour/rotation per point
  6. Blend to it using the processed weight value
  7. Drive a copy sop to copy a small cube to each point.


As per other examples, this takes advantage of certain point attributes that the copy sop will recognise and use to modfiy the copied geometry, in this case @Cd for colour, @pscale as a uniform scale, and @orient for rotation. The full list of attributes is here: https://www.sidefx.com/docs/houdini18.5/copy/instanceattrs


Even though the vops one is probably simpler on the surface, I'd end up using the vex one because... reasons? I guess I find having all the important stuff in one location is more useful to me, and the more vex I force myself to write, the more practice I get. :)





0 Commentaires