connectome-neuprint / neuVid

Generates neuroscience videos from high-level descriptions using Blender or VVDViewer.
Other
28 stars 7 forks source link

addAnimation breaks for `fade` when using empty list of meshes #157

Closed floesche closed 1 year ago

floesche commented 1 year ago

I am not sure if your code should cover this edge case, but when the fade commands is provided with an empty list for the meshes, addAnimation breaks at line 502 in addAnimation:

test case:

 "neurons": {
    "source": <MYSOURCE>,
    "fadeneurons": []
  }
...
["fade", {"meshes": "neurons.fadeneurons", "startingAlpha": 0.0, "endingAlpha": 1.0, "duration": 4.0, "stagger": "constant"}],

throws this error:

Error: Python: Traceback (most recent call last):
  File "/groups/reiser/home/loeschef/prj/neuVid/neuVid/addAnimation.py", line 1196, in <module>
    cmd(args)
  File "/groups/reiser/home/loeschef/prj/neuVid/neuVid/addAnimation.py", line 502, in fadeCmd
    if len(objs) >= 6:
TypeError: object of type 'NoneType' has no len()
neuVid 1.35.0
hubbardp commented 1 year ago

Thanks for the report. I'll work on a fix now.

floesche commented 1 year ago

Thanks. One idea is in #158 and #159