WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-20-2008, 02:19 PM
johannes2 johannes2 is offline
Member
 
Join Date: Apr 2007
Posts: 7
onactionend

Hi,

moving to Vizard 3 from Vizard 2.5 onactionend seems to work differntly:
Old working code:

def onactionend(object,action):
if object == screenWall and action == viz.MOVE:
putGraphOnScreenWall()
viz.callback(viz.ACTION_END_EVENT,onactionend)

New code, not working yet:

def onactionend(e):
print 'end',e.object,e.action
if e.object is screenWall and e.action is viz.MOVE:
putGraphOnScreenWall()
viz.callback(viz.ACTION_END_EVENT,onactionend)

What to do?
Best,
Johannes
Reply With Quote
  #2  
Old 01-23-2008, 12:18 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Can you post a simple working example that reproduces the problem? Also, please use the [code][/code] tags when posting code samples. It will preserve the tabs which is necessary for python code.
Reply With Quote
  #3  
Old 02-12-2008, 02:35 AM
johannes2 johannes2 is offline
Member
 
Join Date: Apr 2007
Posts: 7
Thank you for being fast and sorry for beeing slow - too many other things right now

TypeError: onactionend() takes exactly 2 arguments (1 given)
** WARNING: <node>.goto will be deprecated in future versions of Vizard, use vizact.goto instead
TypeError: onactionend() takes exactly 2 arguments (1 given)

Sample Code:

Code:
def onactionend(object,action):
	if object == screenWall and action == viz.MOVE:
		putGraphOnScreenWall()
viz.callback(viz.ACTION_END_EVENT,onactionend)



graphOnWallFinished=0
def putGraphOnScreenWall():
	global graphBasket, graph1, graph2, graph3, graph4, graph5, graph6,graphOnWallFinished
	
	print 'adfasdf',screenWall.get(viz.POSITION)[1]
	if checkboxWall.get()==1 and screenWall.get(viz.POSITION)[1]==0:
			#moveDown=vizact.move(0,0,0,1)
			#screenWall.add(moveDown)
			graph4.graphWhat=graph1.graphWhat
			graph5.graphWhat=graph2.graphWhat
			graph6.graphWhat=graph3.graphWhat
			resetObjects()
			
			#make existing graphs invisible
			for graphInstance in graphBasket:
					graphInstance.coordinateShow=0
					graphInstance.showCoordinateSystem()
			#print '123213',graphBasket
			graphBasket=[]
			#print graphBasket
			graphBasket.append(graph4)
			graphBasket.append(graph5)
			graphBasket.append(graph6)
			for graphInstance in graphBasket:
				graphInstance.setLabelTextGraph(graphInstance.graphWhat)
				graphInstance.adjustCoordSys(3,1)
				graphInstance.adjustCoordSys(3,0)
				graphInstance.coordinateShow=1
				graphInstance.showCoordinateSystem()
			graphOnWallFinished=1
Reply With Quote
  #4  
Old 02-12-2008, 10:52 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Can you post a working script? I can't actually run the code you posted since it is not a fully working script. Either way, you might want to look at the documentation for viz.ACTION_END_EVENT. It shows a simple example on how to correctly handle the callback.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Do you know how to send a value for 'pool' to the onActionEnd function? ghazanfar Vizard 1 03-22-2007 10:25 AM


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


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