omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    SceneKit Skinner Segmentation fault

    Pythonista
    2
    3
    1511
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • pulbrich
      pulbrich last edited by

      Would a kind soul look at this skeleton code and give me some directions where to search. I tried to run this on the main thread, in the background, no difference. It also doesn’t matter which instance method I call; neither if I initialize the Skinner with the convenience init.

      The fault happens in objc_util in the message send call. Other classes work as they should.

      from objc_util import * 
      from ctypes import *
      import ctypes
      
      load_framework('SceneKit')
      
      SCNSkinner = ObjCClass('SCNSkinner')
      aSkinner = SCNSkinner.alloc().init()
      
      print(aSkinner)
      #results in: <SCNSkinner: 0x281ba1bf0>
      
      a = aSkinner.wantsCPUSkinning()
      
      #results in:
      #Fatal Python error: Segmentation fault
      #
      #Current thread 0x000000016da43000 (most recent call first):
      #  File "/var/containers/Bundle/Application/5405B521-0286-438F-821B-436B80F5E060/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 897 in __call__
      #  File "/var/containers/Bundle/Application/5405B521-0286-438F-821B-436B80F5E060/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/objc_util.py", line 803 in __call__
      #  File "/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/SceneKit/x-sample.py", line 13 in <module>
      

      Thanks, Peter

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        Do other methods on aSkinner also crash?

        Looking at the docs, it's not clear doing an alloc/init is legal. It looks like you either need to create the Skinner from a scene, or use the long form constructor:

        Creating a Skinner Object

        • skinnerWithBaseGeometry:bones:boneInverseBindTransforms:boneWeights:boneIndices:
          Creates a skinner object with the specified visible geometry and skeleton information.
        1 Reply Last reply Reply Quote 0
        • pulbrich
          pulbrich last edited by

          @JonB : you are probably right; I ended up with this approach (init/alloc) because I was unable to make the long initializer work (returns None) and thought I will add the properties one after the other to see which breaks. It puzzles me since the parameters to the long init method look ok on their own right yet no skinner is returned. Will keep trying.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors