PDA

View Full Version : displaymode() problem


Jerry
08-20-2008, 11:18 AM
I am using the ProcessUtil module to start a script from within another
script.

The main script is

from viz import *
import ProcessUtil

go(STEREO | HMD)

g = add('gallery.ive')

def onKeyDown(key):
if key == KEY_RETURN:
ProcessUtil.runScript('foo.py')

viz.callback(viz.KEYDOWN_EVENT,onKeyDown)


and the script it runs (foo.py) is

from viz import *

displaymode(1280,480,16,60)

go(HMD | STEREO)

g = add('court.ive')


The problem is that each time you press RETURN to run foo.py,
when you exit from foo.py and return to the main script
the viewpoint is raised relative to what it was before foo.py was run.

If you comment out the displaymode line in foo.py the problem goes
away, but it will have to remain in the actual application I am using.
Any suggestions on how to fix this?