Blender/Python error with BZWTools 2.0.4 Beta 2

Discussion, updates, modifications, etc for the various map editors...
Post Reply
User avatar
BinarySpike
Corporal
Corporal
Posts: 735
Joined: Mon Mar 28, 2005 11:58 pm
Contact:

Blender/Python error with BZWTools 2.0.4 Beta 2

Post by BinarySpike »

I get this error from Python using BZWTools 2.0.4 Beta 2
(latest SVN)

I tried making a base and got this error, so I tried a box.
I also have Python 2.5 installed as well as 2.4

Code: Select all

Compiled with Python version 2.4.
Checking for installed Python... got it!
Blender.Scene.getCurrent() is deprecated,
        use Blender.Scene.GetCurrent() instead.
BZFlag settings found, setting to user preferences
C:\Program Files\Blender Foundation\Blender\blender.exe:203: DeprecationWarning:
 integer argument expected, got float
  SSSSSΦ▀l  â─¶ìE╪PΦ♫   Y;├t
Blender.Scene.getCurrent() is deprecated,
        use Blender.Scene.GetCurrent() instead.
Traceback (most recent call last):
  File "<string>", line 229, in addbutton_event
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\bzflag\box.
py", line 67, in run
    self.updateto()
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\bzflag\BZob
ject.py", line 44, in updateto
    obj.setEuler(0.0,0.0,z)
RuntimeError: expected tuple of one item

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

moved to map editors
ImageJeffM
User avatar
BinarySpike
Corporal
Corporal
Posts: 735
Joined: Mon Mar 28, 2005 11:58 pm
Contact:

Post by BinarySpike »

Thanks Jeff now that I think of it it should have gone here.
User avatar
Teppic
Private First Class
Private First Class
Posts: 576
Joined: Mon Mar 07, 2005 10:00 pm
Location: The North Block

Re: Blender/Python error with BZWTools 2.0.4 Beta 2

Post by Teppic »

BinarySpike wrote:I get this error from Python using BZWTools 2.0.4 Beta 2
(latest SVN)

I tried making a base and got this error, so I tried a box.
I also have Python 2.5 installed as well as 2.4

Code: Select all

Compiled with Python version 2.4.
Checking for installed Python... got it!
Blender.Scene.getCurrent() is deprecated,
        use Blender.Scene.GetCurrent() instead.
BZFlag settings found, setting to user preferences
C:\Program Files\Blender Foundation\Blender\blender.exe:203: DeprecationWarning:
 integer argument expected, got float
  SSSSSΦ▀l  â─¶ìE╪PΦ♫   Y;├t
Blender.Scene.getCurrent() is deprecated,
        use Blender.Scene.GetCurrent() instead.
Traceback (most recent call last):
  File "<string>", line 229, in addbutton_event
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\bzflag\box.
py", line 67, in run
    self.updateto()
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\bzflag\BZob
ject.py", line 44, in updateto
    obj.setEuler(0.0,0.0,z)
RuntimeError: expected tuple of one item

There are a few issues here, none are fatal except the change to 'obj.setEuler()'.

Firstly, blender 2.latest (I forgot) just made it into the Gentoo Portage package tree, so I can fix the tookit now.
Considering how heavily Gentoo relies on python, I think it'll be a while before python 2.5 hits testing so no support for that just yet, but I haven't seen anthing that affects bzwtools in the changelogs so with any luck it'll be ok.

Back to

Code: Select all

    obj.setEuler(0.0,0.0,z)
if you change it to

Code: Select all

    obj.setEuler((0.0,0.0,z))
it should work, but I don't have a chance to test it just yet.


BinarySpike, if you change it and it works it should update all the native objects (pyramid box base teleporter etc). Just in case you didn't notice the file to alter is C:\Program Files\Blender Foundation\Blender\.blender\scripts\bzflag\BZobject.py, line 44.

EDIT: there may be setEuler() related problems with the V2.0 objects too, it's hard to say, try adding a mesh box and see for me, thanks.
User avatar
BinarySpike
Corporal
Corporal
Posts: 735
Joined: Mon Mar 28, 2005 11:58 pm
Contact:

Post by BinarySpike »

I'm so sorry I didn't get back to this, the *one* day I decide not to check the forums and you post ;)

Anyway I made your change and boxes worked :)
(I didn't know if I was supposed to delete the pyc files, so I did...)

I tried a meshbox and it didn't, here's the output not related to Blender.Scene.getCurrent() being decapricated.

Code: Select all

Traceback (most recent call last):
  File "<string>", line 229, in addbutton_event
  File "C:\Program Files\Blender Foundation\Blender\.blender\scripts\bzflag\mes
box.py", line 207, in run
    scobj.setEuler(0,0,BZcommon.deg2rad(float(self.obj.rotation[0])))
RuntimeError: expected tuple of one item
scobj.setEuler(0,0,BZcommon.deg2rad(float(self.obj.rotation[0])))
I changed to:
scobj.setEuler((0,0,BZcommon.deg2rad(float(self.obj.rotation[0]))))
(again deleting all pyc)

And meshboxes now work.

Boy... one day and everything I'm working on just suddenly starts working...

I'll make edits to all the other files and see if all the other objects work.
User avatar
BinarySpike
Corporal
Corporal
Posts: 735
Joined: Mon Mar 28, 2005 11:58 pm
Contact:

Post by BinarySpike »

weapon.py was the only other file I found an incompatible setEuler in.

scobj.setEuler(math.pi/2,-x,-z)
into
scobj.setEuler((math.pi/2,-x,-z))

(*edit* I forgot to delete the pyc files after making that change... I know basic python syntax, but I don't know how it runs/compiles etc. etc...)

I made every single object and they all instantiated fine. But that's my knowledge so far... I still have to try exporting and all that.

Thanks Teppic!
User avatar
Teppic
Private First Class
Private First Class
Posts: 576
Joined: Mon Mar 07, 2005 10:00 pm
Location: The North Block

Post by Teppic »

I just did a search through the project files for setEuler, you seem to have found them all (well, all the affected files), so I will update the affected ones now I know it works, and update the SVN sources.

Thanks for your help.

EDIT: The sources are now up to date, and I updated Scene.getCurrent() to Scene.GetCurrent, to stop the depreciation warning.

I'm off to make a new snapshot...
Post Reply