Wed 21 May 2014 09:35:01 AM UTC, comment #1:
This is actually a combination of two problems:
1. When saving a non-image background, the bgimage settings is saved as None, and restored as 'None', hence trying to create a background image when it should not. This is fixed in e31cc96: bgimage is now properly stored as an empty string '' and solid backgrounds can now be saved.
2. Solid backgrounds are done by just clearing the canvas background to the background color. Non-solid backgrounds (color gradients or images) however require the creation of a geometry with the specified color gradient/image texture, and are therefore created/rendered jus like any other Drawable on the canvas. This creates a chicken and egg problem, because all the created drawables inherit the current canvas settings as default rendering params, but the background Drawable is created during the initialization of the canvas, when the current canvas (pf.canvas) has not been set yet.
This is not so easy to fix, as it will require some changes to the initialization of the Drawables. As a precaution, the background settings can currently only be saved when a solid background is choosen.
The item group has been changed to functionality error, as the error is no longer fatal. Users having a problem with startup, can just change/remove the 'bgcolor' and 'bgimage' in their user configuration file.
|
Wed 21 May 2014 12:45:01 AM UTC, original submission:
after saving a default color background I cannot open pyformex anymore due to this error. It is related to the read/write to the conf file. removing the lines from the conf file fixed the problem
Traceback (most recent call last):
File "./pyformex", line 67, in <module>
sys.exit(main.run(sys.argv[1:]))
File "/home/Francesco/pyformex/pyformex/pyformex/main.py", line 667, in run
res = guimain.startGUI(args)
File "/home/Francesco/pyformex/pyformex/pyformex/gui/guimain.py", line 1394, in startGUI
pf.GUI.viewports.changeLayout(1)
File "/home/Francesco/pyformex/pyformex/pyformex/gui/viewport.py", line 1616, in changeLayout
self.addView()
File "/home/Francesco/pyformex/pyformex/pyformex/gui/viewport.py", line 1483, in addView
canv.initializeGL() # Initialize OpenGL context and camera
File "/home/Francesco/pyformex/pyformex/pyformex/gui/viewport.py", line 896, in initializeGL
self.glinit()
File "/home/Francesco/pyformex/pyformex/pyformex/opengl/canvas.py", line 928, in glinit
self.reset()
File "/home/Francesco/pyformex/pyformex/pyformex/opengl/canvas.py", line 913, in reset
self.setBackground(self.settings.bgcolor, self.settings.bgimage)
File "/home/Francesco/pyformex/pyformex/pyformex/opengl/canvas.py", line 809, in setBackground
self.createBackground()
File "/home/Francesco/pyformex/pyformex/pyformex/opengl/canvas.py", line 824, in createBackground
actor = GeomActor(F,name='background',rendermode='smooth',color=[self.settings.bgcolor],texture=image,rendertype=3,opak=True,lighting=False)
File "/home/Francesco/pyformex/pyformex/pyformex/opengl/drawable.py", line 448, in _init_
Base.__init__(self)
File "/home/Francesco/pyformex/pyformex/pyformex/opengl/drawable.py", line 388, in _init_
Attributes.__init__(self, pf.canvas.drawoptions)
AttributeError: 'NoneType' object has no attribute 'drawoptions'
|