What Is Encapsulation?#
Prims can be encapsulated or unencapsulated which has implications for referencing and other composition arcs. A prim is encapsulated when it is an ancestor of the referenced target prim. When a prim is encapsulated, it will be referenced along with its ancestor.
Let’s take a look to see how it works. First, we’ll look at an example of a fully encapsulated reference. On the right side, we can see that we are making an external reference to encapsulated.usd
.
Here we can see that the contents of the reference include a cube that has a binding to a red material. When referencing encapsulated.usd
, everything will be brought over that is contained under the xform World
.
Now let’s look at what we mean when we say unencapsulated.
On the right, we are making an external reference to unencapsulated.usd
.
Here are the contents of unencapsulated.usd
.
Unlike our encapsulated example, the scope called “Looks” is not encapsulated inside of World.
So when we reference unencapsulated.usd
, the cube will be brought over but the material binding will no longer work because the red material would not exist in the new context.