Project

General

Profile

Feature #40

Unity compatibility

Added by Josip Almasi about 3 years ago. Updated over 2 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
Start date:
02/05/2021
Due date:
% Done:

0%

Estimated time:

Description

Unity exports GLTF scene, but it requires GLTF extensions provided by babylon-manager.js. It's incompatible with current VRSpace.

Investigate and fix/implement what's needed to make it work.

History

#1

Updated by Josip Almasi over 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Josip Almasi
#2

Updated by Josip Almasi over 2 years ago

Babylon exporter (0.8.1) actually exports babylon scenes rather than gltf; maybe this can be controlled somehow.
Saves html with inline scripts that load the scene.
All required scripts are saved in scripts folder; all babylon scripts are rather old, v4.0.3.
Required methods are missing in numerous classes, e.g. Engine.getInputElement, Bone.getIndex etc.
Workaround is to replace obsolete libs with current ones, e.g.

<!-- Engine Libraries --> 
<!-- obsolete ones
<script type="text/javascript" src="scripts/babylon.js"></script> 
<script type="text/javascript" src="scripts/babylon.gui.js"></script> 
<script type="text/javascript" src="scripts/babylon.gltf.js"></script>
-->
<!-- MANDATORY babylon.js scripts -->
<script src="https://cdn.babylonjs.com/babylon.js"></script>
<script src="https://cdn.babylonjs.com/loaders/babylonjs.loaders.min.js"></script>
<script src="https://cdn.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js"></script>
<script src="https://cdn.babylonjs.com/gui/babylon.gui.min.js"></script>

Other than that, WorldManager expect a World to work with. Simplified UnityWorld does the trick.
It can be used after the scene is loaded, e.g. in generated removeSceneLoader function, like:

                import ('../../../babylon/js/vrspace-min.js').then( vrspace => {
                  var world = new vrspace.UnityWorld();
                  world.init(engine,title,scene);
                  var net = new vrspace.WorldManager( world );
                  // connect, set own avatar and start the session
                  net.enter({
                    // RECOMMENDED set your avatar url, or be invisible
                    mesh:'//www.vrspace.org/content/char/male/bruce_lee/scene.gltf', 
                    // OPTIONAL set your name, MUST be unique
                    name:'someone'+Math.random()
                  });
                } );

#3

Updated by Josip Almasi over 2 years ago

  • Status changed from In Progress to Resolved
#4

Updated by Josip Almasi over 2 years ago

  • Status changed from Resolved to In Progress
#5

Updated by Josip Almasi over 2 years ago

babylon toolkit is in poor shape, unity reports compiling errors, there's a single tutorial that shows things that don't actually happen on screen

#6

Updated by Josip Almasi over 2 years ago

  • Status changed from In Progress to Feedback

Also available in: Atom PDF