3DS Max Babylon Entities DLL

Who is the guy that made the Exporters/SharedProjects/BabylonExport.Entities at master · BabylonJS/Exporters · GitHub

Babylon Entities… I need to talk to that guy about using the updated Babylon Entities from Unity to export to .babylon scene files.

I am running into a GLTF Skinning problem for the new toolkit and MAY have to go back to using Babylon Entities for the new exporter. If so… I need to know how to do a few thangs i was doing in the gltf exporter …

1… BlendShapes and BlendShape Animations
2… Multi Target Animations (Can target transforms as well as bones in the same animation)
3… Mesh Instances

Etc…

I need to know how i can do these things before i waste many months making a new toolkit only for some DEAL BREAKER to creep up at the end like i did with GLTF and new the Toolkit… If i cant address the GLTF Skinning issue without making it DOG SHIT SLOW… I will need to go back to regular JSON babylon scene files :frowning:

Anyways… Anybody with insights on how the Babylon Entities can be used from Unity to do the more advanced things i was doing in GLTF… I would greatly appreciate it :slight_smile:

I did it :slight_smile:
They are plain POCO objects that help generating the file format. So we can extend them to add whatever you need to load from .babylon (I must admit I did not keep them updated but as I said it will be easy to add as there are just “structures”)

Anyhow, wre you sure you want to stop using gltf? Seems like we are all missing something here.

Not totally sure I’m going to STOP using gltf … I am having issues with GLTF Skinning and performance. I am just evaluating my options if I can’t address the GLTF Skinning and the performance hit you get when keeping the bounding boxes synchronized with the parent meshes… which are bones. @bghgary has been helping me with gltf … Thanks again Gary for all your excellent work.

But if the default usage of skinned meshes in gltf using my toolkit ends being too slow … I would rather go back to Babylon json. I know that sucks. I love gltf format and I spent many months making the best exporter I can. Blend shapes, all type of Animations and much more… but in the long run if it ends up being too slow, nobody is going to want to use it… including me

Anyways , I have not given up yet. Just weighing my options should I have to go back to json Babylon scene files

well you can still keep it and offer the option to your users to use one or the other!

Yo @Deltakosh … So can the current state of the Babylon Entities handle things like BlendShapes and BlendShape Animations.

I saw another developer talk about encoding Mesh Instances in the json. So I assume this is working … I just dont see how to use instancing in the entities that are in the Unity Exporter (Which are out of date from the SharedProject/BabylonEntities)

And MULTI-TARGET animations

Just in case i need to go back to babylon scene files… I will need to know how to do these things with the entities (Maybe more, but its i can think of right now)

Im afraid im going to have to go either or… Its ALOT of work to maintain the toolkit. I dont think im up for maintaining BOTH types… Besides my new Toolkit… I know ALOT more and its designed WAY better… Faster, Cleaner, FAR LESS code to maintain and for others to maintain their OWN toolkit they may have tailored for a certain project… EVERYTHING that is not the actual GLTF export is a TEMPLATE and can be easily tweaked to fit whatever type of project you have… and i have BUILT-IN PWA that auto creates your worker.js with ALL the files from your project built-in… all the required icons and images and HTML tags need to properly invoke PWA services in the browser. Just by Checking Progressive Web App In the Toolkit Exporter Option:

And that generates full PWA export:

And most importantly auto create worker.js with all the installFiles and Required Service Worker Function:

