Kristen Eggleston
  • Demo Reel
  • Blog

Changing Parameter Script Language

7/2/2013

 
Picture
As I'm building the UI for this shader I've had to do some callback scripts so that when a button is pressed or a toggle gets changed, it changes some other feature on the shader. I usually write these in python because it's easier. You must remember to change the language in the Type Properties window though.

Picture
This is where to change the language if you promote parameters rather than creating new ones to link to the inner workings. Took me a while to figure that one out.

Script for toggling on and off another attribute

Python:
if hou.pwd().parm("useTiles").eval(): hou.pwd().parm("useDamascus").set(0)
Hscript:
opparm . useDamascus 0
In this case the Hscript was shorter but the python is more readable; if this parameter equals 1, set the other parameter to 0 versus using opparm. The Hscript also does not check to see if the parameter is turned on or not. This is my personal preference as I am more schooled in using python.

Comments are closed.

    Author

    Compilations and contemplations of my time as a Side Effects intern.

    Archives

    November 2025
    August 2013
    July 2013
    June 2013

    Categories

    All
    Discoveries
    Fun Renders
    It Totally Works
    New Feature
    Personal
    Problems
    Uber Shader

Proudly powered by Weebly