I am hoping someone might be able to help with the following situation:
I have a light HDA called SweetLight. I want to maintain all the parameters to this light in this HDA.
I want to create a light rig HDA called LightRig. In this HDA I want to have a Multiparm Block (tabs) parameter so the user of the HDA can hit the “+” button and add a SweetLight in a folder.
So, the LightRig is dynamic in that you can add or remove lights as you want. Also, if changes are made to the SweetLight HDA, I want the interface to the LightRig to update without having to change the LightRig HDA (If I understand, this is what ‘Import’ allows for, right?).
Is this possible? How?
The ‘Parameter Description" settings for folders appears to be un-documented. Can anyone explain the ’Import Settings' section:
Source?
Token?
Mask?
Related topic:
http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&p=49124&sid=0e1d7aa8c35de31b196ce5a64adbdf49 [sidefx.com]
Thanks for any help,
micah
Creating a dynamic light rig HDA
3436 1 1-
- mhenrie
- Member
- 12 posts
- Joined: Oct. 2007
- Offline
-
- mhenrie
- Member
- 12 posts
- Joined: Oct. 2007
- Offline
Jeff at sidefx was kind enough to provide this response:
Adding Lights to the scene through the light rig locked asset
You want to dynamically add lights inside a locked asset. You can't physically add lights inside the digital asset but there are two strategies off the top of my head that you can employ.
1. add lights to the scene and reference them in to the asset
This involves the lighter adding extra lights in the scene then either parenting them to your light rig or providing an extra object list string parameter where you reference in these lights. The asset will then use these extra lights and include them with the light rig for rendering control.
I have seen a couple facilities use this approach to add lights to specific light rigs. The primary rig may have four lights then you add additional lights and wire them or reference them in.
2. Use point light instancing
This is somewhat more involved but possible in H9. I provided a simple example of how to set this up. It uses Import Settings to grab the instanced lights paramters as a global setting.
I attached a hip file that is simply a proof of concept that this could work. It is pretty interesting what you can do in H9. In this file, I use the Add SOP and a multiparm to add points to the scene. I then process more attributes on the points in a ForEach SOP. I substitute the # for ${PT} and set the ForEach to process the total number of points in the incoming geometry.
There are several deficiencies to this method: No proper OpenGL shading using point light instancing. Need to add each light controlled property as a spare attribute and manage that inside the For Each loop.
How to use Import Settings
————————–
First the object that you want to import parms from has to live inside the root digital asset subnet. Note the exact name of this object and the path to this object relative to the root subnet.
Second, you need to find out the folder name and label for the folder block that you want to import.
Third open up the Edit OpType Properties on your asset, add a new folder and in the Import block, set it up as follows:
Source: op:my_target_node
Token: folder0:Light
Mask:
The Source field is simply op: superseded by the path and name to the target node. If it is immediately inside the top subnet, then only the name needs to be supplied.
The Token field takes the name of the folder you wish to import, a colon then the label of the folder. Note: If you see folder0_1 or folder0_2, they all actually live in folder0 so that is what you need to supply. In the example folder, this is the case. The exact name of the folder I am importing is folder0_1 but you have to supply only the root as folder0.
The Mask is used as a filter for including/excluding parameters using wildcards and namespaces. Normally not used.
Finally and the most important step, you have to go to the gear at the top right of the middle column in the Edit OpType Properties and select the option: “Refresh Imports”. This will force the folders with Import Settings checked on to reevaluate and pick up the parms. This is when the folders get populated. It is not dynamic. If you add parms to the referenced folder, you need to refresh the Import Settings again to rebuild the referenced parameters. No there currently is no script support but it is a known deficiency in HOM.
-
- Quick Links
