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.
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.
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.
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
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)
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)
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:
Result: The Merge node will switch its input to the Alembic with UV attributes.
The video below demonstrates our result after editing the option: