Skip to content

Commit 5f12bcd

Browse files
Merge pull request #198 from vpython/fix_follow(None)
Fix scene.camera.follow(None)
2 parents f16ebfd + 394c99e commit 5f12bcd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vpython/vpython.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2934,7 +2934,10 @@ def __init__(self, **args):
29342934
baseObj._canvas_constructing = False
29352935

29362936
def follow(self, obj): ## should allow a function also
2937-
self.addmethod('follow', obj.idx)
2937+
if obj is None:
2938+
self.addmethod('follow', 'None')
2939+
else:
2940+
self.addmethod('follow', obj.idx)
29382941

29392942
def select(self):
29402943
canvas.selected = self

0 commit comments

Comments
 (0)