SceneKit Skinner Segmentation fault
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>
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
Creates a skinner object with the specified visible geometry and skeleton information.
@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.