Random notes, tutorial, tips and tricks in Houdini

  • Starting from the basics:
    • SOP: surface operator, geometry network
    • DOP: dynamic operator, dynamic network
    • VOP: vex operator, vex builder network
    • SHOP: shader operator, shader network
    • CHOP: channel operator, motion/audio network
    • COP: compositing operator, img network
    • ROP: render operator, out network
    • POP: particle operator, particle network
  • Points, vertexex, primitives. Vertexes are part of a primitive. Points are the lowest level attribute of any data type you can have. Like weight, null, nurbs.  You can have a primitive in one point, for example. A point is where Houdini stores all the informations about something. Makes sense.  You move your camera in your viewport with your spacebar pressed.
  • Set Driver / Set Driven in Houdini: to parent the position or whatever of one object to another, highlight the attribute, right click Copy parameter. On the second object Paste Copied Relative References. To see the expression, click on the attribute name. It will cycle between the value and the expression. Dark green on the values means that there’s an expression beneath.
    • The simple expression created to parent the position of one object to another is going to be ch("../circle1/tx")
    • ch means channel.tx means translate x
    • .. means going back one level, inside the same network, to the circle1, to the position x.
    • you can see that tx means translate hovering the mouse on position. You can get all the parameters names just hovering the mouse with ctrl pressed.
    • The expression is saying: I need to pull a channel from a node that it’s not myself, that is called circle1 and the value is tx.
    • We can change the values of our expressions as well.
      ch("../circle1/tx") + .05
    • If we hover the mouse on the value we added, we can use the value ladder clicking the MMB.
  • Access variables in SOP: you have to use a grave accent `. So, for example, to use a @path variable in the material, you can use this snippet $HIP/tex/`@path`
  • Write code in SOP, for example in group: don’t use spaces! For example, if you want to create a group with the type @type == 1, instead you have to write @type==1
  • World coordinates: M
  • Variables on parameters:
    • $F: frame

SOPs

  • Resample: use it to generate tangent, curve, ptdist, curvenum.
    • CurveU goes from 0 to 1, from the beginning of the curve, to its end.
  • Generate points from volume:
    • VDB from Polygon + Scatter
    • IsoOffset + Scatter
    • Points from Volume

FLIP

  • Flip Object
    • Input Type: it could be Surface SOP if you have a polygon or Particle Field if you have already points

 

VEX

  • VEX documentation
  • to declare a variable:
    int nameofthevariable; // create a integer variable
    vector nameofthevariable; // create a vector variableFetching vector P
    ‣ @P // fetch first input P
    ‣ @opinput1_P // fetch second input
    ‣ @opinput?_P // fetch ?th input
    Fetching float foo
    ‣ f@foo // fetch first input foo
    ‣ f@opinput1_foo // fetch second input
    ‣ f@opinput?_foo // fetch ?nt input
    /*
    my comment block
    */
    f@myattrib = 1.0; // f means floating point. This line means that I’m creating a new variable, called myattrib, it’s a floating number and it’s 1.
    @N = @N; // initialise the normals
    @UP = {0,1,0}; // this is the way we initialise the vectors, with the up on Y
    @Cd = @Cd; // initialise the colors
  • Common functions
      • fit() take a number between 2 values, fit it between 2 other values, usually 0-1.
        • Eg, remap @u from range -5,20 to 0-1: foo = fit(@u, -5, 20, 0, 1);
      • rand() generate a random number between 0 and 1.
        • Usually feed it the point id, so each point gets a random number: foo = rand(@ptnum);
      • sin(), cos() as you’d expect, but in radians.
      • radians() convert a number from degrees to radians: foo = radians(90);
      • length() measure the length of a vector. Eg, measure the distance of a point from the origin: dist = length(@P);
      • distance() measure the distance between two points: dist = distance(@P, v@mypoint);
      • abs()Returns the absolute (positive) equivalent of the number. For vectors, this is done per-component
  • Built-in attributes
    • @ptnum – the point id
    • @numpt – total number of points
    • @Time – current time, in seconds
    • @Frame – current frame
    • @primnum – the primitive id
    • @numprim – the total number of primitives
  • Create Floating Slider: @foo *= chf('name');

Tutorial and classes

Video tutorial

E-Books

Some free ebooks and pdfs I’ve found online about Houdini

Share your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.