NWD(FBX)转SVF格式异常:Forge Viewer中纹理无法加载
Hey there, let's break down what's causing your texture display issue and how to resolve it. This is a common gotcha with recent server-side changes to Autodesk's Derivatives API—even if you're still on the same v1.9.0 Forge NuGet package.
Root Cause
The key thing to understand is that Forge's model conversion logic runs on Autodesk's servers, not your local SDK. So even if your code hasn't changed, server-side updates can alter the output of the TranslateAsync operation. Here's the specific mismatch:
- When loading models directly from Autodesk's servers (using
env: 'AutodeskProduction'), the Derivatives API automatically optimizes textures and appends the_svf_tex_modsuffix to their filenames. Both theMaterials.jsonand the actual stored files use this suffix, so textures load correctly. - For your self-hosted workflow (loading from your own server), prior to April, the API kept original texture filenames in both the manifest and
Materials.json. Now, the server still optimizes textures and updatesMaterials.jsonto reference the_svf_tex_mod-suffixed names—but the root manifest only lists the original texture filenames. This means when you download assets based on the manifest, you're missing the optimized textures the viewer is requesting.
Recommended Solutions
1. Update Your Resource Download Logic
Instead of only pulling files listed in the root manifest, you need to:
- Parse the
Materials.jsonfile from your downloaded SVF assets - Extract all texture filenames referenced in the JSON (including those with the
_svf_tex_modsuffix) - Use
ObjectsApi.GetObjectAsyncto download each of these optimized textures from your Forge bucket
This ensures you have every asset the viewer expects to load textures.
2. Disable Texture Optimization During Conversion
If you'd rather keep using your original texture filenames, add an advanced parameter to your TranslateAsync payload to skip the server-side texture optimization:
{ "input": { "urn": "<your-model-urn>" }, "output": { "formats": [ { "type": "svf", "views": ["3d"], "advanced": { "textureProcessing": "none" } } ] } }
This tells the Derivatives API to leave your original texture filenames untouched, so Materials.json will reference the exact names stored in your bucket.
3. Temporary Workaround (Short-Term)
Your current fix of editing Materials.json to match the original texture filenames works as a quick band-aid, but it's not scalable for large numbers of models. Use this only while you implement one of the above long-term solutions.
Why Your SDK Version Didn't Stop This
Autodesk's Forge SDKs (like the NuGet package you're using) are just wrappers around the underlying REST API. The actual conversion heavy lifting happens on Autodesk's servers, so server-side updates can impact your workflow even if you haven't upgraded your SDK. This is standard for cloud-based API services.
内容的提问来源于stack exchange,提问作者torjuss

