English 中文(简体)
自动桌面 forge 查看器 v7 - 设置Theming Color
原标题:Autodesk Forge Viewer v7 - setThemingColor
I hope somebody can help me with a question about the setThemingColor function for the Autodesk Forge Viewer. Basically my issue is that when I run the viewer.setThemingColor(dbId, new Vector4( 1, 1, 1, 1 ), null, true ) from within my code nothing happens, and the element does not get a new color. What I have tried: 1) If I try to run exactly the same line of code in the browser on the NOP_VIEWER it works, but only if it is a new dbId and not the one which had just been run from within my code. 2) I have tried to make sure to find the leaf dbId and use this. Did not have any effect. 3) I have tried to add the model to the function call: viewer.setThemingColor(dbId, new Vector4( 1, 1, 1, 1 ), model, true ) 4) I have tried to run the function on the level of the model: model.setThemingColor(dbId, new Vector4( 1, 1, 1, 1 )); viewer.impl.invalidate(true); 5) I have from within my code tested viewer.isolate(dbId) to make sure I have access to the viewer instance. And this works. Is anybody else experiencing the same issue or can replicate the bug? I hope somebody can help us out. EDIT: More infor after Petr Broz answer: "What version of the viewer are you using?": We are using v. 7.* "Do you see any error logs in the console after setting the theming color?": I see no error logs. "At what point in time are you trying to set the color (for example, after the GEOMETRY_LOADED_EVENT)?": I use a onClick event on button, so it is after GEOMETRY_LOADED_EVENT ANSWER: I found the solution. I had to import THREE as a global. /* global THREE */ instead of import {Vector4d} from "three"
最佳回答
Here s a quick codepen setting the theming color on a pre-configured dbID (roof of the house), using viewer version 7.* (currently 7.10): https://codepen.io/petrbroz/pen/WNbYXWz. It d be helpful if we had some additional info, for example: What version of the viewer are you using? Do you see any error logs in the console after setting the theming color? At what point in time are you trying to set the color (for example, after the GEOMETRY_LOADED_EVENT)? Alternatively, if you don t mind sharing a live link to your app or your Forge app config, please send us an email to forge (dot) help (at) autodesk (dot) com, and we ll investigate the issue from our end.
问题回答
I have the same problem. Could you please explain what you mean with /* global THREE */ ?




相关问题
angleToTrueNorth is null for Navisworks translated model

When translating a Navisworks model to SVF, the value for angleToTrueNorth from model.getData().metadata[ custom values ].angleToTrueNorth is not available. Where else can I find it?

What is a uploadable maximum file size?

I tries uploading 200MB Solid works format file, and it worked out. Don t consider request timeout issue. I will extend it to 30min How about 500MB or 1GB? If I can upload 500MB solid works file(or ...

Convert Urn from item version have problem

I m try to convert from item version get derivative urn but may be have something wrong. I know we are using base64 to encoder, but when I m try convert it have some missmatch: Example: I have item ...

Quick way to create central file in ACC from APS API

I m finding a API can easier to move around 100 files central download from diffrence project storage in local computer to new project, and what we are doing manual here is oepn Revit and save central ...

热门标签