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

Recent Discussions

18 Nov, 2024 11:24 PM
18 Nov, 2024 09:01 PM
07 Nov, 2024 10:53 AM
02 Nov, 2024 11:22 AM
01 Nov, 2024 12:41 AM

 

01 Oct, 2024 07:59 AM
30 Sep, 2024 11:37 PM
30 Sep, 2024 11:11 AM
30 Sep, 2024 02:37 AM
28 Sep, 2024 10:33 AM
26 Sep, 2024 06:41 AM