WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   trouble with winviz.exe (https://forum.worldviz.com/showthread.php?t=752)

bnord 09-19-2006 07:10 AM

trouble with winviz.exe
 
I have some trouble with winviz.exe of V3b. After exiting the application via Escape button, there is still a process "winviz.exe" visible in the Task-Manager which has to be killed manually. This happens without any additional DLLs like Philips OGL Wrapper (not installed on this system). I think this could be in conjunction with a thread that is responsible for loading textures. Sometimes (after different times of running) an exception is thrown.

The Traceback looks like this:

Traceback (most recent call last):
File "C:\Programme\WorldViz\Vizard30\bin\lib\threading.p y", line 442, in __bootstrap
self.run()
File "TextureLoaderThread.py", line 68, in run
if textureSet[slotToReplace] == None:
File "C:\Programme\WorldViz\Vizard30\python\viz.py", line 1992, in __eq__
return self.id == other.id and isinstance(other,self.__base)
AttributeError: 'NoneType' object has no attribute 'id'

The code worked fine with 2.53. Is there a general change in Version 3 that could cause this?

Best regards,
Björn

farshizzo 09-19-2006 09:23 AM

The problem with the exception will be fixed in the next release. Either way, you should usually use the is operator when checking for equality with None
Code:

if textureSet[slotToReplace] is None:
I'm not sure what is causing winviz to hang. Are you making sure that your threads cleanup properly before your script exits? Can you create a small script that recreates the problem?

bnord 09-20-2006 04:36 AM

I think I have found the problem. When I start the following Testscript on Vizard 2.53, the print command is executed and after that winviz quits. On Version 3 beta the print command is NOT executed before quitting. Thats why the "TextureLoaderThread" starts again and again because I need to set a flag there.
If you still need it, i will try to create a small script tomorrow that show you the exact code structure (this will take some time because i'm not the initial author of the script)

Code:

import viz

viz.go()

def mykeyboard(key):

        if key == viz.KEY_ESCAPE:
                        print 'this will not appear on Vizard 3 beta'

viz.callback(viz.KEYBOARD_EVENT,mykeyboard)

(using the is-operator solved the problem with the exception ... ups :) )

farshizzo 09-20-2006 09:04 AM

I'm assuming the programmers original intention was for that block of code to be executed when Vizard exits. If this is the case, then it would be better to execute the code during viz.EXIT_EVENT, instead of when the escape key is pressed. Try the following instead:
Code:

def onExit():
        print 'This will appear before Vizard exits'
viz.callback(viz.EXIT_EVENT,onExit)


bnord 09-21-2006 04:22 AM

Yes, thats the solution. Thanks a lot!


All times are GMT -7. The time now is 09:54 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC