WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-08-2005, 05:28 PM
vadrian vadrian is offline
Member
 
Join Date: Sep 2004
Posts: 32
crash on viz.waittime

i have a script that's too complicated to copy here but generally does this:

iterates through 4 scenes
object iterates through a list of data
object makes callbacks to functions I provide
one of the callbacks makes a viz.director(showNextInstructions) call

Code:
def showNextInstructions():
	global exp, instructions, infoBox
	global DELAY_BEFORE_INSTRUCTIONS, DELAY_AFTER_INSTRUCTIONS
	print "showing instructions"
	# delay before showing instructions
	print "\tdelay"
	viz.waittime(DELAY_BEFORE_INSTRUCTIONS)
	print "\tmoving infobox to current scene"
	scene = exp.get(vhil.CURRENT_SEQUENCE)+STARTING_SCENE
	infoBox._group.parent(viz.SCREEN,scene)
	#infoBox = vizinfo.add(instructions.pop(0))
	print "\tpoping next instruction"
	infoBox.message(instructions.pop(0))
	#infoBox.translate(0.5,0.95)
	#infoBox.bgcolor(viz.WHITE,1.0)
	#infoBox.bordercolor(viz.BLACK, 1.0)
	print "\tshowing box"
	infoBox._group.visible(1)
	infoBox.expand()
i know, its a mess, but with the print calls, i can tell that the crash happens on viz.waittime(DELAY_BEFORE_INSTRUCTIONS)

not only that, it happens at the same place in the script ONLY SOMETIMES. It's wierd, but sometimes the script runs without a hitch, with crashes only happening randomly in about 1 out of 5 runthroughs.

no python/vizard errors, just the windows "fatal error" window, and then closes the program.

please help. this is for an experiment, so its imperative that there are no crashes (or else we lose all the subject's data)


thanks

adrian
Reply With Quote
  #2  
Old 02-09-2005, 12:43 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Adding objects inside a director function is currently unstable. I believe this may be the cause of your problem. If it is possible, I would recommend that you use a timer instead.
Reply With Quote
  #3  
Old 02-09-2005, 02:49 PM
vadrian vadrian is offline
Member
 
Join Date: Sep 2004
Posts: 32
but i don't make any new objects in that function. unless infoBox._group.parent() or infoBox.message() make a new objects, i can't see where the program can have threading/concurrency errors.

(the only object creating line is commented out because it never worked as intended due to setting the scene of vizinfo boxes)
Reply With Quote
  #4  
Old 02-09-2005, 02:54 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Does commenting out the line infoBox._group.parent(viz.SCREEN,scene) prevent the crash? The parent command removes the object then re-adds it to another. This would be the same is adding an object.
Reply With Quote
  #5  
Old 02-12-2005, 04:36 PM
vadrian vadrian is offline
Member
 
Join Date: Sep 2004
Posts: 32
yup, you're right as usual!
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:38 AM.


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