Fix OBJ loading without materials

This commit is contained in:
CODEX 2026-06-24 19:35:21 +03:00
parent bc8f70da9c
commit 376a4237fa
3 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,5 @@
const SDK_VERSION = "2.6.78"; // соответствует package.json
const SDK_URL = "./lib/dc-camera-context.es.js?v=3";
const SDK_URL = "./lib/dc-camera-context.es.js?v=4";
import { createLogo } from "./src/ui/logo.js";
import { applyToolbarVars } from "./src/ui/toolbar.js?v=3";

View File

@ -697,6 +697,6 @@
<input id="fileInput" class="hidden" type="file"
accept=".xkt,.glb,.gltf,.bim,.las,.laz,.obj,.stl">
<script type="module" src="/dcViewer.js?v=59"></script>
<script type="module" src="/dcViewer.js?v=60"></script>
</body>
</html>

View File

@ -126073,6 +126073,10 @@ function loadMTLs(modelNode, state, ok) {
var basePath = state.basePath;
var srcList = Object.keys(state.materialLibraries);
var numToLoad = srcList.length;
if (numToLoad === 0) {
ok();
return;
}
for (var i = 0, len = numToLoad; i < len; i++) {
loadMTL(modelNode, basePath, basePath + srcList[i], function () {
if (--numToLoad === 0) {