-
Notifications
You must be signed in to change notification settings - Fork 62
Description
using latest vpython version from github,
scene.follow(None) does work now, but letting the camera follow a function as described in the documentation https://www.glowscript.org/docs/VPythonDocs/canvas.html does NOT work. (I guess it also did not worked before the patch).
(tested on Ubuntu Linux 21.10, python 3.9.7, latest vpython version from github (patch #198 )
The problem can be reproduced using idle:
import vpython as vp
b = vp.box()
vp.scene.camera.follow(b)
vp.scene.camera.follow(None) # works !
def f():
... return 2*b.pos
...
vp.scene.camera.follow(f) # does NOT work
Traceback (most recent call last):
File "", line 1, in
File "/home/horst/code/vpython/github version/vpython-jupyter-master/vpython/vpython.py", line 2940, in follow
self.addmethod('follow', obj.idx)
AttributeError: 'function' object has no attribute 'idx