[fixed] [regression] material editor cannot be used/opened

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

[fixed] [regression] material editor cannot be used/opened

Post by uwestoehr »

- create a FEM analysis
- use the menu Models -> Material -> Material editor

result:

Code: Select all

 Running the Python command 'FEM_MaterialEditor' failed:
Traceback (most recent call last):
  File "D:\FreeCAD-build\Mod\Fem\femcommands\commands.py", line 364, in Activated
    FreeCADGui.doCommand("MaterialEditor.openEditor()")
  File "<string>", line 1, in <module>
  File "D:\FreeCAD-build\Mod\Material\MaterialEditor.py", line 752, in openEditor
    editor = MaterialEditor(obj, prop)
  File "D:\FreeCAD-build\Mod\Material\MaterialEditor.py", line 93, in __init__
    self.updatePreviews(mat=material)
  File "D:\FreeCAD-build\Mod\Material\MaterialEditor.py", line 460, in updatePreviews
    mat = self.getDict()
  File "D:\FreeCAD-build\Mod\Material\MaterialEditor.py", line 417, in getDict
    root = model.invisibleRootItem()

'NoneType' object has no attribute 'invisibleRootItem'
This is a regression to FC 0.18.4.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22970 (Git)
Build type: Release
Branch: master
Hash: 59c50053a651a42434934b589918724510d5615e
Python version: 3.6.8
Qt version: 5.12.6
Coin version: 4.0.0a
OCC version: 7.4.0.beta
Locale: German/Germany (de_DE)
Last edited by uwestoehr on Mon Nov 09, 2020 6:36 pm, edited 1 time in total.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [regression] material editor cannot be used/opened

Post by bernd »

by Python ...

Code: Select all

import MaterialEditor
MaterialEditor.openEditor()

Code: Select all

>>> MaterialEditor.openEditor()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\0_BHA_privat\progr\FreeCAD_0.19.xxxxx_Py3Qt5\Mod\Material\MaterialEditor.py", line 752, in openEditor
    editor = MaterialEditor(obj, prop)
  File "C:\0_BHA_privat\progr\FreeCAD_0.19.xxxxx_Py3Qt5\Mod\Material\MaterialEditor.py", line 93, in __init__
    self.updatePreviews(mat=material)
  File "C:\0_BHA_privat\progr\FreeCAD_0.19.xxxxx_Py3Qt5\Mod\Material\MaterialEditor.py", line 460, in updatePreviews
    mat = self.getDict()
  File "C:\0_BHA_privat\progr\FreeCAD_0.19.xxxxx_Py3Qt5\Mod\Material\MaterialEditor.py", line 417, in getDict
    root = model.invisibleRootItem()
AttributeError: 'NoneType' object has no attribute 'invisibleRootItem'
>>> 
there have bees some code changes here lately ... git commit 0f875168b675
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [regression] material editor cannot be used/opened

Post by bernd »

if started from Arch the Material Editor works ...
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [regression] material editor cannot be used/opened

Post by bernd »

it works if started this way ...

Code: Select all

import MaterialEditor
MaterialEditor.editMaterial({'':''})
but not if started this way ...

Code: Select all

import MaterialEditor
MaterialEditor.editMaterial({})
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: [regression] material editor cannot be used/opened

Post by bernd »

User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [regression] material editor cannot be used/opened

Post by uwestoehr »

bernd wrote: Mon Nov 09, 2020 6:31 pm git commit 6455352
many thanks! That was amazingly quick.
Post Reply