WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   TypeError: y must be a float (transferring from vizard 3.0 to vizard 5.0) (https://forum.worldviz.com/showthread.php?t=5187)

Melody 10-09-2014 03:40 PM

TypeError: y must be a float (transferring from vizard 3.0 to vizard 5.0)
 
The coding runs smoothly in vizard3.0. But when I copy them to vizard 5.0. It shows the error below. How can I fix it?


Traceback (most recent call last):

val = event.call()
File "C:\Program Files (x86)\WorldViz\Vizard5\python
return func(*args,**kwargs)
File "C:\Documents and Settings
current_vertex=mycurves1.addVertex([curvex, curvey1,0],viz.ABS_GLOBAL)
File "C:\Program Files (x86)\WorldViz\
val = _ipcSend(_VIZ_OTFADDVERTEX,self.id,0,'',x[0],x[1],x[2],0.0)
TypeError: y must be a float

Melody 10-09-2014 04:05 PM

viz.startlayer(viz.LINE_STRIP)
viz.vertexcolor(1,0,0)
mycurves1=viz.endlayer()
mycurves1.dynamic()
curvex=getposition()
curvey1=getforce1()
def curves1():
current_vertex=mycurves1.addVertex([curvex,curvey1,0],viz.ABS_GLOBAL)
mycurves1.setVertex(current_vertex, [curvex,curvey1,0],viz.ABS_GLOBAL)
current_vertex=mycurves1.addVertex([curvex,curvey1,0],viz.ABS_GLOBAL)
vizact.onsensordown(sensor,4,mycurves1.clearVertic es)

This is the part which result in error.

Jeff 10-10-2014 03:09 PM

It seems you may be passing in a value to the addVertex command that's not a float. Can you post a simple example that reproduces the error.


All times are GMT -7. The time now is 05:01 AM.

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