WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-09-2003, 01:10 PM
poolshark poolshark is offline
Member
 
Join Date: Sep 2003
Posts: 12
script crash

Hey,

My code was working perfectly for the previous version of Vizard. I downloaded it last week and the script started crashing so I downloaded it again today and still crashes. I think it crashes on this line:
viz.setwindow(p2.GetHandle())
Never did it before, its just crashing now. Any suggestions?
Reply With Quote
  #2  
Old 10-09-2003, 01:40 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I'm not aware of any changes to setwindow. I tested it out here and it's working fine. Are you sure it's the setwindow function. Are there any error messages? You might want to try commenting everything out except for the setwindow call to make sure this is causing the crash.
Reply With Quote
  #3  
Old 10-09-2003, 01:47 PM
poolshark poolshark is offline
Member
 
Join Date: Sep 2003
Posts: 12
There are no error messages the windows things pops up with "send error report". I checked through using print statements and that's the line of code where it crashes. I don't think its even the p2.GetHandle part because I did that separately and the program doesn't crash.
Reply With Quote
  #4  
Old 10-09-2003, 02:05 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Can you try out the following code. It should just open up a wxWindow and display a spinning red square. If it is still crashing then your guess is as good as mine

Code:
from wxPython.wx import *
import viz

#IMPORTANT: YOU MUST DO THIS BEFORE RUNNING ANY OTHER CODE
viz.go(viz.EMBEDDED)

#---------------------------------------------------------------------------

class VizFrame(wxFrame):
	def __init__(self, parent):
		wxFrame.__init__(self, parent, -1, "Vizard Embedded Example", size=(800,600),style=wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
		
		window = wxWindow(self,-1)
		
		#IMPORTANT: YOU MUST SET THE WINDOW BEFORE RUNNING ANY OTHER VIZ COMMANDS
		viz.setwindow(window.GetHandle())
		
		quad = viz.add(viz.TEXQUAD)
		quad.translate(0,1.6,5)
		quad.color(1,0,0)
		quad.spin(0,1,0,90)
		quad.disable(viz.LIGHTING)
		
		
		#IMPORTANT: SETUP A TIMER TO BE CALLED CONTINUOSLY, IN THIS CASE, EVERY 10 MILLISECONDS
		ID_Timer  = wxNewId()
		self.timer = wxTimer(self,ID_Timer)
		self.timer.Start(10)
		EVT_TIMER(self,  ID_Timer, self.OnTimer)
		
	def OnTimer(self, event):
		#IMPORTANT: YOU MUST MANUALLY UPDATE THE GRAPHICS FRAME
		viz.updateframe()


#----------------------------------------------------------------------

if __name__ == '__main__':
	app = wxPySimpleApp()
	frame = VizFrame(None)
	frame.Show(True)
	app.MainLoop()
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 12:49 AM.


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