omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. Cethric
    3. Topics

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 3
    • Topics 14
    • Posts 167
    • Best 23
    • Controversial 0
    • Groups 0

    Topics created by Cethric

    • Cethric

      ObjC parse_type error
      Pythonista • • Cethric

      3
      0
      Votes
      3
      Posts
      2048
      Views

      Cethric

      @JonB thank you for the reply, I will look into implimenting a fix soon.
      I have been trying to extend the Header Parser that I used for OpenGLES to include most of the iOS headers.
      So far it seems to work well...

    • Cethric

      objc_util Documentation
      Pythonista • • Cethric

      3
      3
      Votes
      3
      Posts
      2404
      Views

      filippocld

      It would be very cool :-)

    • Cethric

      GLKit view fails
      Pythonista • ctypes glkit objc • • Cethric

      9
      0
      Votes
      9
      Posts
      6834
      Views

      Cethric

      I have updated the GitHub repo to represent the current work. I have more or less temporariely resolved the issue by calling reload(GLKit.view) in main.py how ever this is really only a temporary fix. I will look into some of the methods that omz uses to retain the globals/delegate methods.

    • Cethric

      UIImageJPEGRepresentation
      Pythonista • • Cethric

      10
      0
      Votes
      10
      Posts
      16891
      Views

      Cethric

      Ok I have got it to render the image to a file however the render image is still incorrect.
      Script available here

      EDIT:
      It now renders in black and white.

      Any ideas?

    • Cethric

      Dynamic Libraries. Could it potentially Work?
      Pythonista • ctypes bundle framework objc • • Cethric

      15
      1
      Votes
      15
      Posts
      14395
      Views

      JonB

      This could be a great potential use case for In App Purchases in the future ;)

    • Cethric

      objc_util ObjCBlock. __call__ method makes reference to unassigned variable (self.func)
      Pythonista • • Cethric

      3
      0
      Votes
      3
      Posts
      2839
      Views

      Cethric

      Welcome and ok.
      Will do a bit more research into why the crash is occurring then.
      Current code

      class CBlock(ObjCBlock): def __init__(self, func, restype=None, argtypes=None): super(CBlock, self).__init__(func, restype=None, argtypes=None) self.func = func type_encodings['@?'] = CBlock default_opt = { 'GLKTextureLoaderApplyPremultiplication': 0, 'GLKTextureLoaderGenerateMipmaps': 0, 'GLKTextureLoaderOriginBottomLeft': 0, 'GLKTextureLoaderGrayscaleAsAlpha': 0, 'GLKTextureLoaderSRGB': 0 } DEFAULTS = ns(default_opt) class GLKTextureLoader: def __init__(self, sharegroup=None): if sharegroup is None: sharegroup = currentContext().sharegroup print sharegroup tl = ObjCClass('GLKTextureLoader') self._loader = tl.alloc().initWithSharegroup_(sharegroup._sharegroup) def textureFromFile(self, path): callback = CBlock(GLKTextureLoaderCallback, restype=None, argtypes=[ctypes.c_void_p, ctypes.c_void_p]) print dir(self._loader) print DEFAULTS # self._loader.textureWithContentsOfFile_options_queue_completionHandler_(path, DEFAULTS, None, callback)

      Note currentContext() is just a wrapper for EAGLContext.currentContext() where EAGLContext has not been allocated or initialised.

    • Cethric

      How to use structures? setting GLKEffectPropertyLight.position, fails
      Pythonista • • Cethric

      18
      0
      Votes
      18
      Posts
      10168
      Views

      Cethric

      @omz that seemed to fix it. Thanks

    • Cethric

      TypeError for unbound method
      Pythonista • • Cethric

      11
      0
      Votes
      11
      Posts
      6747
      Views

      Cethric

      @ywangd that has resolved the issue, thank you for the infomation about it

    • Cethric

      Optimisation of GLES update times
      Pythonista • • Cethric

      23
      1
      Votes
      23
      Posts
      15889
      Views

      wradcliffe

      @JonB and @Cethric - this seems to imply that the JS runtime system is highly optimized for JSON encoding and decoding. That would not be a big surprise. The new method for transferring the data seems to also confirm that moving all the data in a single blob and with a single call back into python is the best strategy. I was thinking that the send_to_python call could also be running faster if the JSON method is handled via a http POST like mechanism rather then a http PUT. It certainly is interesting.

    • Cethric

      SystemError: bad argument to internal function
      Pythonista • 1.6 pythonista • • Cethric

      5
      0
      Votes
      5
      Posts
      5879
      Views

      Webmaster4o

      Awesome.

    • Cethric

      JavaScriptCore adding custom functions
      Pythonista • • Cethric

      42
      1
      Votes
      42
      Posts
      26402
      Views

      Cethric

      Nevermind, it is fixed now, I don't really know what I did but it is working now.

    • Cethric

      What am I doing wrong?
      Pythonista • • Cethric

      3
      0
      Votes
      3
      Posts
      2282
      Views

      Cethric

      That fixed the issue, thanks you @JonB

    • Cethric

      Python OpenGLES
      Pythonista • • Cethric

      20
      0
      Votes
      20
      Posts
      12857
      Views

      Cethric

      Working on an example file main.py to test shaders and rendering. However I cannot get the view to show a cube I think the issue is with the MVP however I do not know at what point I am going wrong, can someone please look at it and let me know
      For simplicity I am using the euclid.py math library.

      Thanks in advanced.

    • Cethric

      Proof of concept HTML Editor
      Pythonista • • Cethric

      27
      0
      Votes
      27
      Posts
      19774
      Views

      JonB

      the other approach, which may be faster, would be to build a list structure of all themesble objects, one time. then, you dont need to recurse through views, which might be slow due to repeated subviews calls, and the recursive nature, which involves many slow function calls. so, build a list one time (or, if you have a lot of dynamic components, youll have to keep track of them as they are added /deleted)

      this would let you use list comprehension or maps to set the attributes, looping one time over the list which you have already prefiltered (eliminating all those other checks for name, etc). since list comprension /maps are optimized in c, it might yield better performance.