Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How to create a scene without the Unity 3D editor

Discussion in 'Asset Database' started by felchs, Oct 19, 2022.

  1. felchs

    felchs

    Joined:
    Jul 16, 2019
    Posts:
    21
    I have the following problem:
    - I have a 3D engine that has their scenes, but they are not compatible with Unity.
    - But I have the metadata of this another 3D engine about everything on the scene, like: position, lights, models, light probes, physics, cameras etc...
    - I'd like to recreate this scene on Unity, but programmatically doing a parser onto this metadata I have, but not using the Unity Editor. (In the end I would have a .scene file and some created prefabs)
    - But in the same time I'd like to be able to loaded this created scene (from the metadata) inside the the Unity Editor (since I created it for Unity now)
    - I would like to have all the models and things created as prefabs to be able to use addressable in the future.

    Is this feasible?

    Maybe is there a way to create UnityYAML scene files?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,195
    Sure. But don‘t try to write yaml directly that is not the way to go. Instead create meshes, game objects, prefabs as needed using AssetDatabase and PrefabUtility.

    However I wouldn‘t do it two-way. Saves you half the work since you really only need to export to your engine since you won‘t be making changes with it. If you go two ways the real issue is ensuring that everything stays in synch, not overwriting each other‘s changes. It‘ll be a pain working both ways.
     
  3. felchs

    felchs

    Joined:
    Jul 16, 2019
    Posts:
    21
    Ok I can create stuff using AssetDatabase and PrefabUtility, but I don't see how it is possible to create a scene out of this.

    AssetDatabase allows me to create a scene e.g.?

    I took a look at documentation I don't see this is possible... am I right?

    For that I would have to create a Unity Scene and use the AssetDatabase and PrefabUtility inside an existing unity scene.
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,195