Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

MetaData search/query without pipeline when using prefab.

Discussion in 'Unity Reflect' started by garrido86, Dec 2, 2020.

  1. garrido86


    Dec 17, 2013
    I'm currently working with the generated Prefab(s) from the imported Revit model and I like to know how I can query for meta-data. As I understand the existing tooling is meant to be used with the Pipeline when loading a Reflect project "on demand" but this is not the case for me.

    I think there must be a way, because the Editor MetaData Explorer from the Reflect-Extensions allows me to actually work and query the Prefab without interfacing with the Reflect Pipeline, but I couldn't figure out how it is doing it looking at the code:

    I could write up my own little query manager but meh, I think there must be a pre-existing way to handle this.
  2. FredMoreau


    Unity Technologies

    May 27, 2019

    I understand you want to query metadata at runtime, from a model you imported through the Reflect window in the Editor.

    You may also want to look at this other Editor Metadata Explorer for hints:

    Every object featuring metadata has a Metadata component, so the following will provide you with all the metadata in the scene :
    metadatas = FindObjectsOfType<Metadata>();

    Then you can iterate to find the parameters and metadata :
    foreach (Metadata m in metadatas)
    var parameters = m.GetParameters();
    foreach (KeyValuePair<string, Metadata.Parameter> kvp in parameters)

    Hope this helps.