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

 
 

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

Submitted by:  francesco <francio>
Submitted on:  Wed 21 May 2014 12:45:01 AM UTC  
 
Category: GUISeverity: 3 - Normal
Item Group: Functionality errorStatus: Fixed
Privacy: PublicAssigned to: Benedict Verhegghe <bverheg>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 22 May 2014 10:03:20 AM UTCfrancioOpen/ClosedOpen=>Closed
    Thu 22 May 2014 09:35:23 AM UTCbverhegStatusIn Progress=>Fixed
    Wed 21 May 2014 09:35:01 AM UTCbverhegCategoryRendering=>GUI
      Item GroupFatal Error=>Functionality error
      StatusNone=>In Progress
      Assigned toNone=>bverheg

    Back to the top


    Powered by Savane 3.1-cleanup1