I want to use SceneKit on MacOS to load a Collada file and get scene node properties to use them with my own scene graph.
I can easily access vertices, normals, transformation matrices, material properties and so forth – everything except of the texture file names.
I would expect a texture’s file name to be stored in an instance of SCNMaterialProperty Class. From the documentation:
The SCNMaterialProperty class encapsulates a texture and a set of
attributes specifying how the texture is applied on the object.
But I can only get an NSImage representing the texture, not the source file name itself.
It must be somewhere – In the inspector of XCode’s collada viewer the file name is displayed as well (along with properties from SCNMaterialProperty):

How do i access a texture’s file name in a SceneKit object graph?
There’s no API for it. If you’re purely interested in it for debugging purposes, it’s not too hard to hack at: underlying SCNMaterialProperty is C3DImageRef, which you can retrieve using
-[SCNMaterialProperty getC3DImageRef]. Its layout looks something like:So with some casting and offsetting you can grab the path. Be aware the offset changes in 32-bit vs 64-bit due to the size of pointers changing.
All this info can be gleamed from class-dump (and headers can be generated that include the exact structs etc). It’s all horribly fragile though, so don’t ever ship code that uses it. File a bug report requesting that an API be added to get this info properly.