Post

Replies

Boosts

Views

Activity

Reply to Importing obj + mtl files into one scene in iOS app
Hi @morphing, have you found an elegant way to do this? I can use a document picker to open the .obj file but MDLAsset(url:) cannot find the corresponding .mtl and .jpg files. These files are definitely there, with the right names and in the right locations. Maybe I am using AccessingSecurityScopedResource in the wrong way ? Thanks for any pointers
Topic: Spatial Computing SubTopic: ARKit Tags:
Nov ’22
Reply to swift mac swift app fails to show image view crashes on first run
Solved by removing the let scene = sceneFromFile() initializer. Instead I added a button to explicitly load the file after an initial layout was done. I don't know how to do it without the button since an .onAppear { scene = sceneFromFile() } or .task { scene = sceneFromFile() } respectively crash or don't do anything. Still feels like a bug. import SceneKit func sceneFromFile() -> SCNScene? {   var scene: SCNScene?   let panel = NSOpenPanel()   panel.allowsMultipleSelection = false   panel.canChooseDirectories = false   if panel.runModal() == .OK {     if let sceneURL = panel.url {         scene = try? SCNScene(url: sceneURL)     }   }   return scene } @main struct SceneFromFileCrashApp: App {   @State var scene: SCNScene?       var body: some Scene {     WindowGroup {       VStack {         Button("Open") {           scene = sceneFromFile()         }         SceneView(scene: scene)       }     }   } }
Topic: UI Frameworks SubTopic: AppKit Tags:
Oct ’22
Reply to swift mac swift app fails to show image view crashes on first run
This is a minimal app that crashes after selecting a .usdz file. Error: Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1a7f15ba4) "Secure coding for state restoration requested after it was initialized without. NSApplicationDelegate was probably established too late." import SwiftUI import SceneKit func sceneFromFile() -> SCNScene? {   var scene: SCNScene?   let panel = NSOpenPanel()   panel.allowsMultipleSelection = false   panel.canChooseDirectories = false   if panel.runModal() == .OK {     if let sceneURL = panel.url {       scene = try? SCNScene(url: sceneURL)     }   }   return scene } @main struct SceneFromFileCrashApp: App {   let scene = sceneFromFile()   var body: some Scene {     WindowGroup {       SceneView(scene: scene)     }   } }
Topic: UI Frameworks SubTopic: AppKit Tags:
Oct ’22
Reply to Xcode 15 beta 6: ld: warning: building for 'macCatalyst', but linking in dylib built
Have the same problem. App can build and app can run, but warning is always there
Replies
Boosts
Views
Activity
Feb ’24
Reply to Why was NSAttributedString.Key.verticalGlyphForm Deprecated in macOS 14, and How to Handle Vertical Text Now?
I have the same question. I am using Japanese fonts that should render differently in vertical and horizontal format. It's not just a minor or cosmetic issue: the charaters are different. What's the alternative?
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Jan ’24
Reply to Importing obj + mtl files into one scene in iOS app
Hi @morphing, have you found an elegant way to do this? I can use a document picker to open the .obj file but MDLAsset(url:) cannot find the corresponding .mtl and .jpg files. These files are definitely there, with the right names and in the right locations. Maybe I am using AccessingSecurityScopedResource in the wrong way ? Thanks for any pointers
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Simultaneously interacting with SwiftUI View below a UIViewRepresentable
Having the same problem while trying to draw with the pen in PencilKit, and using fingers to manipulate a 3D shape in SceneKit. Any suggestions?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to swift mac swift app fails to show image view crashes on first run
Solved by removing the let scene = sceneFromFile() initializer. Instead I added a button to explicitly load the file after an initial layout was done. I don't know how to do it without the button since an .onAppear { scene = sceneFromFile() } or .task { scene = sceneFromFile() } respectively crash or don't do anything. Still feels like a bug. import SceneKit func sceneFromFile() -> SCNScene? {   var scene: SCNScene?   let panel = NSOpenPanel()   panel.allowsMultipleSelection = false   panel.canChooseDirectories = false   if panel.runModal() == .OK {     if let sceneURL = panel.url {         scene = try? SCNScene(url: sceneURL)     }   }   return scene } @main struct SceneFromFileCrashApp: App {   @State var scene: SCNScene?       var body: some Scene {     WindowGroup {       VStack {         Button("Open") {           scene = sceneFromFile()         }         SceneView(scene: scene)       }     }   } }
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to swift mac swift app fails to show image view crashes on first run
The crash disappears when the App Sandbox entitlement is set to NO. But then a new log entry appears: flock failed to lock list file (/var/folders/bg/t20_gl712tj3g9tx5yn730740000gn/C//Magenta.KanaConsole.SceneFromFileCrash/com.apple.metal/16777235_530/functions.list): errno = 35
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to swift mac swift app fails to show image view crashes on first run
This is a minimal app that crashes after selecting a .usdz file. Error: Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1a7f15ba4) "Secure coding for state restoration requested after it was initialized without. NSApplicationDelegate was probably established too late." import SwiftUI import SceneKit func sceneFromFile() -> SCNScene? {   var scene: SCNScene?   let panel = NSOpenPanel()   panel.allowsMultipleSelection = false   panel.canChooseDirectories = false   if panel.runModal() == .OK {     if let sceneURL = panel.url {       scene = try? SCNScene(url: sceneURL)     }   }   return scene } @main struct SceneFromFileCrashApp: App {   let scene = sceneFromFile()   var body: some Scene {     WindowGroup {       SceneView(scene: scene)     }   } }
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to swift mac swift app fails to show image view crashes on first run
crash report attached Translated Report.txt
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to swift mac swift app fails to show image view crashes on first run
Hi, I have a similar problem. App crashes with the same error as in OP, and window with selected image does not show (In my case I load a SCNScene from a user-selected .usdz file.) Is there a resolution? thx
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to Mechanism wanted to set the "RecordID" Metadata field Query Index programmatically
I haven't been able to find a way to do this either. Googling doesn't help...
Replies
Boosts
Views
Activity
May ’22