Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sketcher] Change HeadlightIntensity entering and exiting Edit Mode #14013

Merged

Conversation

Syres916
Copy link
Contributor

Handle the situation where the user has a hard crash in Edit Mode by resetting parameter on entering 3D view.

Fixes #13989

With PR applied to default material:

HeadlightIntensity50

versus current situation of being unable to determine where the sketch geometry is against the object behind.

@github-actions github-actions bot added Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD WB Sketcher Related to the Sketcher Workbench labels May 14, 2024
@prokoudine
Copy link

This is vastly better than permanently applying a lower headlight intensity value!

@@ -69,6 +69,14 @@ int View3DSettings::stopAnimatingIfDeactivated() const

void View3DSettings::applySettings()
{
// Check if Sketcher Edit Mode exited cleanly
int overMaxHeadlightIntensity = 101;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be const.

"User parameter:BaseApp/Preferences/View");

// This should not be needed but just incase
int overMaxHeadlightIntensity = 101;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we eliminate this duplication?

@chennes chennes merged commit e7c11a0 into FreeCAD:main May 27, 2024
9 checks passed
@0penBrain
Copy link
Contributor

Hi there, a bit late on this one but I don't really understand it.
If I'm correct, the goal is to change the lighting intensity when in Sketcher mode.
But here it plays with 'HeadlightIntensity' which will change the setting for all open views. Isn't that a bit weird?
Shouldn't this feature be integrated in 'TempoVis' or similar?

@maxwxyz
Copy link
Collaborator

maxwxyz commented May 28, 2024

@Syres916 with the solution implemented it's too dark to see for light themes:
grafik
So not sure if this is the best fix for this issue. What about just disabling ambient light when in Sketcher?

@FreeCAD/design-working-group FYI

@Syres916
Copy link
Contributor Author

Morning @0penBrain , the goal for me is quite simple, have the same user experience creating a sketch in current main as in 0.21.x branch. For the past several weeks the situation with default settings has been completely unacceptable, see the screenshot in the issue description of #13989 How it's fixed as long as it doesn't involve iterating through all the objects of a document is irrelevant to me. Completely open to tested solutions though I have to say that Themes shouldn't dictate core code, that is the tail wagging the dog, IMHO.

@maxwxyz
Copy link
Collaborator

maxwxyz commented May 28, 2024

@Syres916 yes agreed. But now also images are dark and that is a problem when tracing sketches. Also trying to select external geometry as reference is now was harder as all has become dark. This has nothing to do with themes.

@Syres916
Copy link
Contributor Author

If you're not happy with the change revert the PR.

@FEA-eng
Copy link
Contributor

FEA-eng commented May 28, 2024

If you're not happy with the change revert the PR.

I wouldn't do it as long as a new fix is ready. The current behavior is much better than before the PR when basic geometry was invisible in all sketches based on the existing geometry.

@prokoudine
Copy link

prokoudine commented May 28, 2024

I don't know the technical details of how Coin works, but here is what Blender can do: you can disable light source for a particular object. People use that frequently when they need to insert video footage of still images into 3D scenes and display them in original fidelity. Here is a fairly recent tutorial how to disable a light source for an object: https://www.youtube.com/watch?v=WacqnIJj4Jw

So maybe disable light source for all imported images and show them 'as is', while displaying geometry with reduced highlight intensity?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD WB Sketcher Related to the Sketcher Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sketcher geometry not visible on the existing 3D geometry with default colors
6 participants