Views
SohoWranglers
From Odwiki
Contents |
[edit] How To Wrangle Lights
[edit] How To Wrangle A Light
Light wrangling is a technique for customizing lights in Houdini using SOHO. Every studio has their own ideas of what is important for a light source. Some may think that gels are important, others barn-doors. Some studios want to specify light intensity using Kelvin, others RGB values. Each studio also has their own uber shader which has often been customized over the years. There's no way that Houdini could support every studios needs natively. Therefore, light wrangling was introduced to simplify the process of customizing lights.
Lights, of course, can be customized without wrangling, but the wrangling process allows for a simpler and cleaner interface.
[edit] What It Is
When Houdini sends a scene to a renderer, it invokes some python code (SOHO). This python code asks Houdini to evaluate parameters on objects and outputs then sends the results of the evaluation to the renderer. For example, the SOHO code may ask Houdini what the transform of an object is, or the value of the ri_hider parameter, or the mi_shadowmap parameter. A light or camera wrangler sits between SOHO and Houdini and is able to intercept the SOHO requests for parameter evaluation. Instead of having Houdini evaluate the parameter, the wrangler is able to return any value it chooses.
[edit] How To Set It Up
please refer to this example code: Image:Wrangling.tar.gz
In Houdini, create a Light Template object. This will be the base of the OTL object we want to create to represent our studio light. For this simple example, we just add a parameter called light_color to represent the color of the light. You probably want to delete the Shaders (shop_lightpath, shop_shadowpath) and possibly the shadow_mask and categories parameters. And you might want to add some properties which you always want to see on every light.
- Add a light_wrangler parameter : This should be a string parameter. The parameter should be named light_wrangler and the default should be the name of the wrangler. For this example, the default should be MyLight.
- You probably want to make this parameter invisible. Though it's up to you. Make an OTL on your light template object tile, choose "Create Digital Asset". Make sure your parameters are all still laid out the way you want.
- Create some python code: This is the part which requires you to interpret the parameters you've created on your light source. Please see the sample code included in the sample for more details. Try uncommenting the print statement in MyLightIFD.py to see all the wrangling calls. Make sure your wrangling code is in the Houdini path. If you're having problems getting your wrangler installed, look in the soho.py module and look in the _registerWranglers() function.
- That's it. Now if everything is set up properly, when someone uses your new OTL light, your wrangler will be invoked.



