bugpyFormex - Bugs: bug #42397, Problem saving background color ...

 
 

bug #42397: Problem saving background color to the conf file.

Submitter:  francesco <francio>
Submitted:  Wed 21 May 2014 12:45:01 AM UTC
   
 
Category:  GUI Severity:  3 - Normal
Item Group:  Functionality error Status:  Fixed
Privacy:  Public Assigned to:  bverheg
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 22 May 2014 10:03:20 AM UTC, comment #3: 

tested to save both image and non default background color. works in both cases.

francesco <francio>
Group Member
Thu 22 May 2014 09:35:23 AM UTC, comment #2: 

We believe this is fixed in 3a802bc.
Please test and close the bug.

Benedict Verhegghe <bverheg>
Group administrator
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.





Benedict Verhegghe <bverheg>
Group administrator
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'

francesco <francio>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bverheg (Posted a comment)
  • -email is unavailable- added by francio (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-05-22 francio Open/ClosedOpen Closed
    2014-05-22 bverheg StatusIn Progress Fixed
    2014-05-21 bverheg CategoryRendering GUI
        Item GroupFatal Error Functionality error
        StatusNone In Progress
        Assigned toNone bverheg

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code