Couple of questions about digital asset

   5893   6   2
User Avatar
Member
383 posts
Joined:
Offline
Hello,
I am making a domelight (point instanced lights ).
I use the generic light, not a light template.
My problem is there is to much type of light to choose. I would like to be able to choose only point disk distant and sun.
I modified the light inside my subnet to linked its parameter to the main menu of the asset and then, I decided to clic on the Type Properties menu to try to custom the light interface. HUGE MISTAKE.
I make changes to all the lights of Houdini …

How can I customised the light of my asset without to change all the houdini's lights ?
Is there a way to make a custom menu for the light type parameter ?

Thanks for your help

Vincent
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
The quick answer is to make a copy of the flight HDA (Houdini Digital Asset) and then modify this custom light to your liking.

—-

Backing up a bit, every node in Houdini is treated as though it had a tool wrapper and that it itself is a locked digital asset.

Those operators written and compiled from c++ code are pretty much locked down hard and you have to sub-net them in order to build a custom interface on top of.

The quickest way to see which nodes are editable and copy-able HDA's that you can build a new asset on directly is to MMB (MiddleMouseButton) on that operator and inspect the node info. Just look at the “Defined by:” line. If it exists at all, you have an HDA which means you can make a copy and create your own version of that operator.

Here's what an hlight Light node looks like using the Houdini textport and the opinfo command:


/ -> opinfo /obj/hlight
hlight1:
Full Name: /obj/hlight1
Operator type: hlight
Defined by: /Library/Frameworks/Houdini.framework/Versions/12.1.111/Resources/houdini/otls/OPlibObject.otl?Object/hlight
____________________________________________________________________________________________________________________________
hlight1 contains 31 SOPs.
Display and Render SOP: switch3
____________________________________________________________________________________________________________________________
No pre-transform.
____________________________________________________________________________________________________________________________
Synchronized with definition
____________________________________________________________________________________________________________________________
Last Cook Time: 0.41 ms
Total Cooks: 1

____________________________________________________________________________________________________________________________
Created Time: 25 Oct 2012 11:42 AM
Modified Time: 25 Oct 2012 11:50 AM
Time Dependent: No


Now it becomes a straightforward task of creating a copy of this asset that you own and modify at will:

- RMB on any flight and choose the “Operator Type Manager” option
> In the Operator Type Manager dialog that pops up, you will see the entry “Object/hlight” node highlighted in the Operator Type Manager.

- RMB on the hlight entry and from the menu, choose the “Copy…” option.

> The Copy Operator Type dialog will pop up with a few options.

- In the Copy Operator Type dialog, put in your own Name Label and point it to a location on disk where to save the .otl library file.
As an example…
> Operator Name: custom_hlight
> Operator Label: Custom Light
> Save to Library: $HOME/houdini12.1/otls


- Press Accept and you are done. You now have your own hlight that you can modify at will.

The only item you can't change later on is the Operator Name. If you do want to change this, you have to make another Copy of this and follow this process again. There are other methods but this works as well as any for now.

Tab add your new light and start customizing it. You have to carry the customizations for the default light around anyway you slice it so what better way than with your own custom Light HDA.

—-
So an inquiring mind might now ask “just what makes a plain jane Houdini object a light?”
Great question and the answer lies with SOHO (Scripted Output of Houdini Operators) that writes out the ifd/rib/mi scene description file that is fed in to whatever render engine of choice.

Because it's SOHO, it's invariably going to be a pre-defined parameter known to SOHO which we call a Render Property. In this case, on any operator that is to be a light, there is a hidden parameter “Render Property” with name: “light_wrangler”. It is a string parameter and it defaults to “HoudiniLight”. If you have any object that contains this Render Property set accordingly and it has the requisite parameters that define a light (more Render Properties such as light_type and light_color, etc), it will be a light as far as SOHO is concerned. No worries though if you just copy an existing light HDA as it will inherit all this.

To see this, just RMB on any hlight and open the Edit Operator Type Properties and turn on the “Show Invisible Parameters” and do a quick find using “light” as the Filter key word.

Attachments:
copy_operator_type_dialog.png (80.9 KB)
optype_manager_copy.jpg (73.6 KB)
OpTypeManager_menu.jpg (60.6 KB)

There's at least one school like the old school!
User Avatar
Member
383 posts
Joined:
Offline
wow !!!
thanks fort the detailled answer Jeff.
I will follow what you wrote.

Now another question come to my mind.
If i want to publish my domelight tool or make it work on another computer, I will need to provide my dome otl and my light otl, right ?
Is there a way to embed the light otl in the dome otl ? This way I will provide only one otl.

The fact is I am a little confused between otl and digital asset … Otls are library if I understand allowing to contain several HDAssets. Is a custom light an otl or a hda ?

Thanks for your time.

Vincent
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
An HDA or Houdini Digital asset is the actual node/tool that you place in Houdini. This is made pretty clear in the Houdini docs on digital assets here:
http://www.sidefx.com/docs/houdini12.1/assets/ [sidefx.com]
The definition of this asset tool (a bunch of hscript commands and embedded files in a cpio archive file same as a .hip file) is saved inside a wrapper file with an .otl extension Operator Type Library. An HDA is a specific Operator Type within Houdini.

The .otl file can contain any number of assets so yes, you can put two or more assets inside the .otl file.

Three main ways to combine two or more HDA's in a single otl file.

The first way is to use the Operator Type Manager window and the RMB Copy method. Just make sure that the “Save To Library” path to the .otl file is the same file for both assets. This will give you a warning asking if you wish to do this so just accept. This will save the HDA's in to the same .otl file.

The second way involves either Python or Houdini commands.
The Houdini command is otmerge and is straitforward to use in the Houdini Textport:

/ -> help otmerge
otmerge
REPLACED BY
hou.HDADefinition.copyToHDAFile()

Copies all operator type definitions from one library file to
another.

USAGES
# otmerge <source_otl_file> <dest_otl_file>


If <source_otl_file> and <dest_otl_file> have the same operator type
defined, the command will _not_ overwrite the definition in
<dest_otl_file>.

RELATED
* otcopy


The Python command is hou.HDADefinition.copyToHDAFile() and is a more general method that mimics the “Copy” method in the OpType Manager dialog.

The third way involves shells and the hotl command.

hotl <-m|-M> <source OTL>… <dest OTL>
Adds the definitions from the source OTLs into the destination OTL.
When using the -m option, if an operator type is defined in both
libraries, the definition in the destination OTL is kept.
The -M option causes the source OTL definitions to take priority.

The help docs are a bit ambiguous as to how to do all of this.

As for the confusion between “otl” and “hda” Asset, I always kept the two entities distinct as I've been addressing this confusion for years. :roll:
There's at least one school like the old school!
User Avatar
Member
383 posts
Joined:
Offline
thanks for your answer Jeff.
I will study that.
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
330 posts
Joined: July 2007
Offline
thanks again Jeff !

both posts invite one to experiment with already available OTLs , while not exposing those to any ‘ danger ’ .

more reassuring than the DOCs , so ill leave my vote here in hopping to see those inside docs .

very useful !



.cheers
except the things that cannot be seen , nothing is like it seems .
User Avatar
Member
383 posts
Joined:
Offline
yeah !

I can finally customize the hlight.
to achieve that this thread was useful too especially the post of Symek.

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=23676&highlight=change+light+parameter+interface [sidefx.com]

So my domelight is now almost finish. Still to use my custom light to it.

++

Vincent
http://vimeo.com/vbkstudio [vimeo.com]
  • Quick Links