brad

Hi all,

I was wondering whether anyone recently made Brad work using any kind of Linux?

I have installed the script into /opt/brad, added the symlink to my ~/.blender/scripts, and set the brad_path in brad.py. However, it seams that the script cannot load its libraries, and I am a real python noob, so anyone understanding this?

(...)
/home/lars/.blender/scripts/brad.py:710: SyntaxWarning: name 'Y' is used prior to global declaration
   global Y
No existing configuration file: using default configuration.
Traceback (most recent call last):
   File "<string>", line 1, in <module>
   File "/home/lars/.blender/scripts/brad.py", line 209, in <module>
     from brad_i18n import *
   File "/opt/brad/brad/brad/brad_i18n.py", line 428
SyntaxError: Non-ASCII character '\xe8' in file /opt/brad/brad/brad/brad_i18n.py on line 428, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Cheers, Lars.

Which version of Python are you on? It should be something in the low 2.x
range (I think it was written for 2.3). 3.x will most likely cause problems.

Thomas

···

On Mon, Jul 18, 2011 at 6:55 AM, Lars O. Grobe <[email protected]> wrote:

Hi all,

I was wondering whether anyone recently made Brad work using any kind of
Linux?

I have installed the script into /opt/brad, added the symlink to my
~/.blender/scripts, and set the brad_path in brad.py. However, it seams that
the script cannot load its libraries, and I am a real python noob, so anyone
understanding this?

