Karmara for Houdini – Solaris Metadata Helper HDA

Karmara for Houdini is a HDA that will help you to add arbitrary USD Attributes to your Renders. This works for all render engines (including Karma) that are supported inside of Houdini’s Solaris Context.

At first, I was only planning on adding Camera Data to the Metadata to easily reconstruct the 3D camera in other Softwares, but I quickly realized that this tool could do a lot more. Now you can add all USD Attributes available to you in the Scene Graph Details pane to your metadata.

The HDA is written entirely in VEX using Attribute Wrangle LOPS. This blog post will serve as a manual and download page.

Karmara for Houdini can write an unlimited number of Attributes into the metadata and convert Matrix4x4 Translations into Position, Rotation, and Scale vectors, more easily readable by other software.

I have created this HDA inside of Houdini Indie. If you are using HoudiniFX or Houdini Core you might be temporarily downgraded into a non-commercial session. But you can of course use the VEX code and rebuilt this HDA for yourself.

Download

Adding and using Karmara

With all render engines

Karmara needs the path to the Render Product before it can do anything. This also means that you have to place Karmara after the Render Product. The following image will show you a common set up when using Karmara with third-party render engines, or a custom setup of Karma:

Karmara in the Houdini Node tree
Simply place Karmara after the renderproduct

With the Karma HDA

If you want to use Karmara together with the standard Karma HDA then you will need to jump inside the HDA and place Karmara after the Render Product.

Karma HDA
Allow Editing of Contents

Drop down the Karma node and hit Allow Editing of Contents on both the Karma node and the Karmarenderproperties node:

After this, you can place Karmara inside the Karmarenderproperties HDA. Now you only need to drag and drop the renderproduct into the Render Product Parameter on Karmara.

Karma render properties

Karmara Main Parameters Pane

Karmara Main Parameter Pane

After you have placed Karmara to your node tree and dragged the correct renderproduct into the Render Product Parameter, you will be able to add Attributes, World Transforms, and your camera data to the metadata.

Attributes

Attributes are where USD saves certain settings of your nodes. For example, the color of a light. To add this to your metadata, add the controls to the Attributes tab by hitting the plus button on the Attrs to Metadata Parameter.

Add Attributes to Metadata through Karmara

Now, search for the Attribute that you want by selecting the prim the Scene Graph Tree and dragging the Attribute from the Scene Graph Details into the Attribute Path Parameter in Karmara.

Add Attributes to Metadata through Karmara
Add Attributes to Metadata through Karmara

Now, select the renderproduct in the Scene Graph Tree and you will see the domelights color in you metadata:

Karmara Metadata on the renderproduct

By default, Karmara will use the name after the dot as the metadata’s name. You may change this by typing in another name into the Metadata Name Parameter.

Matrix4 to TRS

This setting will only work if the Attribute you added is a 4×4 Matrix. Usually found in a Translation Matrix. Enabling this checkbox will convert such a Translation Matrix into three separate vectors. This is handy to have it usable without additional conversion and also necessary if you don’t want to convert the 4×4 double-precision Matrix into strings but still need it readable by other software.

It is important to note that, while you can add Translation Matrix’s in this Tab, it is recommended to use the World Transforms Tab instead. The Translation you can drag and drop into Karmara might not actually be the current Position of the prim but rather the Translation settings you have on that specific node. These values won’t change if you change the position of the prim downstream by using a Transform or Edit node for example, while the World Transform will take this into account as well.

Transform to String

Enabling this checkbox will convert any number, matrix, or array into a text string. Karmara will always try to make different data types as readable as possible, but certain types might not be readable by all software packages. Transforming this data into strings will increase the likelihood of unsupported data types to be readable. You might need additional conversion in your other software packages to change the strings back to numbers.

You may also want to use this when adding arrays of values. By default, Karmara will turn each entry in an array as separate metadata. Otherwise, EXR’s couldn’t handle arrays. But this can lead to hundreds of entries in the metadata. Converting an Array to strings will turn this into a single entry again.

Karmara Splitter

This checkbox is only selectable when the Transform to String checkbox is activated. This will then remove all formatting like spaces or commas and add a certain pattern to the string, which can be used to break up the string into values again in other software. The pattern is “ïèëï” which you might recognize from my Change Strings Script for Blackmagic design Fusion and DaVinci Resolve. There it is also successfully used as a Pattern Breaker.

World Transforms

World Transforms are also visible in the Scene Graph Details, but they are not draggable like other Attributes.

World Transform Tab of Karmara

To save the World Position of any prim into the metadata, simply drag and drop the prim from the Scene Graph Tree into the Primitive Path Parameter.

Scene Graph Tree to drag prims into Karmara
World Transform Tab of Karmara

By default, Karmara will use the name after the last slash as the name for the Metadata. You may change this by entering a custom name in the Metadata Name Parameter.

Now you will see something like this on your renderproduct:

Scene Graph tree with World transforms saved in Metadata

Karmara will save the 4×4 Matrix and, by default, convert this into Translation, Rotation, and Scale vectors for you. Most applications that I have tested won’t be able to read the 4×4 double-precision matrix. This is why the following checkbox is enabled by default.

Matrix4 to TRS

Enabling this checkbox (on by default) will convert the World Translation Matrix into three separate vectors. This is handy to have it usable without additional conversion and also necessary if you don’t want to convert the 4×4 double-precision Matrix into strings but still need it readable by other software.

It is important to note that these values can be different from the translation settings on a specific node. For example, if you change a prims position through an Edit node. This Tab will reflect the change of position. If you need the values of a specific node’s translation settings, you should use the Attributes Tab instead.

Transform to String

Enabling this checkbox will convert the matrix into a text string. Karmara will always try to make different data types as readable as possible, but certain types might not be readable by all software packages. Transforming this data into strings will increase the likelihood of unsupported data types to be readable. You might need additional conversion in your other software packages to change the strings back to numbers.

Karmara Splitter

This checkbox is only selectable when the Transform to String checkbox is activated. This will then remove all formatting like spaces or commas and add a certain pattern to the string, which can be used to break up the string into values again in other software. The pattern is “ïèëï” which you might recognize from my Change Strings Script for Blackmagic design Fusion and DaVinci Resolve. There it is also successfully used as a Pattern Breaker.

Advanced

Advanced Tab on Karmara

Add Karmara Data

This checkbox is enabled by default and will use the camera defined on the renderproduct and extract the most important values. These are saved like this:

Camera data in metadata

Add Camera Name

Enabling this checkbox will append the cameras name to the metadata. This can be helpful if you want to chain several Karmara nodes.

Camera data in metadata

Enable Custom Prefix

Enabling this checkbox will give you access to the next text field in which you can change the default Metadata Prefix “Karmara” to nothing or something else.

Camera data in metadata

Download

Quickly share this!

Subscribe
Notify of
0 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Scroll to top