{"id":16473055,"url":"https://github.com/binki/babylonjs-blender-loader","last_synced_at":"2025-04-04T17:15:38.292Z","repository":{"id":143134170,"uuid":"77502869","full_name":"binki/babylonjs-blender-loader","owner":"binki","description":"Webpack loader for babylonjs-blender","archived":false,"fork":false,"pushed_at":"2017-04-01T18:08:26.000Z","size":98,"stargazers_count":3,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T19:28:32.026Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-28T04:28:30.000Z","updated_at":"2023-09-19T04:43:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"dfebdbdd-b8d5-41a2-9952-e535f7b0a53d","html_url":"https://github.com/binki/babylonjs-blender-loader","commit_stats":null,"previous_names":["binki/webpack-babylonjs-blender"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbabylonjs-blender-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbabylonjs-blender-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbabylonjs-blender-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binki%2Fbabylonjs-blender-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binki","download_url":"https://codeload.github.com/binki/babylonjs-blender-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217220,"owners_count":20903009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T12:25:07.362Z","updated_at":"2025-04-04T17:15:38.286Z","avatar_url":"https://github.com/binki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Load Blender `.blend` files as BabylonJS objects through a webpack\r\nloader.\r\n\r\nUnfortunately, textures are not supported yet. The BabylonJS API makes\r\nit really hard to load things yet because it requires textures to be\r\nloaded through its own XHR mechanism and its own loader stuff. It\r\ndoesn’t even really have a proper plain JavaScript object loader, so\r\nwe have to feed it stringified JSON as a `data:` URI. To try to reduce\r\nthe amount of necessary refactoring later if texture loading is ever\r\nsupported properly, this loader loads an object with an API that wraps\r\n`SceneLoader`.\r\n\r\n# Usage\r\n\r\nThe BabylonJS\r\n[`SceneLoader`](http://doc.babylonjs.com/classes/2.5/SceneLoader)\r\noffers `ImportMesh()` to load a single mesh to an existing scene,\r\n`Load()` to generate a new scene from the entire file, and `Append()`\r\nto mix an entire file to an existing scene. The scene provided by this\r\nloader will have equivalent methods except that you must pass it\r\n`SceneLoader` and omit the `rootUrl` and `sceneFilename`\r\narguments. Thus, it has the following API:\r\n\r\n* `loadedBlend.dataUri`: the raw data as a `data:` URI. If you are\r\n  working around the lack of texture support, you may need this, but\r\n  this should be considered deprecated because of the possibility that\r\n  textures may eventually be handled correctly (through webpack image\r\n  loaders).\r\n\r\n* `loadedBlend.ImportMesh(sceneLoader, meshesNames, scene, onsuccess, progressCallBack, onerror)`\r\n\r\n* `loadedBlend.Load(sceneLoader, engine, onsuccess, progressCallBack, onerror)`\r\n\r\n* `loadedBlend.Append(sceneLoader, scene, onsuccess, progressCallBack, onerror)`\r\n\r\nAn example:\r\n\r\n```javascript\r\nvar engine = new BABYLON.Engine(document.getElementById('render-canvas'), true);\r\nvar scene = new BABYLON.Scene(engine);\r\nrequire('./scene.blend').Append(BABYLON.SceneLoader, scene, loadedScene =\u003e {/*onsuccess*/}, x =\u003e {/*onprogress*/}, ex =\u003e {/*onerror*/});\r\nengine.runRenderLoop(() =\u003e scene.render());\r\n```\r\n\r\n## Prerequisites\r\n\r\nYou must have `blender` in your `PATH` and have the [BabylonJS Blender\r\nExporter](https://github.com/BabylonJS/Babylon.js/tree/master/Exporters/Blender)\r\nplugin installed (but not necessarily activated) in Blender. See more\r\ndetailed instructions in the documentation for\r\n[`babylonjs-blender`](https://www.npmjs.com/package/babylonjs-blender).\r\n\r\n## Installation\r\n\r\n    $ npm install --save babylonjs-blender-loader\r\n\r\n## Configuration\r\n\r\nYou are free to write\r\n`require('babylonjs-blender-loader!../models/person.blend')`, but\r\nthat is clunky and you probably want to use this loader for all\r\n`.blend` files. To do so, configure webpack to use this loader as the\r\ndefault for `.blend` files:\r\n\r\n```javascript\r\n({\r\n    module: {\r\n        loaders: [\r\n            { test: /\\.blend$/, loader: 'babylonjs-blender-loader', },\r\n        ],\r\n    },\r\n})\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinki%2Fbabylonjs-blender-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinki%2Fbabylonjs-blender-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinki%2Fbabylonjs-blender-loader/lists"}