The new NodeBox forum is live! Everything from support.nodebox.net moved here: sign in with the same email to pick up your old posts. Something not working? Write to forum-support@nodebox.net.

NodeBox 1ArchiveFrom the old forum

Code runs in animation but not in regular script

2 replies Last reply

  1. 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.

    Copy link
  2. NodeBox team

    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.

    Copy link
  3. Thanks for looking into it.

    Copy link

Know something that helps?

Sign in with your email address to reply. No password needed.

Sign in to reply