Q100353: Customizing the advanced options of the Merge node

Follow

SUMMARY

This article will explain the usage of the Merge node's advanced options.

It can be helpful to customise these options to manage how attributes are combined if the same location is present on multiple merged inputs, specifically when merging two input scene graphs with overlapping hierarchies.

 

MORE INFORMATION

Using the Merge node you can combine multiple input scene graphs into a single output by merging the nodes producing each of the inputs. 
 
All locations present in the input scene graph will be included into the output scene graph, unless the same location is present in more than one input. If this is the case, by default the location will receive the attributes from the leftmost input containing that location.
 
For example in the screenshot below, both PrimitiveCreate nodes create a
/root/world/geo/primitive location.
 
image.png

PrimitiveCreate1 is connected to the Merge node's i0 input, which is to the left of the i1 input that PrimitiveCreate2 is connected to.

As such, the translate attribute of the primitive location is taken from the leftmost PrimitiveCreate node's attribute values.

If this default behaviour is not desired, it can be customised using the advanced option parameters.
 
The Merge node has the following advanced options available:
  • sumBounds
  • preserveWorldSpaceXform
  • preserveInheriteedValues
  • preferredInputAttributes
  • preferRightmostInputWithAttribute

For an explanation of how the first four options can be used, please see the Reference Guide entry for the Merge node in the Katana Online Help.

 

The last option, preferRightmostInputWithAttribute will be used as the basis of the example case presented in this article. 

By default, if a location is present in more than one of the input scene graphs, then attribute values are taken from the leftmost input which has the location. The preferRightmostInputWithAttribute parameter allows attributes of a location with an attribute of the given name be taken from the rightmost input which has the location.

This means the option works right-left to select the input, instead of left-right.

 

USE CASE

The following use case will show an example for using the preferRightmostInputWithAttribute option.  

In the example project, there are three Alembic_In nodes plugged into one Merge node. We want the alembic with the 'geometry.arbitrary.st' attributes to be our main shape, as it contains our UV information.

In the attached project, you will find the node graph contains 4 nodes.

  • Two Alembic_In nodes without UV values (noUV, noUV1)
  • One Alembic_In node with UV values (withUV)
  • One detached Merge node

UVNodes1.PNG

 

When you view the three Alembic_In nodes, you will notice that each of them are located and named exactly the same. "/root/world/geo/asset/pSphere1"

Both the noUV nodes will look stretched when compared to the withUV node.  (Just to show differences in our example)

Normal (withUV):

 UVNormal.PNG

 

Stretched (noUV):

UVStretched.PNG

 

Let's connect all three Alembic_In nodes to a Merge node. As expected, the Merge node will use the leftmost input as its attribute selection. (noUV)

 UVNodes.PNG

To switch the non-UV shape with our shape containing the UV values (Without tweaking the GUI inputs), we need to do the following:

    1.  Open the Merge node in the properties tab

    2.  Toggle showAdvancedOptions to 'yes'

    3.  In the preferRightmostInputWithAttribute parameter add the following attribute: 
         (geometry.arbitrary.st)

mergeoptions.PNG

Result: The Merge node will switch its input to the Alembic with UV attributes.

 

The video below demonstrates our result after editing the option: 

preferRightmostInputWithAttribute.gif

 

Was this article helpful?
0 out of 0 found this helpful

Comments