McManning / Coherence

Blender viewport renderer using the Unity Engine
MIT License
30 stars 0 forks source link

Add an asset workflow #27

Open McManning opened 3 years ago

McManning commented 3 years ago

Related to #13

Right now all data synced from Blender is transient - gets added to the [Blender Sync] GO group and goes away once we disconnect from Blender. To be production ready, this needs a workflow for persisting assets from Blender -> Unity and editing those assets back in Blender on demand.

Use Cases

1. I want to lookdev my WIP Blender assets from within Unity

This would cover things like loading up specific lookdev Unity scenes with the right lighting / backdrop / etc and dropping a transient asset into it to work on within Blender. The asset isn't production ready yet, so it's not persisted to Unity. It just exists as a .blend file.

  1. I open my .blend file containing my WIP asset
  2. I open Blender and connect Coherence to a Unity scene that I want to use for lookdev
  3. I edit my asset while viewing changes live in Unity's lookdev scene.
  4. Once I'm done for the day, I save my .blend file and disconnect from Unity. My transient asset is then removed from the Unity scene.

2. I want to start new assets in Blender and persist them to my scene immediately

Simple work like greyboxing, low poly art, assets for VFX (waterfalls, vector fields, particle meshes) that can go through the entire pipeline in a day and may not need a source .blend file.

  1. I open Blender and connect Coherence to a Unity scene that I want to modify
  2. I do my typical modeling work in Blender (model/sculpt stuff, UVs, bring in kitbash stuff, etc)
  3. I adjust the associated Unity material(s) while I work (e.g. VFX material settings, shader graph changes, etc)
  4. I then click a big Save to Unity Scene button somewhere to persist my work to the scene. Could be a selection of objects in my Blender outline or everything.
  5. Unity creates some persistent assets (meshes, FBX files, lights, prefabs, etc) and adds them to the scene as non-transient objects
  6. After disconnecting from Coherence, my new assets remain persisted to the scene.

Around step 4 there should be an optional "Also save .blend file" step where the artist can save their source file for the asset and keep it associated with the new Unity assets in case they want to do use case 3 (below).

3. I want to edit assets already in my Unity scene

Example - I'm doing greyboxing for a level and want to re-open that level to make changes (essentially replacing ProBuilder-like tooling). Or an asset isn't working well with updated shaders and I want to adjust normals / vertex colors / UVs / etc.

  1. I select an asset in my Unity scene and click a big Open with Coherence button
  2. It automatically opens Blender, sets up the render engine, connects to Unity, and opens the associated source file (be it a .blend file, .fbx, whatever)
  3. I can edit the asset in Blender while seeing it update live in Unity
    • For a mesh - this would temporarily replace the FBX (or whatever) mesh reference in Unity with our synced copy while we work.
  4. I can save my changes, which then saves to both the raw source file (.blend, .fbx, whatever) as well as the instance persisted within Unity assets (.fbx, some other format)
  5. After disconnecting from Coherence, my asset updates remain persisted to the scene.
McManning commented 3 years ago

Some more random thoughts here to throw onto the pile - it's probably not too crazy to just bake Blender scene data as a temporary asset type right into Unity similar to how ProBuilder bakes whiteboxed levels without actually generating the obj/fbx/whatever whenever the user makes changes. That baked asset blob can then just be associated with a .blend file so the blob can exist in the Unity scene while not connected to Coherence - but it can also be in-place loaded and updated from the .blend file opened in Blender.

Gets kinda complicated though when dealing with crazy diffs - e.g. we add/removes stuff in the blend file before connecting to Coherence and we'd need to consolidate all that. Assuming it's not just a process to blow everything away and replace, that is.