You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IECoreUSD : Support IECore::Object references when determining primvar 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']
```
IECore::msg( IECore::Msg::Warning, "SceneCacheData::loadPrimVars", boost::format( "Unable to find data for Primitive Variable \"%s\" at location \"%s\"." ) % var % primPath );
IECore::msg( IECore::Msg::Warning, "SceneCacheData::loadPrimVars", boost::format( "Unable to find reference to data for Primitive Variable \"%s\" at location \"%s\"." ) % var % primPath );
718
+
continue;
719
+
}
720
+
// IECore::Object has saved a reference to the data, so we need to follow the link to the referenced
IECore::msg( IECore::Msg::Warning, "SceneCacheData::loadPrimVars", boost::format( "Unable to find data type for Primitive Variable \"%s\" at location \"%s\"." ) % var % primPath );
709
736
continue;
710
737
}
711
-
dataType->read( g_ioType, dataTypeValue );
738
+
739
+
std::string dataTypeValue;
740
+
dataIO->read( g_ioType, dataTypeValue );
712
741
713
742
// interpretation
714
-
auto interpretationData = dataType->subdirectory( g_ioData, IndexedIO::MissingBehaviour::NullIfMissing );
0 commit comments