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

Mesh WB: Colors set prior to saving aren't retained when re-opening file (FEM code still needs implementation) #6131

Closed
FreeCAD-Bug-Importer opened this issue Feb 7, 2022 · 12 comments · Fixed by #13698
Labels
Bug This issue or PR is related to a bug Color Regarding the color handling UI/UX WB FEM Related to the FEM Workbench WB Mesh Related to the Mesh Workbench
Milestone

Comments

@FreeCAD-Bug-Importer
Copy link
Collaborator

FreeCAD-Bug-Importer commented Feb 7, 2022

Issue imported from https://tracker.freecad.org/view.php?id=4499

  • Reporter: johnwang
  • Date submitted: 11/22/2020
  • FreeCAD version:
  • Category: Bug
  • Status: new
  • Tags:

Original report text

Talked in the post:
https://forum.freecadweb.org/viewtopic.php?f=3&t=52341

Using this code to generate a FemMesh object with two triangle elements. Then changed the color of one element. But after saving and reopen, the color is lost.

Steps to reproduce

Use this code to create the file, then save and reopen.

import Fem

a = Fem.FemMesh()

a.addNode(0,    0,    0,    1)
a.addNode(10,    0,    0,    2)
a.addNode(5,    10,    0,    3)
a.addNode(15,    15,    0,    4)

a.addFace([1,2,3], 1)
a.addFace([2,4,3], 2)
obj = FreeCAD.ActiveDocument.addObject("Fem::FemMeshObject")
#obj.Placement.Base = FreeCAD.Vector(2, 0, 0)
obj.FemMesh = a

obj.ViewObject.ElementColor = {1:(1,0,0)}

image

FreeCAD Info

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22900 (Git)
Build type: Release
Branch: master
Hash: b7b4250b7fe5e98bcdbe2a7c7be256132b35cd3d
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)

Other bug information

  • Priority: normal
  • Severity: major
  • Category: Bug
  • **OS: Windows 10 **
  • Updated: 2/4/2022
@FreeCAD-Bug-Importer FreeCAD-Bug-Importer added Bug This issue or PR is related to a bug WB FEM Related to the FEM Workbench labels Feb 7, 2022
@wperkins
Copy link

wperkins commented Mar 11, 2022

I also experience this with meshes created by the Mesh Design WB. Recreate as follows:

  1. With Part WB, create a cube.
  2. Right click on cube and "Set Colors..."
  3. Color some cube faces.
  4. With the Mesh WB, "Create mesh from shape". Check "Apply face color ..." and "Define segments ...". A colorful mesh is created. This can be exported as *.obj and colors are correct.
  5. Save and close project.
  6. Reopen project and the mesh is all gray.

The attached was created with Revision 8204fc8 (I built myself).
mesh-color-test.zip

OS: Linux Mint 20.1 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.20.28002 (Git)
Build type: Unknown
Branch: master
Hash: 8204fc8
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, OCC 7.5.2
Locale: English/United States (en_US)
Installed mods:

  • Lithophane

@luzpaz
Copy link
Contributor

luzpaz commented Mar 11, 2022

@wperkins please edit the above comment and add your full About info. Thanks

@luzpaz luzpaz added the WB Mesh Related to the Mesh Workbench label Mar 11, 2022
@luzpaz
Copy link
Contributor

luzpaz commented Apr 13, 2022

Confirmed by following @wperkins's instructions on

OS: Ubuntu Core 20 (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.28690 (Git)
Build type: Release
Branch: master
Hash: 5ab7d17f67969b12c53b7bb8715f198093fcf56b
Python 3.8.10, Qt 5.15.3, Coin 4.0.0, OCC 7.6.1
Locale: English/United States (en_US)
Installed mods: 

Edit: bumped forum thread

@luzpaz luzpaz changed the title Can't save color Mesh WB: Colors set prior to saving aren't retained when re-opening file Apr 13, 2022
@luzpaz
Copy link
Contributor

luzpaz commented May 3, 2022

Can confirm on

OS: Ubuntu Core 20 (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.28786 (Git)
Build type: Release
Branch: master
Hash: ccc8ac65c5a04f7f6690c29dc08225216f201e85
Python 3.8.10, Qt 5.15.3, Coin 4.0.0, OCC 7.6.1
Locale: English/United States (en_US)

@luzpaz luzpaz added the UI/UX label May 3, 2022
@luzpaz luzpaz added the Color Regarding the color handling label May 16, 2022
wwmayer added a commit that referenced this issue May 17, 2022
…-opening file

Note: A mesh feature must have a PropertyColorList property with the name FaceColors or VertexColors. The colors won't be set when loading a project but in the context-menu there is the function 'Display colors'
@luzpaz luzpaz added Missing: feedback If feedback is requested Missing: confirmation Missing confirmation from other testers labels May 25, 2022
@luzpaz
Copy link
Contributor

luzpaz commented Jul 8, 2022

Mesh and FEM are two separated and independent wb but the problem exists in both of them. The commit handles it for the former and for the latter it still must be implemented.

@wwmayer shall I close this ticket and open a separate ticket for the FEM portion of the fix?

@luzpaz
Copy link
Contributor

luzpaz commented Jul 26, 2022

@berniev any progress on this?

@berniev
Copy link
Contributor

berniev commented Jul 26, 2022

Not one I'm working on. The commit was in my fork and likely an accident. But how does that even show up in the main repo?

@wwmayer
Copy link
Contributor

wwmayer commented Jul 27, 2022

@wwmayer shall I close this ticket and open a separate ticket for the FEM portion of the fix?

It's fine as it is.

@luzpaz luzpaz changed the title Mesh WB: Colors set prior to saving aren't retained when re-opening file Mesh WB: Colors set prior to saving aren't retained when re-opening file (FEM code still needs implementation) Jul 27, 2022
@luzpaz luzpaz removed the Missing: feedback If feedback is requested label Jul 27, 2022
coreyoconnor pushed a commit to coreyoconnor/FreeCAD that referenced this issue Aug 5, 2022
…when re-opening file

Note: A mesh feature must have a PropertyColorList property with the name FaceColors or VertexColors. The colors won't be set when loading a project but in the context-menu there is the function 'Display colors'
@luzpaz
Copy link
Contributor

luzpaz commented Feb 11, 2023

@coreyoconnor does your branch fix this issue?

@luzpaz luzpaz added the Missing: feedback If feedback is requested label Feb 11, 2023
@coreyoconnor
Copy link

@luzpaz unfortunately - my branch is just a merge of @sliptonic 's branch. I do not know if the change impacts this issue.

@luzpaz
Copy link
Contributor

luzpaz commented Mar 13, 2024

@wwmayer in your opinion, should this be addressed pre or post 1.0 release ?

@wwmayer
Copy link
Contributor

wwmayer commented Mar 13, 2024

It's not a show stopper issue. So, doing it after 1.0 shouldn't be a problem.

@luzpaz luzpaz added this to the Post 1.0 milestone Mar 13, 2024
@luzpaz luzpaz removed Missing: confirmation Missing confirmation from other testers Missing: feedback If feedback is requested labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This issue or PR is related to a bug Color Regarding the color handling UI/UX WB FEM Related to the FEM Workbench WB Mesh Related to the Mesh Workbench
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants