docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Sample: Query Builder

    The sample available as part of the Unity Cloud Data-Streaming demonstrates how to query entity/geometric metadata inside scenes.

    A typical example of audience for this guide is the developers who will use raycasting/object selection to select object to get the entity metadata. This can be valuable on its own, or a step towards enabling a visibility filter based off metadata.

    Before you start

    To use the Query Builder sample, you need the following:

    • Installed Data Streaming package and its dependencies
    • Installed Identity package
    • Installed Assets package
    • A valid Unity ID
    • At least one Unity Cloud streamable asset associated to your Unity ID

    Install the sample

    To install the sample, follow these steps:

    1. In your Unity Project, go to Window > Package Manager > Unity Cloud Data Streaming.

    2. Expand the Samples section.

    3. On the right the Query Builder sample, select Import.

      After the import process completes, you can view the imported assets under the Assets/Samples/Unity Cloud Data Streaming folder.

    Run the sample

    To run the sample, follow these steps:

    1. In your Unity Editor Project, go to File > Open Scene.

    2. Go to Assets/Samples/Unity Cloud Data Streaming/<package-version>/Query Builder Sample Scene/Scenes/QueryBuilderSample.unity and run the scene.

    3. In the Game view, select Login if you are logged out.

      Note

      If you've previously logged in, the sample automatically logs you in, so you can proceed to step 6.

    4. Log into the browser window that launches with your Unity ID account.

    5. Return to the sample scene to confirm that you are logged in. The Organization field lists the organizations associated with your account.

    6. From the Organization field, select an organization.

    7. From the Project field, select a project.

    8. From the Asset field, select an asset.

    9. Select Launch to download and view the associated dataset. You can now query the metadata attached to the dataset.

    Selection

    In this section, choose what to select and return in the query result.

    You have three choices:

    • Everything: Every owner returned will have its whole metadata content attached.
    • No Metadata Fields: There will be no metadata content, only the owner's id, name and hierarchy information will be in the result.
    • Specific Field(s): The metadata will only have the fields you have selected in the following section.

    Fields

    When you select Specific Field(s) from the previous section, this section will appear and start loading all possible root fields path in your dataset. You can then select every key you want in the query result.

    In

    In this section, you choose in what entities the query will fetch the metadata from.

    You have two choices:

    • Every dataset's Instances: The query applies on every instance in the dataset.
      Note

      Be careful when selecting this option when your dataset contains a lot of geometric entities as this can cause performance issues.

    • Specific Id(s): The query applies only on a selected subset of the dataset instances.

    Ids

    When you select Specific Id(s) from the previous section, the section appears and starts loading the instances ids in the current dataset. You can then select the wanted subset of instances you want the metadata from.

    Note

    As of now, the amount of ids in this section is limited to 200 to prevent memory and performance issues.

    Where

    This section allows you to filter the instances, and list the ones that follow a specific condition. Leave all fields empty if you want no condition applied.

    If you want to apply a "Where" condition, follow these steps:

    1. Use the Add Path Segment button to add as many segment there is in the JSON path toward the wanted value.
    2. In the last input, add the value that must be respected in the condition.
    Note

    All fields are case-sensitive.

    Fetching metadata

    When all your choices for the query are made, select the Fetch Metadata button. The result of the query displays in the output section.

    Publishing metadata

    When uploading your files for you asset in the asset dashboard, select the 3d-data-streaming transformation workflow. This will add a dataset to your assets that will both allow for streaming it and querying metadata.

    Troubleshooting

    Refer to the troubleshooting section for help with the Query Builder sample.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)