Code runs in animation but not in regular script
What is the difference for code being run normally or from the animation draw() function?
I'm fiddling with the CocoaSequenceGrabber based PySight for NodeBox1. The animation, after some 30 errors runs fluently whereas in the adapted iSight grid script, the FrameWork delegate never gets called.
While banging my head against this, I found QTKit based code, which has the same problem.
The final question should be:
How do I define a framework callable delegate that works in non-animation scripts? Do I need to setup a thread?
-karsten
P.S.: The attached CocoaSequenceGrabber has a reduced framerate. Do NOT replace your existing CocoaSequenceGrabber if you already have it.
P.P.S: I run this in my nodebox fork https://github.com/karstenw/nodebox-pyobjc which is Python 2.7 based but I checked with 1.9.5 which has the same problem.
- pysight_error.zip 21.2 KB
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Frederik De Ble... on 02 Dec, 2013 10:25 AM
The only thing I can think of is that the animation is called using a ObjC callback, whereas the code using run is called directly (ie. it blocks). In addition, the
_boxedRun
function sets some environment variables and sys settings.I have no idea how PyObjC does threading behind the screens. We certainly don't do any threading of ourselves for this.
Sorry I can't help you further but it's been a while since I've looked at this code.
2 Posted by karstenwo on 02 Dec, 2013 10:38 AM
Thanks for looking into it.