how to set default lightning selection for the background of autodesk forge viewer? - autodesk-forge

I want to set a default background color for the forger viewer and want to use lightning selection as in the settings of the viewer. I could not find how can i set default value as in the below settings screen.

You can use the viewer.setLightPreset() for that.
The following blog post talks about how to find functions like that:
https://aps.autodesk.com/blog/change-viewer-settings

Related

Autodesk Forge Viewer: Hide all but selected

While using the autodesk forge viewer, if you select a part and right-click, there is an option to "hide selected". How can i make an option (button) to hide all but selected. Would this just be the "isolate" button?
Thanks!
Cheers!
Yes, "isolate" basically means "hide everything except this".
But if you'd like to modify the context menu anyway, that's possible, too: https://forge.autodesk.com/blog/customize-viewer-context-menu.

How to set Autodesk Setting to front?

I am having an app, which uses the Forge API. The UI displayed when pushing the Forge button "Settings" in "settingsTools group", overlaps one of my buttons.
However since my app zIndex is set (I am in react code) the click upon close of the setting UI, triggers my buttons instead of the close button.
Hence, I am intrested in setting the "Settings UI" to front so the click upon the close button triggers close. My front end code is in the react framework hence a simple zIndex parameter to set could do the trick.
How can I do so?
Instead of playing with hacky ways, consider using the docking panels provided by Forge Viewer. From my understanding, it can also work with React.
To elaborate the usefulness of panels, consider the following example:
Here I have a floating div, showing me some information related to the model. Obviously I've set a high z-index, to bring it upfront and here I have the same problem as you have - when opening things like settings, properties, model tree, etc, they all appear behind my div. Moreover, when changing the size of the window, I have to deal with my div position.
On the other hand, Forge Viewer uses everywhere panels, like this very Settings dialog.
Thus, if you would place your button into this kind of panel, this would save you from headache with z-index, docking, rescaling etc, as all the panels are working nice one with each other, as the below Robot Control Panel:
For more information on how to create a panel, I suggest checking http://learnforge.autodesk.io/#/viewer/extensions/panel

Transparent Highlight of Selection in Forge Viewer

Something has changed in the way the Forge Viewer is displaying our selected objects. First when we selected a window it would stay transparent, and was only highlighted with the default or given color. Right now the windows are rendered non-transparent with the default or given color:
This only happens at the first selection, the first selected object will stay non-transparent until you pan/zoom the scene or Zoom in (F) on another object:
I already tried on every selection:
viewer.impl.invalidate(true);
This will reset the pre-selected object to his original transparent material, but the selected object will be highlighted un-transparent every time.
I do not use a custom selection here, this is just default behaviour. Any advice?
This issue was fixed in the Viewer version 6.4 Currently we are at version 7 let me know if the problem persists but should be good to go now.

Forge Viewer show UI while adding Markups

I'm working with the MarkupsCore extension and want to keep my added UI open inside the viewer while adding or working with Markups.
From what I can tell once I call enterEditMode the UI won't return until I hide all of my Markups. The buttons I have added don't seem to change state and their still marked as visible when I'm debugging, yet they don't show.
I tried setVisibility on the objects but the method returns false because it evaluates the buttons as not hidden.
Is there something I'm missing?
If I'm understanding your question right, that's expected as you cannot move/rotate/zoom the model when editing the Markups, mainly because these are SVG shapes on top of the view. Ideally you should also keep the Viewer state to restore when viewing the markups later.

Implementing color themes for my app

I'm developing a WP8 app, and I'm wondering what's the correct way to implement color themes for my app.
Currently, I'm changing the phone's theme resources described here, however I'm wondering, whether that has any side-effects I should know of?
For instance: if I change the color of PhoneBackgroundBrush, will that mean that I'll change the bg color of every app and the phone itself? Or, will the change be only current-app-wide?
I change theme resources like so:
(App.Current.Resources["PhoneBackgroundBrush"] as SolidColorBrush).Color = Colors.White;
Imagine the consequences if a single instance of these were shared across applications, you could do some real damage with something like that...
You're only changing the resource for the current app. You're sandboxed and safe
The Code that you used
(App.Current.Resources["PhoneBackgroundBrush"] as SolidColorBrush).Color = Colors.White;
Will change the default color of the pages and controls of your app. Not any other app .
These settings get applied to the Application when it is activated. So every app by default has a PhoneBackgroundBrush which is the default theme for the Phone.
But if your app contains Multiple pages with different color then it is always favorable to go by individual Grid
<Grid x:Name="LayoutRoot" Background="Red"></Grid>
Along with providing
App.Current.Resources["PhoneBackgroundBrush"] as SolidColorBrush).Color = Colors.White
For a common application background color :)
All the Properties mentioned in Themes for windows phone
are meant for a particular application. And you can select any of the following for a global application background color/theme from them.