Friday 25 October 2019

activating particles

to have particles come alive, mid sim (or indeed, to have them stop mid sim) you just need to trigger the "stopped" attribute in your pop network.

blurring vdbs

float dist = xyzdist(1,@P);

float distremap = fit(dist,ch("near"),ch("far"),0,1);

f@density *= distremap;


This gives a vdb a falloff based on how close it is to the original object's surface.
Stick the VDB into a volume visualisation and then plug that into input 0
Put the original geo into input 2.

Now you can "blur"

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)