var versionStamp = '9c90ccb0-6de8-464f-bf86-b019897e23d3';
var installFiles = ['./', './index.html', './game.html', './project.js', './toaster.css', './favicon.ico', './manifest.json', './scripts/babylon.ammo.js', './scripts/babylon.gltf.js', './scripts/babylon.gui.js', './scripts/babylon.inspector.js', './scripts/babylon.js', './scripts/babylon.manager.js', './scripts/babylon.materials.js', './scripts/babylon.navmesh.js', './scripts/fastclick.js', './scripts/meter.js', './scripts/pep.js', './scripts/toaster.js', './scenes/BabylonCanvasTools.js', './scenes/SampleScene.bin', './scenes/SampleScene.gltf', './scenes/assets/Canyon_env.dds', './scenes/assets/Canyon_nx.jpg', './scenes/assets/Canyon_ny.jpg', './scenes/assets/Canyon_nz.jpg', './scenes/assets/Canyon_px.jpg', './scenes/assets/Canyon_py.jpg', './scenes/assets/Canyon_pz.jpg', './scenes/assets/SampleScene_Lightmap-0_comp_light.png', './scenes/assets/SampleScene_Lightmap-1_comp_light.png', './scenes/assets/babylon/images/Amiga.jpg', './scenes/assets/models/remy/textures/Remy_Body_Diffuse.jpg', './scenes/assets/models/remy/textures/Remy_Body_Normal.png', './scenes/assets/models/remy/textures/Remy_Bottom_Diffuse.jpg', './scenes/assets/models/remy/textures/Remy_Bottom_Normal.png', './scenes/assets/models/remy/textures/Remy_Hair_Diffuse.jpg', './scenes/assets/models/remy/textures/Remy_Hair_Normal.png', './scenes/assets/models/remy/textures/Remy_Shoes_Diffuse.jpg', './scenes/assets/models/remy/textures/Remy_Shoes_Normal.png', './scenes/assets/models/remy/textures/Remy_Top_Diffuse.jpg', './scenes/assets/models/remy/textures/Remy_Top_Normal.png'];
// ..
// Post Service Worker Version Message
// ..
self.addEventListener('message', function(evt) {
    if (evt.data != null && evt.data === 'version' && evt.ports != null && evt.ports.length > 0) {
        var port = evt.ports[0];
        if (port && port.postMessage) {
            // console.log('WORKER: Version check: ' + versionStamp);
            port.postMessage(versionStamp);
        }
    }
});
// ..
// Install Service Worker File System
// ..
self.addEventListener('install', function(evt) {
    evt.waitUntil(
        caches.open(versionStamp).then(function(cache) {
            // console.log('WORKER: Fetching cache: ' + versionStamp);
            var cachePromises = installFiles.map(function(urlToPrefetch) {
                var url = new URL(urlToPrefetch, location.href);
                url.search += (url.search ? '&' : '?') + 'time=' + new Date().getTime().toString();
                var request = new Request(url, { mode: 'no-cors' });
                return fetch(request, { cache: 'no-store' }).then(function(response) {
                    if (response.status >= 400) throw new Error('request for ' + urlToPrefetch + ' failed with status ' + response.statusText);
                    return cache.put(urlToPrefetch, response);
                }).catch(function(error) {
                    // console.warn('WORKER: Not caching ' + urlToPrefetch + ' due to ' + error);
                });
            });
            return Promise.all(cachePromises).then(function() {
                // console.log('WORKER: Cache updated: ' + versionStamp);
                return self.skipWaiting();
            });
        }).catch(function(error) {
            // console.warn('WORKER: Pre-Fetching Failed: ', error);
        })
    );
});
// ..
// Activate Service Worker File System
// ..
self.addEventListener('activate', function(evt) {
    evt.waitUntil(
        caches.keys().then(function(cacheNames) {
            return Promise.all(
                cacheNames.map(function(cache) {
                    if (cache !== versionStamp) {
                        // console.log('WORKER: Cleaning cache: ' + cache);
                        return caches.delete(cache);
                    }
                })
            );
        })
    );
    // console.log('WORKER: Activate cache: ' + versionStamp);
    return self.clients.claim();
});
// ..
// Fetch Service Worker Request Files
// ..
self.addEventListener('fetch', function(evt) {
    // Chrome Dev Tools Bug - Temporary Workaround
    // https://bugs.chromium.org/p/chromium/issues/detail?id=823392    
    if (evt.request.cache === 'only-if-cached' && evt.request.mode !== 'same-origin') {
        var oStrangeRequest = evt.request.clone();
        console.warn('Chrome Dev Tools. Request cache has only-if-cached, but not same-origin.', oStrangeRequest.cache, oStrangeRequest.mode, 'request redirect:', oStrangeRequest.redirect, oStrangeRequest.url, oStrangeRequest);
        return;
    }
    evt.respondWith(
        caches.match(evt.request).then(function(response) {
            return response || fetch(evt.request, { cache: 'no-store' });
        })
    );
});

manifest.json

{
  "name": "Babylon Canvas Tools",
  "short_name": "Babylon Canv",
  "theme_color": "#3B789A",
  "background_color": "#3B789A",
  "orientation": "any",  
  "display": "browser",
  "start_url": ".",
  "icons": [
    {
      "src": "icons/icon-72x72.png",
      "sizes": "72x72",
      "type": "image/png"
    },
    {
      "src": "icons/icon-96x96.png",
      "sizes": "96x96",
      "type": "image/png"
    },
    {
      "src": "icons/icon-128x128.png",
      "sizes": "128x128",
      "type": "image/png"
    },
    {
      "src": "icons/icon-144x144.png",
      "sizes": "144x144",
      "type": "image/png"
    },
    {
      "src": "icons/icon-152x152.png",
      "sizes": "152x152",
      "type": "image/png"
    },
    {
      "src": "icons/icon-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "icons/icon-384x384.png",
      "sizes": "384x384",
      "type": "image/png"
    },
    {
      "src": "icons/icon-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ]
}

Plus Toaster Popup to notify when server files change and auto update the cache… Its Beautiful :slight_smile:

So im putting all my efforts in the new toolkit :slight_smile:

I feel you :slight_smile:
Anyway the blenshape are supported by bjs serializer here:

and by the loader there:

Instances are also supported

But I’m not sure the entities have it so if you want to update the classes to add it, I will gladly merge the PR

Yo @Deltakosh … So how do i use instances in with the entities…

I see a instances AbstractMesh array… Do i just fill that out with different positions rotations and scale ??? … What is idGroupInstance on the AbstractMesh ???

I do not remember as I did it long time ago:) (and I’m on my phone now). But just search into 3dsmax exporter code base to see how it is used

It is in this file: