Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/assets/asset-handler/assets/erp-texture-cube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { getDependUUIDList } from '../utils';
import { AssetHandler } from '../../@types/protected';
import { TextureCubeAssetUserData } from '../../@types/userDatas';
import { makeDefaultTextureCubeAssetUserData } from './image/utils';
import { GlobalPaths } from '../../../../global';
import utils from '../../../base/utils';
import { resolveCmftTool } from './utils/cmft';

type ITextureCubeMipMap = cc.TextureCube['mipmaps'][0];

Expand Down Expand Up @@ -142,7 +142,7 @@ export const ERPTextureCubeHandler: AssetHandler = {

console.log(`Start to bake asset {asset[${asset.uuid}](${asset.uuid})}`);

const cmdTool = join(GlobalPaths.staticDir, 'tools/cmft/cmftRelease64') + (process.platform === 'win32' ? '.exe' : '');
const cmdTool = resolveCmftTool();
await utils.Process.quickSpawn(cmdTool, vectorParams, {
stdio: 'inherit',
});
Expand Down
10 changes: 8 additions & 2 deletions src/core/assets/asset-handler/assets/gltf/reader-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import { fork } from 'child_process';
import path from 'path';
import { GlobalPaths } from '../../../../../global';
import assetConfig from '../../../asset-config';
import { createFbxConverter } from '../utils/fbx-converter';
import { createFbxConverter, hasFbxGlTfConvTool } from '../utils/fbx-converter';
import { modelConvertRoutine } from '../utils/model-convert-routine';
import { fbxToGlTf } from './fbx-to-gltf';
import { I18nKeys } from '../../../../../i18n/types/generated';
import { hasFbx2GltfTool } from '../utils/fbx2glTf';

class GlTfReaderManager {
private _map = new Map<string, GltfConverter>();
Expand Down Expand Up @@ -49,7 +50,12 @@ export async function getFbxFilePath(asset: Asset, importerVersion: string,) {
(userData.fbx ??= {}).smartMaterialEnabled = await assetConfig.getProject<boolean>('fbx.material.smart') ?? false;
}
let outGLTFFile: string;
if (userData.legacyFbxImporter) {
const shouldUseLegacyImporter = userData.legacyFbxImporter
|| (process.platform === 'linux' && !hasFbxGlTfConvTool() && hasFbx2GltfTool());
if (shouldUseLegacyImporter) {
if (!userData.legacyFbxImporter && process.platform === 'linux') {
console.warn('FBX-glTF-conv is unavailable on Linux, fallback to FBX2glTF.');
}
outGLTFFile = await fbxToGlTf(asset, asset._assetDB, importerVersion);
} else {
const options: Parameters<typeof createFbxConverter>[0] = {};
Expand Down
Loading
Loading