Beispiel #1
0
void
SdfFileFormat::_SetLayerData(
    const SdfLayerHandle& layer,
    SdfAbstractDataRefPtr& data)
{
    // If layer initialization has not completed, then this
    // is being loaded as a new layer; otherwise we are loading
    // data into an existing layer.
    //
    // Note that this is an optional::bool and we are checking if it has
    // been set, not what its held value is.
    //
    const bool layerIsLoadingAsNew = !layer->_initializationWasSuccessful;
    if (layerIsLoadingAsNew) {
        layer->_SwapData(data);
    }
    else {
        layer->_SetData(data);
    }
}