Thursday, 8 October 2026

render var for aov, karma, solaris

 
This seems to be the least painful way to make an AOV - using a "render var" node just before the Render Settings.

I've named the node itself "pref", so a $OS can pick up the naming.
Under the Standard tab, set the data type and source attribute name. My attrib is called "rest" and it's a vector 3 float. The source is Primvar, which means it comes from the mesh.


Next, on the Husk tab (this might be located under standard, depending on your Houdini version), the name box is what you'll want to call your AOV (here we use $OS to take the node label, pref in my case) and then the format that we are writing out - color3f (rgb).


screen space depth, ndc, camera space, flattening stuff

 

Pinched this from Tomas on the houdini forums.

This is useful for moving stuff in and out of camera space, but maintaining the "2d" flat appearance of an object.

Plug this into a point wrangle- 


string cam = "/obj/cam1";
@P = toNDC(cam, @P); // to ndc space
@P.z *= 0;  // flatten
@P.z -= chf("depth"); // set depth
@P = fromNDC(cam, @P); // if you need bring back in front of cam


i've changed the set depth to a float slider to be a bit more interactive, you could just put a hard value in.

the fromNDC(cam,@P) part is the line that brings your object back in front of your camera...otherwise toNDC just exists somewhere near the origin. 

the @P.z*=0; to flatten is entirely optional... you can use this script to move things around in "camera z" 

rendering with karma/solaris in a more "normal way"

 Just a way to work as if you have a render view, instead of in the viewport.

 In Stage, make a Clone Control Panel tab (where your parameters are)


click the Clones with a arrow button, make a new Local one, select Karma CPU or GPU..
Drag your karma render settings node onto the "Node".
Now you can toggle a render on and off in a Render Gallery window & it will save a snapshot each time (might be good or bad....).

Tuesday, 9 June 2026

refracting aovs in karma

 make a custom attribute, i've called it poso2, i'm hijacking the Position value for this & fitting it between 0 and 1.


in karma, use the geompropvalue to load it in to the shader. here i use a mtlxdot because apparently it doesn't change the value of the attribute (?).  i plug it into a karma aov thing and name it "poso", using the $OS. Here i'm using the float value to drive a colour ramp.


In the render settings, aov section, scroll down to "extra render vars" and add one. put in your name - "poso" in our case. set format to color3h and data type to color3f.
The source name is :
C<TG>.*L
and Source Type is LPE.
I actually used the settings created when you select Glossy Transmission for this, then changed the name to Poso. Seems to work though!

Tuesday, 12 May 2026

usd look publishing reminder

 when publishing usd look (with AYON, at least), double check the "materials" folder path. It needs to be sat under the main asset. Eg. if the main asset is /f1, the materials need to be located in /f1/materials.

equally, the geo should be under /f1/geo/

Thursday, 7 May 2026

rename, string substitution, replace in every occurence.


This is for replacing *EVERY* occurence of a string. Eg. SOMEONE has manually selected objects to assign materials to and you don't want to change every single instance of the object path!! This will go through your entire houdini script and change it

use this to string subsitute/replace. make a tool - right click on the shelf and select new tool.
Paste this code into the "code" tab and click create.



 import hou


contexts = ["/obj","/mat","/stage"]


def changeParms(node, search, replace):

    string_parms = [p for p in node.parms() if p.parmTemplate().type() == hou.parmTemplateType.String]

    for parm in string_parms:

        if (search in parm.eval()):

            newValue = parm.rawValue().replace(search, replace)

            parm.set(newValue)


input = hou.ui.readMultiInput("Tell me what to look for: ", ("search","replace"), buttons=('OK',"Cancel"), default_choice=0, close_choice=1, title="Replace Files")

if (input[0] == 0):

    search = input[1][0]

    replace = input[1][1]

    for rootNode in contexts:

        for node in hou.node(rootNode).allSubChildren():

            changeParms(node, search, replace)

Tuesday, 14 April 2026

geometry and material variants, instancing in solaris

Variant workflow. Use the Component builder + Geo Variants to build some variants. You'll use the Component Material node to create the mat variants, then packaged them out with the component output. Bake this as a USD.

 


Load your cached out USD. Attach an "explore variants" node and set the mode to explore. Set spacing to zero so they're all at the origin.

Then plug it into an Instancer. Specify the primitives you want to prototype (use in instancer). Make sure you UNTICK "Only Copy Specified Prototype Primitives". The rest is as normal (eg make some points inside the instancer and give it an index attribute).

Now all of your variants are in play.


This seems a bit longwinded, but I guess it does work and fits within a pipeline a bit nicer? It also works nicely with the variant systems that exist in Houdini/Solaris.

BONUS - if instead of using the Instancer in "Point Instancer" mode, you use "Instanceable Reference", you gain access to each and every instance. If you do this, you can actually use the Set Variant nodes to change particular instances, eg. you switch one of them to be a pig and make it red instead of green. Performance does take quite a big hit if you do this though.