---
title: Accessing metadata
product: SpeedTree Runtime SDK
version: '10'
latest_version: '10'
status: This page documents version 10. The latest version is 10.
canonical: https://docs.unity.com/en-us/speedtree-runtime-sdk/10/accessing-metadata
latest_url: https://docs.unity.com/en-us/speedtree-runtime-sdk/10/accessing-metadata.md
last_updated: 2026-11-20
generated_at: 2026-11-20T20:14:37.716Z
locale: en-us
---

# Accessing metadata

> Learn how to access per-tree metadata exported from the SpeedTree Modeler.

Exported .stsdk files contain all metadata set in the SpeedTree Modeler using the [Tree Info Window](https://docs.unity3d.com/speedtree-modeler/manual/tree-info-window-reference.html). To access the metadata for a base tree model in the Runtime SDK, call `CCore::Metadata()`. An example of accessing all fields in an .stsdk file follows:

```cpp
#include "SpeedTree/Core/Core.h"

void PrintTreeInfo(const char* pFilename)
{
    // populate loading config struct so that the sdk
    // handles the file and memory operations automatically
    SpeedTree::CCore::SLoadConfig sLoadConfig;
    sLoadConfig.m_strFilename = pFilename;
    sLoadConfig.m_bGrassModel = false;

    // create a core/tree object to read stsdk into
    SpeedTree::CCore cModel;

    // call stsdk-loading function: returns true on success
    if (cModel.LoadTree(sLoadConfig))
    {
        printf("STSDK load was successful\n");

        SpeedTree::CMetadata cMetadata = cModel.Metadata( );

        printf("\nSTSDK file metadata:\n");
        printf("  up vector: %s\n", cMetadata.UpVector( ) == SpeedTree::CMetadata::UP_VECTOR_Z ? "Z" : "Y");
        printf("  meters per unit: %g\n", cMetadata.MetersPerUnit( ));
        for (int i = 0; i < static_cast<int>(cMetadata.Entries( ).Count( )); ++i)
        {
            printf("  '%s' = '%s'\n", cMetadata.Entries( )[i].Key( ).Data( ), cMetadata.Entries( )[i].Value( ).Data( ));
        }
    }
    else
        fprintf(stderr, "STSDK load was unsuccessful\n");
}
```
