Code runs in animation but not in regular script

karstenwo's Avatar

karstenwo

02 Nov, 2013 01:35 PM

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.

  1. Support Staff 1 Posted by Frederik De Ble... on 02 Dec, 2013 10:25 AM

    Frederik De Bleser's Avatar

    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. 2 Posted by karstenwo on 02 Dec, 2013 10:38 AM

    karstenwo's Avatar

    Thanks for looking into it.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • pysight_error.zip 21.2 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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

 

24 Apr, 2019 02:04 AM
31 Mar, 2019 10:32 AM
24 Mar, 2019 08:45 PM
24 Mar, 2019 12:07 AM
23 Mar, 2019 09:00 PM
22 Mar, 2019 06:37 AM