It is impossible to get to the ShapeMaterial field without gui

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
sherif
Posts: 1
Joined: Thu Sep 28, 2017 7:25 am

It is impossible to get to the ShapeMaterial field without gui

Postby sherif » Thu Sep 28, 2017 7:37 am

Hi
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
User avatar
Kunda1
Posts: 5081
Joined: Thu Jan 05, 2017 9:03 pm

Re: It is impossible to get to the ShapeMaterial field without gui

Postby Kunda1 » Mon Oct 09, 2017 2:31 pm

bump
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Kunda1
Posts: 5081
Joined: Thu Jan 05, 2017 9:03 pm

Re: It is impossible to get to the ShapeMaterial field without gui

Postby Kunda1 » Fri Oct 20, 2017 2:10 pm

wmayer wrote:ping
I know this is low priority in respect to getting 0.17 released. Nevertheless, is this something that is doable quickly?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features