fix: no accessor overrides

This commit is contained in:
TrèsAbhi committed 2024-01-04 12:11:36 -06:00
1 parent 35d03c9e21
commit 2cf0bda352
3 files changed
+3 -14

No files matched your search

Binary file not shown.
+2 -2
View File
@@ -595,12 +595,12 @@ if (allTargets || targets?.includes('tankModels')) {
// if (id !== 24609) continue; // concept 1b
// if (id !== 16401) continue; // waffle
// if (id !== 7425) continue; // isu 152
if (id !== 10369) continue; // mino
// if (id !== 10369) continue; // mino
// if (id !== 4417) continue; // amx m4 mle
// if (id !== 7297) continue; // 60tp
// if (id !== 1) continue; // t-34
// if (id !== 6753) continue; // type 71
// if (id !== 5137) continue; // tiger ii
if (id !== 5137) continue; // tiger ii
// if (id !== 11633) continue; // forest witch
// if (id !== 6225) continue; // fv215b
+1 -12
View File
@@ -1,5 +1,4 @@
import { Document, Material, Node, Scene } from '@gltf-transform/core';
import { writeFile } from 'fs/promises';
import { range, times } from 'lodash';
import { dirname } from 'path';
import {
@@ -15,10 +14,6 @@ import { ScgStream, vertexAttributeVectorSizes } from '../streams/scg';
import { VertexAttribute } from '../streams/scpg';
import { readDVPLFile } from './readDVPLFile';
BigInt.prototype.toJSON = function () {
return this.toString();
};
const MAX_FLOAT32 = 2 ** 127 * (2 - 2 ** -23);
const vertexAttributeGLTFName: Partial<Record<VertexAttribute, string>> = {
@@ -59,8 +54,6 @@ export async function extractModel(
const buffer = document.createBuffer();
const materials = new Map<bigint, Material | bigint>();
writeFile('test.sc2.json', JSON.stringify(sc2, null, 2));
// create materials
await Promise.all(
sc2['#dataNodes'].map(async (node) => {
@@ -259,10 +252,6 @@ export async function extractModel(
);
}
if (hierarchy.name === 'chassis_track_L') {
console.log(minLODDistanceBatchId);
}
const batch =
component['rc.renderObj']['ro.batches'][
minLODDistanceBatchId!.toString().padStart(4, '0')
@@ -314,7 +303,7 @@ export async function extractModel(
indexedAttributes.forEach((attribute) => {
const name = vertexAttributeGLTFName[attribute];
if (!name) return; // no equivalent GLTF attribute
if (!name || primitive.getAttribute(name)) return;
const vertexSize = vertexAttributeGltfVectorSizes[attribute];
const attributeAccessor = document