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

Draft WB UI: inconsistent temporary Object creation in the Tree View #13700

Closed
2 tasks done
marcuspollio opened this issue Apr 29, 2024 · 5 comments · Fixed by #13778 or #13815
Closed
2 tasks done

Draft WB UI: inconsistent temporary Object creation in the Tree View #13700

marcuspollio opened this issue Apr 29, 2024 · 5 comments · Fixed by #13778 or #13815
Labels
Feature FR for improvements or new features UI/UX WB Draft Related to the Draft Workbench

Comments

@marcuspollio
Copy link
Contributor

marcuspollio commented Apr 29, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

When creating Drafting Objects (via Toolbar, Shortcuts or Menu), the Line, Polyline, B-Spline and Bézier curve Tools create a temporary "Part_3D_object" icon in the Tree View, while the other Tools (such as Arc, Circle, Rectangle, etc.) do not.
When the Task is finished (e.g. your Line is fully drawn), the icon in the Tree View changes to either Wire (N-Linear), Curve or Polygon.

How to recreate:

  • Launch FreeCAD and in the Start page choose 2D Draft. Make sure the Tree View is visible.
  • Create a Line (LI shortcut) and see a new Part icon being added in the Tree View under your Document. See the upper part of the screenshot below.
  • Cancel the action (Esc), the Part icon in the Tree View disappears.
  • Create a Circle (CI shortcut) and see that no Part icon is added in the Tree View, until you finish your Task (e.g. set the center and the radius), then a Curve icon is added in the Tree View. See the lower part of the screenshot below.
Screenshots

Draft_Tree

Proposed solution:

  • Make all Draft Tools consistent and do not add a temporary Part_3D_object icon in the Tree View until the task is finished. Many Draft Tools already perform that way (see above the list). Arch WB and Sketcher WB perform that way.
  • Or: make all Draft Tools consistent and add the right icon (Wire/N-Linear for Line, Polyline, etc.) as soon as the Tool is called. Part Design WB and TechDraw WB perform that way.

Full version info

OS: GNU/Linux Ubuntu 22.04 LTS based distro (DE: GNOME/pop)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.36997 (Git)
Build type: Release
Branch: main
Hash: bff1efd665dc2f553ac57e5bef35c44a879999c2
Python 3.10.12, Qt 5.15.3, Coin 4.0.0, Vtk , OCC 7.5.1

Subproject(s) affected?

Draft

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@maxwxyz maxwxyz added WB Draft Related to the Draft Workbench UI/UX Feature FR for improvements or new features labels Apr 29, 2024
@farleyrunkel
Copy link
Contributor

Hello, @marcuspollio , could you please add more images.

@marcuspollio
Copy link
Contributor Author

Hi @farleyrunkel just added some screenshots in the collapsed section of the first post.

@yorikvanhavre
Copy link
Member

That temporary object was there basically so the tool could snap to itself. Which I think is still a good thing. But indeed the temp object is annoying. Two possibilities:

  1. We remove the temp object and adapt the snap system so it can work with a non-existing object (the polyline being drawn) - long path
  2. We make the temp object invisible - short path

I'm inclined to the short path. What do you think @Roy-043 ?

@Roy-043
Copy link
Contributor

Roy-043 commented Apr 30, 2024

I agree.

@marcuspollio
Copy link
Contributor Author

marcuspollio commented May 2, 2024

@yorikvanhavre and @Roy-043

Thank you for having a look !

With PR 13778 (or commit b45bf9b) applied, it only fixes this issue for the Line and the Cubic Bézier Curve tools.

For the Polyline, the B-Spline and the Bézier Curve, now there is an even more odd item in the Tree View when using these three tools :

Draft-bug

How to reproduce:

  • Launch FreeCAD and in the Start page choose 2D Draft. Make sure the Tree View is visible.
  • Create a Polyline, a B-Spline or a Bézier Curve, click the base point in the 3D view (n°0 on the screenshot above), nothing happens, set a second point (n°1), this odd icon appears in the Tree View, then continue (n°2,3 and so on) until your Object is fully set. When double-clicking (or closing in the Task panel), the icon in the Tree View changes into a Wire or BSpline.

Any clue why is it the case ?

Roy-043 added a commit to Roy-043/FreeCAD that referenced this issue May 3, 2024
FreeCAD#13778 introduced `self.obj.ViewObject.ShowInTree = False` to hide the temporary object. But objects that are hidden in the tree are displayed in the tree when they are selected in the 3D view. This selection occurs during commands that take more than 2 points. The solution is to change `self.obj.ViewObject.Selectable` on mouse button up/down.

Fixes FreeCAD#13700.
yorikvanhavre pushed a commit that referenced this issue May 6, 2024
#13778 introduced `self.obj.ViewObject.ShowInTree = False` to hide the temporary object. But objects that are hidden in the tree are displayed in the tree when they are selected in the 3D view. This selection occurs during commands that take more than 2 points. The solution is to change `self.obj.ViewObject.Selectable` on mouse button up/down.

Fixes #13700.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature FR for improvements or new features UI/UX WB Draft Related to the Draft Workbench
Projects
None yet
5 participants