Search Unity

  1. Unity wants to learn about your experiences working on a Unity project today. We'd like to hear from you via this survey.
    Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  3. Dismiss Notice
  4. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Help Wanted Understanding Underlying Data in the Scene

Discussion in 'Unity MARS' started by wickedwaring, Jun 27, 2020.

  1. wickedwaring

    wickedwaring

    Joined:
    Feb 5, 2014
    Posts:
    15
    Hi,

    How do I get more underlying "data" from a Proxy when it matches in my scene.

    For example, things like

    - the size of the plane it has matched
    - the height from the floor
    - the bounding rect etc?

    Thanks for your help.
     
  2. leweyg_unity

    leweyg_unity

    Unity Technologies

    Joined:
    Jan 29, 2020
    Posts:
    38
    "Window / MARS / Developer / Database Viewer" shows the underlying properties associated with each synthetic object.
     
    wickedwaring likes this.
  3. unity_andrewm

    unity_andrewm

    Unity Technologies

    Joined:
    Jun 25, 2015
    Posts:
    71
    wickedwaring likes this.
  4. wickedwaring

    wickedwaring

    Joined:
    Feb 5, 2014
    Posts:
    15
    Thank you, I will take a look at those actions. I had not seen the database viewer yet either :)

    I had gotten as far as:

    Code (CSharp):
    1. public void OnMatchAcquire(QueryResult queryResult)
    2.     {
    3.         Debug.Log($"OnMatchAcquire {queryResult.DataID}");
    4.  
    5.         // get traits?
    6.         // get semantics tags?
    7.  
    8.         //var mrPlane = queryResult.ResolveValue(...
    But I could not find quick examples of how to use the QueryResult (I read the queries section of the docs, but couldn't see anything there) to access traits, semantic tags, plane data etc like is detailed here -

    "In the database, observations about the world are broken down into data, which consists of single variables of any type, and described with a trait, which is a string identifier for the data. Some data and traits are passive (for example, semantic tags, like labeling a plane as a 'wall' or 'floor'). Others are active (for example, the pose of a face is an active trait with a value that is constantly changing)."

    I will dig further into the referenced actions / documentation, as I try to understand this relationship between database > synthetic objects > conditions / relations / actions etc

    It looks like writing a reasoning API to assess my scene is the ultimate end result I need, but will work towards that.

    This is just general feedback as I look at the API / docs in early stages as non expert AR developer.
     
  5. leweyg_unity

    leweyg_unity

    Unity Technologies

    Joined:
    Jan 29, 2020
    Posts:
    38
    If you know the specific trait name and type, you can use:
    queryResult.TryGetTrait("traitName", out TRAIT_TYPE traitValue);

    The "DataID" associated with the result can also be used to manually look in the "Window > MARS > Developer > Database Viewer". Sadly for performance reasons it is not easy to get the list of associated traits, we are working on this.
     
    wickedwaring likes this.
unityunity