(...)
/home/lars/.blender/scripts/**brad.py:710: SyntaxWarning: name 'Y' is used
prior to global declaration
global Y
No existing configuration file: using default configuration.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/lars/.blender/scripts/**brad.py", line 209, in <module>
   from brad_i18n import *
File "/opt/brad/brad/brad/brad_**i18n.py", line 428
SyntaxError: Non-ASCII character '\xe8' in file
/opt/brad/brad/brad/brad_i18n.**py on line 428, but no encoding declared;
see http://www.python.org/peps/**pep-0263.html<http://www.python.org/peps/pep-0263.html>for details

Cheers, Lars.

______________________________**_________________
Radiance-general mailing list
Radiance-general@radiance-**online.org<[email protected]>
http://www.radiance-online.**org/mailman/listinfo/radiance-**general<http://www.radiance-online.org/mailman/listinfo/radiance-general>

As the error message states, see PEP 263:
   http://www.python.org/dev/peps/pep-0263/

The encoding declaration specified there needs to go into the
file(s) failing to load.
Figuring out the actual encoding will be another challenge.
The value \xe8 may appear in several encodings.

-schorsch

···

On Mon, 18 Jul 2011, Lars O. Grobe wrote:

Hi all,

I was wondering whether anyone recently made Brad work using any kind of Linux?

I have installed the script into /opt/brad, added the symlink to my ~/.blender/scripts, and set the brad_path in brad.py. However, it seams that the script cannot load its libraries, and I am a real python noob, so anyone understanding this?

(...)
/home/lars/.blender/scripts/brad.py:710: SyntaxWarning: name 'Y' is used prior to global declaration
global Y
No existing configuration file: using default configuration.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/lars/.blender/scripts/brad.py", line 209, in <module>
   from brad_i18n import *
File "/opt/brad/brad/brad/brad_i18n.py", line 428
SyntaxError: Non-ASCII character '\xe8' in file /opt/brad/brad/brad/brad_i18n.py on line 428, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

--
Georg Mischler -- simulations developer -- schorsch at schorsch com
+schorsch.com+ -- lighting design tools -- http://www.schorsch.com/

Lars, the code is an e-accent-grave in the ISO 8859-1 character set. Current versions of Python can be made to accept that character set by adding a comment containing "coding=latin-1" in the first two lines of the module file.

This could be one of the following lines:
  # coding=latin-1
  # -*- coding: latin-1 -*- (for Emacs)
  # vim: set fileencoding=latin-1 : (for vim)

Hope this helps!

Francesco, if you're reading, could you pick up this change?

···

--
Randolph M. Fritz • [email protected]
Environmental Energy Technologies Division • Lawrence Berkeley Labs

Hi!

I hope I do not bother folks not interested in Blender, as this is a rather specific problem of a tool developed for supporting Radiance, not a problem related to Radiance itself.

Which version of Python are you on? It should be something in the low
2.x range (I think it was written for 2.3). 3.x will most likely cause
problems.

Thomas, I am using python 2.7.1 coming with my current Ubuntu, and tried various 2.4-2.5 releases of Blender.

Randolph, Georg, I added a line reading

# coding=latin-1

to the beginning of the file.

Still, I get a "mismatch in assignment". The full output of the Blender 2.49 session is:

···

--

lars@lars-laptop:~$ /usr/bin/blender
Compiled with Python version 2.7.1+.
Checking for installed Python... got it!
/home/lars/.blender/scripts/brad.py:113: SyntaxWarning: name 'config_path' is assigned to before global declaration
   global lang, editor_path, config_path, export_path, debug, brad_path, radiance_binaries_path, radiance_library_path, configparserok
/home/lars/.blender/scripts/brad.py:113: SyntaxWarning: name 'brad_path' is assigned to before global declaration
   global lang, editor_path, config_path, export_path, debug, brad_path, radiance_binaries_path, radiance_library_path, configparserok
/home/lars/.blender/scripts/brad.py:113: SyntaxWarning: name 'configparserok' is assigned to before global declaration
   global lang, editor_path, config_path, export_path, debug, brad_path, radiance_binaries_path, radiance_library_path, configparserok
/home/lars/.blender/scripts/brad.py:144: SyntaxWarning: name 'lang' is assigned to before global declaration
   global lang, editor_path, config_path, export_path, debug, brad_path, radiance_binaries_path, radiance_library_path, configparserok
/home/lars/.blender/scripts/brad.py:144: SyntaxWarning: name 'editor_path' is assigned to before global declaration
   global lang, editor_path, config_path, export_path, debug, brad_path, radiance_binaries_path, radiance_library_path, configparserok
/home/lars/.blender/scripts/brad.py:144: SyntaxWarning: name 'config_path' is assigned to before global declaration
   global lang, editor_path, config_path, export_path, debug, brad_path, radiance_binaries_path, radiance_library_path, configparserok
/home/lars/.blender/scripts/brad.py:144: SyntaxWarning: name 'export_path' is assigned to before global declaration
   global lang, editor_path, config_path, export_path, debug, brad_path, radiance_binaries_path, radiance_library_path, configparserok
/home/lars/.blender/scripts/brad.py:144: SyntaxWarning: name 'debug' is assigned to before global declaration
   global lang, editor_path, config_path, export_path, debug, brad_path, radiance_binaries_path, radiance_library_path, configparserok
/home/lars/.blender/scripts/brad.py:144: SyntaxWarning: name 'brad_path' is assigned to before global declaration
   global lang, editor_path, config_path, export_path, debug, brad_path, radiance_binaries_path, radiance_library_path, configparserok
/home/lars/.blender/scripts/brad.py:144: SyntaxWarning: name 'radiance_binaries_path' is assigned to before global declaration
   global lang, editor_path, config_path, export_path, debug, brad_path, radiance_binaries_path, radiance_library_path, configparserok
/home/lars/.blender/scripts/brad.py:144: SyntaxWarning: name 'radiance_library_path' is assigned to before global declaration
   global lang, editor_path, config_path, export_path, debug, brad_path, radiance_binaries_path, radiance_library_path, configparserok
/home/lars/.blender/scripts/brad.py:144: SyntaxWarning: name 'configparserok' is assigned to before global declaration
   global lang, editor_path, config_path, export_path, debug, brad_path, radiance_binaries_path, radiance_library_path, configparserok
/home/lars/.blender/scripts/brad.py:705: SyntaxWarning: name 'X' is used prior to global declaration
   global X
/home/lars/.blender/scripts/brad.py:710: SyntaxWarning: name 'Y' is used prior to global declaration
   global Y
No existing configuration file: using default configuration.
Traceback (most recent call last):
   File "<string>", line 1, in <module>
   File "/home/lars/.blender/scripts/brad.py", line 214, in <module>
     from brad_radiance import *
   File "/opt/brad/brad/brad/brad_radiance.py", line 39, in <module>
     from Libwin import *
   File "/opt/brad/brad/gui/Libwin.py", line 41, in <module>
     from BaseWindowClass import BaseWindowClass
   File "/opt/brad/brad/gui/BaseWindowClass.py", line 33, in <module>
     class BaseWindowClass:
   File "/opt/brad/brad/gui/BaseWindowClass.py", line 56, in BaseWindowClass
     0x03, 0x03, 0x03, 0x03, 0x81, 0x81, 0x81, 0x81]
TypeError: size mismatch in assignment
Saved session recovery to /home/lars/.blender/quit.blend
Error Totblock: 2
Buffer dimensions len: 4 0x282a250
Buffer buffer len: 128 0x2a5bb30

Blender quit
lars@lars-laptop:~$

--

Cheers, Lars.

Buffers are used when communicating between Python code and
extensions written in C. That probable means you are seeing a bug
in some Python code, which is using the Blender API incorrectly.
That bug could be in a file coming with Blender (eg. BaseWindowClass.py)
or in a file coming with brad. Hard to tell without a detailed
analysis of the interaction between the two.

It is also possible that the added coding specification resulted in
some API function receiving an Unicode string now instead of a byte
array (traditional text string).

In either case, the author of brad would be in the best position to
identify and fix the problem.

regards

-schorsch

···

On Tue, 19 Jul 2011, Lars O. Grobe wrote:

Randolph, Georg, I added a line reading

# coding=latin-1

to the beginning of the file.

Still, I get a "mismatch in assignment". The full output of the Blender 2.49 session is:

... irrelevant warnings ...
/home/lars/.blender/scripts/brad.py:710: SyntaxWarning: name 'Y' is used prior to global declaration
global Y
No existing configuration file: using default configuration.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/lars/.blender/scripts/brad.py", line 214, in <module>
   from brad_radiance import *
File "/opt/brad/brad/brad/brad_radiance.py", line 39, in <module>
   from Libwin import *
File "/opt/brad/brad/gui/Libwin.py", line 41, in <module>
   from BaseWindowClass import BaseWindowClass
File "/opt/brad/brad/gui/BaseWindowClass.py", line 33, in <module>
   class BaseWindowClass:
File "/opt/brad/brad/gui/BaseWindowClass.py", line 56, in BaseWindowClass
   0x03, 0x03, 0x03, 0x03, 0x81, 0x81, 0x81, 0x81]
TypeError: size mismatch in assignment
Saved session recovery to /home/lars/.blender/quit.blend
Error Totblock: 2
Buffer dimensions len: 4 0x282a250
Buffer buffer len: 128 0x2a5bb30

--
Georg Mischler -- simulations developer -- schorsch at schorsch com
+schorsch.com+ -- lighting design tools -- http://www.schorsch.com/

The Blender API has been updated, and brad has not been updated to follow the changes. I can't even find the packages brad uses in the current Blender API docs.

I really don't have time to work on this more, unfortunately--anyone else who knows Python and OpenGL want to give it a try?

Randolph

I can look at it if it kann wait until the weekend. But I don't think there
is much point in updating the whole package to a new Blender version. The
current Blender API is still not finalised and may not offer all the
features the script needs.

The best way to use brad is to use an old version of Blender.

Thomas

···

On Tue, Jul 19, 2011 at 1:52 PM, Randolph M. Fritz <[email protected]> wrote:

The Blender API has been updated, and brad has not been updated to follow
the changes. I can't even find the packages brad uses in the current
Blender API docs.

I really don't have time to work on this more, unfortunately--anyone else
who knows Python and OpenGL want to give it a try?

Randolph

______________________________**_________________
Radiance-general mailing list
Radiance-general@radiance-**online.org<[email protected]>
http://www.radiance-online.**org/mailman/listinfo/radiance-**general<http://www.radiance-online.org/mailman/listinfo/radiance-general>

There is a new project that works with Blender 2.57:

http://www.ods-engineering.com/blendme

Don't know if it's already released yet, though.

Thomas

···

On Mon, Jul 18, 2011 at 6:55 AM, Lars O. Grobe <[email protected]> wrote:

Hi all,

I was wondering whether anyone recently made Brad work using any kind of
Linux?

Hi!

    Hi all,

    I was wondering whether anyone recently made Brad work using any
    kind of Linux?

There is a new project that works with Blender 2.57:

http://www.ods-engineering.com/blendme

Don't know if it's already released yet, though.

Thomas

That looks cool, but they seam not to fully release it as open source, which leaves some questionmarks (it is basically a great integration of existing open source software into Blender).

Cheers, Lars.