Im using FreeCad as a library for a file conversion program
Ie calling from FreeCAD import Base load my input file (usually step) and then write my output format.
Recently I wanted to access the ShapeMaterial variable, which is located in the ViewObject field.
The problem is that the view object is not initialized if there is no gui.
This makes sense but in this case The ShapeMaterial is not an attribute of the ViewObject and should not be stored there.
Can you please provide a workaround ? or how can I get the material without FreeCADGui.showMainWindow() and ImportGui.insert
Related bug report https://www.freecadweb.org/tracker/view.php?id=3199