Posts

Post not yet marked as solved
0 Replies
482 Views
I just updated xcode 15.2 and I want to try to use Reality Composer Pro, I saw on the Apple developer video that it should be under Xcode -> developer tool -> Reality Composer Pro but when I open that I don't have Composer. On the Apple webpage for Rality Composer is written "Reality Composer for macOS is bundled with Xcode, which is available on the Mac App Store." Where i can find the Composer Pro? Thanks
Posted
by dm1886.
Last updated
.
Post not yet marked as solved
3 Replies
1.6k Views
Hello, I created in Blender a simple cube with 2 animations, one animation move up and down the cube and second one rotating cube on his position. I exported this file in glb format and I tried to converted using Reality Converter, unfortunately I can only see 1 animation. Is there any limitation of Reality Converter? Can I include more than 1 animation? The original file glb has the 2 animation inside, as you can see from the screenshot I checked the file using a online viewer for glb and there are no problem, both animations are in. The converter unfortunately see only the last one created. Any reason or explanation? I believe is a limitation on Reality Converter Regards
Posted
by dm1886.
Last updated
.
Post not yet marked as solved
0 Replies
867 Views
I wrote this simple app to try to fetch and add data to my airport Database in the background. I'm trying to add some data to the airport table in the background using swift-data, I create a loop that should add and save 100 test airports in a table but when I run the code I only get add 1 airport at the time and the number get add is random, any idea why? How to use swiftData in the background? So far not so many examples. actor JsonImporter: ModelActor { let executor: any ModelExecutor let context: ModelContext init(modelContainer: ModelContainer) { context = ModelContext(modelContainer) executor = DefaultModelExecutor(context: context) } func parseJsonDBAirport() async { for i in 1...100{ print("loop \(i)") let airport = Airport(lastPicked: Date(), icao: "test \(i)") context.insert(airport) do{ try context.save() }catch { print("Error") } } } } Using on the view: struct SettingsView: View { @Environment (\.modelContext) var mc var body: some View { Button { Task(priority: .background){ let importer = JsonImporter(modelContainer: mc.container) await importer.parseJsonDBAirport() } } label: { Text("Parse Json airport") } NavigationLink { Airports(dm: dm) } label: { HStack{ Image(systemName: "person.2.badge.gearshape.fill") Text("Airports") } } } } my main actor is following: @main struct Pilot_VisionApp: App { var dm = DataManager.shared var body: some Scene { WindowGroup { SettingsView(dm: dm) } .modelContainer(for: [UserModel.self, Flight.self, Aircraft.self, CrewModel.self, Airport.self]) } } and the airport list as following: import SwiftUI import SwiftData struct Airports: View { let dm: DataManager @Query(filter: nil, sort: [SortDescriptor(\Airport.lastPicked)], animation: .default) var airports: [Airport] var body: some View { List{ Text("Airport Contains : \(airports.count)") ForEach(airports) { apt in Text("icao: \(apt.icao ?? "")") } } } } not sure why when I press the button the loop runs correctly I get the printout 100 times but when I open the list of my airport I only see 1 airport saved, every time I press the button one more airport is added to the table but should be 100 airports every time I press the button. How shuld be use swiftdata in background? thanks
Posted
by dm1886.
Last updated
.
Post not yet marked as solved
2 Replies
2.4k Views
Hi guys, in one of the video of WWDC 21 I saw this spectacular image of a green fluid over the sofa 🛋 i can’t find to much tutorial online, How could be done this? I was looking into the particle system of SceneKit but looks like not doing exactly the same think( is more for smoke and fire) this fluid look more 3D. what I should look for reproduce this fluid.. thanks Looking for some help to start my research.
Posted
by dm1886.
Last updated
.
Post not yet marked as solved
0 Replies
814 Views
What I'm try to do, is replicate some digital instrument gauge ...using Spritekit.. On my project I have to use a SpriteKit Scene as material for Scenekit SCNnode. In order to do that I create a sub class of SKscene and and apply it as "material.diffuse.contents" of the SCNNode. all working fine, I can see my SKscene as material of the SCNNode. Here the issue: I try to animate/replicate the correct indication of the instrument based of some value my app received from other source. To do so, i decide to use the SKsceneDelegate and use the method "update(_ currentTime: TimeInterval)" simply the update method look for the sknode of the green needle "fulcro" remove it , and make a new line calculating the angle and new coordinate for the new line. Like this I should have a smooth needle indication... Here is the update method inside my subclass SKscene: override func update(_ currentTime: TimeInterval) {                  guard let fulcroToRemove = self.childNode(withName: "fulcro") else {return}         fulcroToRemove.removeFromParent() // issue here...          let fulcro = SKNode()         fulcro.name = "fulcro"         fulcro.position = CGPoint(x: 300, y: 260)         let line = makeLine(startPos: CGPoint(x: 0, y: 0),                             endPos: getCoordinate(angleDeg: getCurrentEGT()),                             name: "EGT_LINE")         fulcro.addChild(line)         self.addChild(fulcro)     } here how I apply the material SKscene to my SCNnode class LowerECAM : SCNNode {     var systems: PlaneSystems     init(systems: PlaneSystems) { self.systems = systems         super.init()         createLowerECAM()     }     required init?(coder: NSCoder) {         fatalError("init(coder:) has not been implemented for Make Cockpit")     }     func createLowerECAM(){ systems.lowerECAMView.presentScene(systems.newAPU)         let plane = SCNPlane(width: 1, height: 1)         let material = SCNMaterial()         material.isDoubleSided  = true         material.diffuse.contents = systems.lowerECAMView.scene // apply here plane.materials = [material]         let lowerECAM = SCNNode(geometry: plane)         lowerECAM.eulerAngles = SCNVector3(deg2rad(180), deg2rad(90), 0)         lowerECAM.scale = SCNVector3(3.3, 3.3, 3.3)         self.name = "LowerECAM"         self.addChildNode(lowerECAM)     }     func deg2rad(_ number: Double) -> Double {         return number * .pi / 180     }   func rad2deg(_ number: Double) -> Double {         return number * 180 / .pi     } } But.. I'm getting the following crash: Question?? why scene kit crash when the render I'm using is the Spritekit render.. ?? I did't even write the SceneKit render method.. The issue looks like is when I remove the "fulcro" but I can't find the solution. I tried to make a new project only with spritekit and it works perfect.. can't understand why as material of SCNode it crash. Any Suggestion.. Appreciate.. Thanks a lot
Posted
by dm1886.
Last updated
.