Saturday 19 October 2019

group centroids

group centre/centroid - intstead of blasting out groups and using $CEX etc, you can just use $GCX, $GCY, $GCZ in your transform pivots.

Wednesday 2 October 2019

Selection expand

To expand - any - selection like in Maya... do your selecting then press SHIFT G (to grow) or SHIFT S (to shrink)

Friday 6 September 2019

seperated AOVs eg(z depth at 32 bit)

Half precision and 32 bit for z depth 
16 bit half precision but utility passes in 32 bit. 

- on your AOV, tick Separate File
- set the filepath to the same location as your beauty render but with the name of the pass suffixed, e.g. for the Z depth it might be: _$HIP/../../render/$OS/$HIPNAME/`$OS`_Z.$F4.exr_
- set Precision to 'Float 32 bit'

Tuesday 3 September 2019

rotating point normals, with vops

To rotate a point's normals (or any vector for that matter) you need to multiply it with a matrix and an angle (usually in radians) and around a specified axis.

A much neater/easier-to-grasp method is to use a VOP.
Give your points some initial Normal values, eg point them in X.

Make a point VOP.
Connect the N output into a multiply. We want to multiply this N vector and get a vector output.
The output of the multiply should go to the N output.

Make a DegToRad node (skip if you speak radians) and connect that to the angle input of a Rotate node. Promote the DegToRad's angle input so you can tweak it at object level.

In the Rotate node, set the vector that you wish to spin the normal vector around. It might be Y. 0,1,0.
Or you could be doing something  cool like calculating the vector that an edge lies on and spinning something around that.

Connect the output of the Rotate to the second input of the Multiply.

Now jump back out of the VOP and you should be able to see your normals rotating when you change the angle input.

-------------------------------------------------------

Of course this is just a couple, maybe one, of lines in VEX, but who really has time to memorise that? heh.

Monday 2 September 2019

Checking if your instancefile files exist

Checking if your instancefile files actually exist...Cos sometimes...they don't! Stolen from MikeB

Paste this into a Python node:



import os

node = hou.pwd()
geo = node.geometry()

geo.addAttrib(hou.attribType.Point,'exists',0)

for pt in geo.points():
    file = pt.attribValue('instancefile')
   
    if os.path.isfile(file):
        pt.setAttribValue('exists',1)
    else:
        pt.setAttribValue('exists',0)
   

Friday 23 August 2019

wedging

BASIC WEDGING (nothing fancy here. Might do something more detailed later)

For when you want to vary the parameters in something and render them all out.
Eg. Caching out a sphere with different scales

In that nice boring case, you need a couple of things in your ROP area.

1.
A Geometry ROP, point the SOP path to your sphere's output
Set the Output file to something like
$HIP/geo/sphere_`$WEDGENUM`_whatever.bgeo


2.
A Wedge node
Point the Output Driver to the Geometry ROP. This shouldn't be necessary, as you can just wire the Geo ROP into the Wedge, but when using plugins such as Deadline, sometimes it doesn't know to take that input....
Let's not do random samples, so untick that.
Add a Wedge Parameter by pressing the + button, give it a name...in our case, we'll call it Radius
Type in the path for the channel we're wedging in the Channel box
eg. /obj/geo1/sphere1/scale
Set the range of values you want. Eg. 1 to 10
Set the number of steps to take - Houdini will do uniform divisions, so in our case we should get scales of 1-10 if we type 10 steps.


3.
Hit Render Wedges. Or plug your wedge rop into Deadline and submit it as normal.


NOTE -
I sometimes use a NULL in my SOP as a controller for certain things. It can be easier to wedge the channels on this null and then copy the relative values into other nodes, so everything is easily accessible.





Friday 9 August 2019

padzero to do file names!

/tba/CLIENT_JOBS/GREY_LDN_Zalando_Dont_Change_100713/vfx/shots/sh0033/houdini/sourceimages/backplate/backplate_guide.`padzero(3,$F3-1000)`.jpg


padzero(number of zeros, thing you want to pad) turns _guide.2.jpg into _guide.002.jpg