Skip to content

Conversation

@bradleyhenke
Copy link
Contributor

@bradleyhenke bradleyhenke commented Jun 30, 2022

IECore::Object avoids some data duplication by writing an internal object's
data a single time while saving, and then writing a reference path to the data
container if other internal objects share the same pointer.

One case in which this situation has presented itself is creating a "Pref"
primvar to hold the rest positions of a primitive. In the following example,
the created "Pref" primitive variable receives a shallow copy of the "P"
primitive variable. So, the internal "data" and "indices" members point
to the same shared data. Therefore, a reference is created when the primitive
object saves itself.

box = IECoreScene.MeshPrimitive.createBox(
	imath.Box3f( imath.V3f(-1), imath.V3f(1) )
)
box['Pref'] = box['P']

Related Issues

  • N/A

Dependencies

  • N/A

Breaking Changes

  • N/A

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Cortex project's prevailing coding style and conventions.

…r type.

`IECore::Object` avoids some data duplication by writing an internal object's
data a single time while saving, and then writing a reference path to the data
container if other internal objects share the same pointer.

One case in which this situation has presented itself is creating a "Pref"
primvar to hold the rest positions of a primitive. In the following example,
the created "Pref" primitive variable receives a shallow copy of the "P"
primitive variable. So, the internal "data" and "indices" members point
to the same shared data. Therefore, a reference is created when the primitive
object saves itself.
```
box = IECoreScene.MeshPrimitive.createBox(
	imath.Box3f( imath.V3f(-1), imath.V3f(1) )
)
box['Pref'] = box['P']
```
@bradleyhenke bradleyhenke force-pushed the usd_readReferencedPrimvars branch from 3ca6102 to 328d591 Compare July 4, 2022 23:26
@ivanimanishi ivanimanishi merged commit 8282451 into ImageEngine:RB-10.3 Jul 5, 2022
@ivanimanishi ivanimanishi deleted the usd_readReferencedPrimvars branch July 5, 2022 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants