Post

Replies

Boosts

Views

Activity

Null Truth error after deleting animation import
FB24108671 I have multiple animation files and characters that all share the same skeleton definition. This is required in order for the animations to be visible in the animation library. However, you can accidentally delete the import that contains the skeleton definition, this will break every animation that depends on that shared skeleton. This is silent until you attempt to play or inspect one of the remaining animations. To my knowledge, there is no indication as to which Import contains a skeleton definition nor is there a way to lock the file so that I cannot delete it. Repro Steps: Create a new RCP3 project and save the project. Import a USD file that contains a skeletal animation. Import one or more additional USD files that contains also contain skeletal animations. Note: The skeletons must match exactly between the imported USD files or they will not be available in RCP3. Verify that all imported animations have a valid target Skeleton. This is visible by clicking on an Import and expanding the Animation Settings section in the inspector. Select the skeletal animation and view the Target Skeleton field. Optional: Import a USD file that contains a character with a matching and valid skeleton. Create a new entity and reference the imported character. Add a new Animation Library and confirm that the skeletal animations appear in the list of available animations. Select one of the animations to auto play and hit the play button to simulate the animation. The animation should play. Open terminal and navigate to your saved RCP3 project. In the root of the project run the find command to locate the skeletal definition NullTruthDeletedAnimation.realitycomposerpro % find . -name '*.tm_skeleton_definition' ./animations/Running_B.import/skeletons/root_skeldef.tm_skeleton_definition Back in RCP3 delete the Import that contains the skeleton definition. In the above case, this would mean deleting RunningB.import. Save the RCP3 project. All animations that were assigned to the same Target Skeleton will now have an empty entry in the Animation Settings section of the inspector. If you created an entity earlier that referenced the animations then none of the animations that referenced the delete skeleton will play. In the console you will see an error reporting a missing timeline. ❌ GEN RESOURCE: tm_timeline_skeletal_clip object id: 00002dab0000024c - Resource generation failed. Error: Animation Timeline is missing a target skeleton If you assigned the deleted animation to this entity then it will still have an entry in the animation library but its value will be empty. After saving the project, close and reopen the RCP project. If you created an entity earlier, then open the created entity and simulate the scene. You may see the following errors. ❌ GEN RESOURCE: tm_timeline_skeletal_clip object id: 00002dab0000024c - Resource generation failed. Error: Animation Timeline is missing a target skeleton (2) ❌ error: Trying to lookup property of NULL truth object ❌ GEN RESOURCE: tm_timeline object id: 000023a700000248 - Resource generation failed. Error: Sampled USD anim - missing TM_TT_TYPE__ANIMATION dependency The GEN RESOURCE: tm_timeline_skeletal_clip object id error appears to be due to the broken animation library entry for the deleted animation. The error: Trying to lookup property of NULL truth object error appears to be the animation referencing the deleted skeleton. If you did not create an entity then you can see the errors by doing the following: Select one of the imported animations that referenced the now deleted skeleton. In the Inspector, expand the Animation Settings section. Select the skeletal animation, you will now see the following error repeating in the console. ❌ error: Trying to lookup property of NULL truth object ❌ (previous error repeated 59 times) ❌ error: Trying to lookup property of NULL truth object ❌ (previous error repeated 53 times) ❌ error: Trying to lookup property of NULL truth object ❌ (previous error repeated 59 times) You can fix this by importing a new animation with a valid and matching skeleton or reimporting the deleted animation. However, you MUST manually assign the Target Skeleton on each broken skeletal animation. You will also need to manually remove any animation library entries for deleted animations.
0
0
25
4h
GeometricPins not updating on entities loaded from reality files
I'm attempting to create GeometricPins on an entity so I can attach objects to game characters. If I load a character from the USD file I can query the joint names on the ModelEntity and create GeometricPins as attachment points. These pins will track the location of the associated joint and I can position my objects at the pin locations as expected. However, the pins do not update on characters loaded from a Reality File. In the below image, the Skeleton Mage character in the middle is loaded as a USDC file and I attach the hat with a GeometricPin so that it tracks the movement of the head as it animates. The animating Skeleton to the left is the same character (same .usdc file) but exported from RCP3 as a Reality File. Notice how the hat does not move with the character's head. The position and orientation of the GeometricPins attached to this character always return nil. I've also noticed that the jointNames array is empty for this entity as well. Should I be able to access the jointNames and create Geometric pins on entities loaded from Reality files? I'm adding the pin to the model entity with the following helper function. The helper function is called in the exact same way for the usd and reality entities. func pinToJoint(_ entity: Entity, to target: Entity, at jointName: String, offset: SIMD3<Float> = .zero, orientation: simd_quatf = .init(angle: 0, axis: [0,1,0])) { let pinName = "pin_at_\(jointName)" if let rig:ModelEntity = target.findModelEntity() { for jointName in rig.jointNames { log.info("\(target.name): \(jointName)") } rig.pins.set(named: pinName, skeletalJointName: jointName, position: offset, orientation: simd_quatf(angle: -.pi/2.0, axis: .init(1,0,0))) entity.components.set( PinnedEntityComponent( pinnedto: rig, pinName: pinName, ) ) } } The PinnedEntitySystem just assigns the location of the pin to the entity with the following guard let pinPosition = pin.position(relativeTo: nil) else { continue } guard let pinOrientation = pin.orientation(relativeTo: nil) else { continue } entity.setPosition( pinPosition , relativeTo: nil) entity.setOrientation( pinOrientation , relativeTo: nil)
0
1
30
15h
Unable to share animations across compatible skeletons in RCP3.
I’m working with an asset pack that contains multiple characters with a common skeletal hierarchy. This asset pack also contains animations for these characters as separate files. i.e.: run pick up idle throw In RCP2, I was able to add these animations to an Animation Library component without issue. However, in RCP3, I cannot add the skeletal animations to compatible characters. The only animations available are the transform animations, which do not animate the character. So in the animation library, I will see i.e.: run_transform idle_transform throw_transform But not run idle throw Is there something that I need to do to make the skeletal animations visible? I’ve tried adding the animation library at various levels across the hierarchy and it doesn’t seem to make a difference. Only the _transform animation is visible. I can verify that the animations themselves are compatible by manually editing the tm_entity for a character and adding the animation clip. I have to do this while RCP3 is closed but it works. I did notice that each animation is referencing a skeleton uuid. Is the UI only exposing skeletal animations with a matching skeleton uuid? Lastly, I can import both the character and the animation files as USD in a RealityKit app and successfully assign animations.
2
0
964
2d
SwiftData ModelContext Pollution with Multiple ModelContainers and Schemas
I have two different VersionedSchema accessed via two different and distinct in-memory ModelContainers. However, both schemas have a model named Item. LocalSchema.Item and RemoteSchema.Item have slightly different properties. If I create and save RemoteSchema.Item in one context then I cannot create and save LocalSchema.Item in a different context due to missing origin property. enum LocalSchema: VersionedSchema { static var versionIdentifier: Schema.Version = .init(1, 0, 0) static var models: [any PersistentModel.Type] = [ Item.self ] @Model class Item { @Attribute(.unique) var title: String var created: Date var modified: Date init(title: String, created: Date, modified: Date) { self.title = title self.created = created self.modified = modified } } } enum RemoteSchema: VersionedSchema { static var versionIdentifier: Schema.Version = .init(1, 0, 0) static var models: [any PersistentModel.Type] = [ Item.self ] @Model class Item { var title: String var created: Date var modified: Date var origin: String init(title: String, created: Date, modified: Date, origin: String) { self.title = title self.created = created self.modified = modified self.origin = origin } } } In the above example, saving RemoteSchema.Item will cause LocalSchema.Item to fail. The error message I see is *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSManagedObject 0xa120f3750> setValue:forUndefinedKey:]: the entity Item is not key value coding-compliant for the key "origin".' Test Code @Test func createLocalItemWithManualSave() async throws { let context = ModelContext(try localStore()) let item = LocalSchema.Item(title: "local", created: .now, modified: .now) context.insert(item) try context.save() } @Test func createRemoteItemWithManualSave() async throws { let context = ModelContext(try remoteStore()) let item = RemoteSchema.Item(title: "remote", created: .now, modified: .now, origin: "from space") context.insert(item) try context.save() } func localStore() throws -> ModelContainer { let schema = Schema(versionedSchema: LocalSchema.self) let config = ModelConfiguration("local", schema: schema, isStoredInMemoryOnly: true, allowsSave: true, cloudKitDatabase: .none) return try ModelContainer(for: schema, configurations: config) } func remoteStore() throws -> ModelContainer { let schema = Schema(versionedSchema: RemoteSchema.self) let config = ModelConfiguration("remote", schema: schema, isStoredInMemoryOnly: true, allowsSave: true, cloudKitDatabase: .none) return try ModelContainer(for: schema, configurations: config) } I have created FB22310365
4
0
344
Mar ’26
macOS 26: retain cycle detected when navigation link label contains a Swift Chart
I'm running into an issue where my application will hang when switching tabs. The issue only seems to occur when I include a Swift Chart in a navigation label. The application does not hang If I replace the chart with a text field. This appears to only hang when running on macOS 26. When running on iOS (simulator) or visionOS (simulator, on-device) I do not observe a hang. The same code does not hang on macOS 15. Has any one seen this behavior? The use case is that my root view is a TabView where the first tab is a summary of events that have occurred. This summary is embedded in a NavigationStack and has a graph of events over the last week. I want the user to be able to click that graph to get additional information regarding the events (ie: a detail page or break down of events). Initially, the summary view loads fine and displays appropriately. However, when I switch to a different tab, the application will hang when I switch back to the summary view tab. In Xcode I see the following messages === AttributeGraph: cycle detected through attribute 162104 === === AttributeGraph: cycle detected through attribute 162104 === === AttributeGraph: cycle detected through attribute 162104 === === AttributeGraph: cycle detected through attribute 162104 === === AttributeGraph: cycle detected through attribute 162104 === A simple repro is the following import SwiftUI import Charts @main struct chart_cycle_reproApp: App { var body: some Scene { WindowGroup { TabView { Tab("Chart", systemImage: "chart.bar") { NavigationStack { NavigationLink { Text("this is an example of clicking the chart") } label: { Chart { BarMark( x: .value("date", "09/03"), y: .value("birds", 3) ) // additional marks trimmed } .frame(minHeight: 200, maxHeight: .infinity) } } } Tab("List", systemImage: "list.bullet") { Text("This is an example") } } } } }
3
2
380
Nov ’25
moveCharacter reports collision with itself
I'm running into an issue with collisions between two entities with a character controller component. In the collision handler for moveCharacter the collision has both hitEntity and characterEntity set to the same object. This object is the entity that was moved with moveCharacter() The below example configures 3 objects. stationary sphere with character controller falling sphere with character controller a stationary cube with a collision component if the falling sphere hits the stationary sphere then the collision handler reports both hitEntity and characterEntity to be the falling sphere. I would expect that the hitEntity would be the stationary sphere and the character entity would be the falling sphere. if the falling sphere hits the cube with a collision component the the hit entity is the cube and the characterEntity is the falling sphere as expected. Is this the expected behavior? The entities act as expected visually however if I want the spheres to react differently depending on what character they collided with then I am not getting the expected results. IE: If a player controlled character collides with a NPC then exchange resource with NPC. if player collides with enemy then take damage. import SwiftUI import RealityKit struct ContentView: View { @State var root: Entity = Entity() @State var stationary: Entity = createCharacter(named: "stationary", radius: 0.05, color: .blue) @State var falling: Entity = createCharacter(named: "falling", radius: 0.05, color: .red) @State var collisionCube: Entity = createCollisionCube(named: "cube", size: 0.1, color: .green) //relative to root @State var fallFrom: SIMD3<Float> = [0,0.5,0] var body: some View { RealityView { content in content.add(root) root.position = [0,-0.5,0.0] root.addChild(stationary) stationary.position = [0,0.05,0] root.addChild(falling) falling.position = fallFrom root.addChild(collisionCube) collisionCube.position = [0.2,0,0] collisionCube.components.set(InputTargetComponent()) } .gesture(SpatialTapGesture().targetedToAnyEntity().onEnded { tap in let tapPosition = tap.entity.position(relativeTo: root) falling.components.remove(FallComponent.self) falling.teleportCharacter(to: tapPosition + fallFrom, relativeTo: root) }) .toolbar { ToolbarItemGroup(placement: .bottomOrnament) { HStack { Button("Drop") { falling.components.set(FallComponent(speed: 0.4)) } Button("Reset") { falling.components.remove(FallComponent.self) falling.teleportCharacter(to: fallFrom, relativeTo: root) } } } } } } @MainActor func createCharacter(named name: String, radius: Float, color: UIColor) -> Entity { let character = ModelEntity(mesh: .generateSphere(radius: radius), materials: [SimpleMaterial(color: color, isMetallic: false)]) character.name = name character.components.set(CharacterControllerComponent(radius: radius, height: radius)) return character } @MainActor func createCollisionCube(named name: String, size: Float, color: UIColor) -> Entity { let cube = ModelEntity(mesh: .generateBox(size: size), materials: [SimpleMaterial(color: color, isMetallic: false)]) cube.name = name cube.generateCollisionShapes(recursive: true) return cube } struct FallComponent: Component { let speed: Float } struct FallSystem: System{ static let predicate: QueryPredicate<Entity> = .has(FallComponent.self) && .has(CharacterControllerComponent.self) static let query: EntityQuery = .init(where: predicate) let down: SIMD3<Float> = [0,-1,0] init(scene: RealityKit.Scene) { } func update(context: SceneUpdateContext) { let deltaTime = Float(context.deltaTime) for entity in context.entities(matching: Self.query, updatingSystemWhen: .rendering) { let speed = entity.components[FallComponent.self]?.speed ?? 0.5 entity.moveCharacter(by: down * speed * deltaTime, deltaTime: deltaTime, relativeTo: nil) { collision in if collision.hitEntity == collision.characterEntity { print("hit entity has collided with itself") } print("\(collision.characterEntity.name) collided with \(collision.hitEntity.name) ") } } } } #Preview(windowStyle: .volumetric) { ContentView() }
1
0
287
Aug ’25
Unexpected lines appear in PDFView on visionOS 26 beta
I’m attempting to display a PDF file in a visionOS application using the PDFView in PDFKit. When running on device with visionOS 26, a horizontal solid line appears on some pages, while on other pages, both a horizontal and vertical solid line appear. These lines do not appear in Xcode preview canvas (macOS, visionOS) on device running visionOS 2.5 on Mac running macOS 15.6 I thought that this could possibly be the page breaks, but setting displaysPageBreaks = false did not appear to be effective. Are there any other settings that could be causing the lines to display? Code Example struct ContentView: View { @State var pdf: PDFDocument? = nil var body: some View { PDFViewWrapper(pdf: pdf) .padding() } } #Preview(windowStyle: .automatic) { ContentView(pdf: PDFDocument(url: Bundle.main.url(forResource: "SampleApple", withExtension: "pdf")!)) .environment(AppModel()) } struct PDFViewWrapper: UIViewRepresentable { let pdf: PDFDocument? func makeUIView(context: Context) -> PDFView { let view = PDFView() view.document = pdf view.displaysPageBreaks = false return view } func updateUIView(_ uiView: PDFView, context: Context) { uiView.document = pdf } } Tested with Xcode Version 16.4 (16F6) Xcode Version 26.0 beta 5 (17A5295f) visionOS 2.5 visionOS 26 Beta 5 I
2
0
304
Aug ’25
Null Truth error after deleting animation import
FB24108671 I have multiple animation files and characters that all share the same skeleton definition. This is required in order for the animations to be visible in the animation library. However, you can accidentally delete the import that contains the skeleton definition, this will break every animation that depends on that shared skeleton. This is silent until you attempt to play or inspect one of the remaining animations. To my knowledge, there is no indication as to which Import contains a skeleton definition nor is there a way to lock the file so that I cannot delete it. Repro Steps: Create a new RCP3 project and save the project. Import a USD file that contains a skeletal animation. Import one or more additional USD files that contains also contain skeletal animations. Note: The skeletons must match exactly between the imported USD files or they will not be available in RCP3. Verify that all imported animations have a valid target Skeleton. This is visible by clicking on an Import and expanding the Animation Settings section in the inspector. Select the skeletal animation and view the Target Skeleton field. Optional: Import a USD file that contains a character with a matching and valid skeleton. Create a new entity and reference the imported character. Add a new Animation Library and confirm that the skeletal animations appear in the list of available animations. Select one of the animations to auto play and hit the play button to simulate the animation. The animation should play. Open terminal and navigate to your saved RCP3 project. In the root of the project run the find command to locate the skeletal definition NullTruthDeletedAnimation.realitycomposerpro % find . -name '*.tm_skeleton_definition' ./animations/Running_B.import/skeletons/root_skeldef.tm_skeleton_definition Back in RCP3 delete the Import that contains the skeleton definition. In the above case, this would mean deleting RunningB.import. Save the RCP3 project. All animations that were assigned to the same Target Skeleton will now have an empty entry in the Animation Settings section of the inspector. If you created an entity earlier that referenced the animations then none of the animations that referenced the delete skeleton will play. In the console you will see an error reporting a missing timeline. ❌ GEN RESOURCE: tm_timeline_skeletal_clip object id: 00002dab0000024c - Resource generation failed. Error: Animation Timeline is missing a target skeleton If you assigned the deleted animation to this entity then it will still have an entry in the animation library but its value will be empty. After saving the project, close and reopen the RCP project. If you created an entity earlier, then open the created entity and simulate the scene. You may see the following errors. ❌ GEN RESOURCE: tm_timeline_skeletal_clip object id: 00002dab0000024c - Resource generation failed. Error: Animation Timeline is missing a target skeleton (2) ❌ error: Trying to lookup property of NULL truth object ❌ GEN RESOURCE: tm_timeline object id: 000023a700000248 - Resource generation failed. Error: Sampled USD anim - missing TM_TT_TYPE__ANIMATION dependency The GEN RESOURCE: tm_timeline_skeletal_clip object id error appears to be due to the broken animation library entry for the deleted animation. The error: Trying to lookup property of NULL truth object error appears to be the animation referencing the deleted skeleton. If you did not create an entity then you can see the errors by doing the following: Select one of the imported animations that referenced the now deleted skeleton. In the Inspector, expand the Animation Settings section. Select the skeletal animation, you will now see the following error repeating in the console. ❌ error: Trying to lookup property of NULL truth object ❌ (previous error repeated 59 times) ❌ error: Trying to lookup property of NULL truth object ❌ (previous error repeated 53 times) ❌ error: Trying to lookup property of NULL truth object ❌ (previous error repeated 59 times) You can fix this by importing a new animation with a valid and matching skeleton or reimporting the deleted animation. However, you MUST manually assign the Target Skeleton on each broken skeletal animation. You will also need to manually remove any animation library entries for deleted animations.
Replies
0
Boosts
0
Views
25
Activity
4h
GeometricPins not updating on entities loaded from reality files
I'm attempting to create GeometricPins on an entity so I can attach objects to game characters. If I load a character from the USD file I can query the joint names on the ModelEntity and create GeometricPins as attachment points. These pins will track the location of the associated joint and I can position my objects at the pin locations as expected. However, the pins do not update on characters loaded from a Reality File. In the below image, the Skeleton Mage character in the middle is loaded as a USDC file and I attach the hat with a GeometricPin so that it tracks the movement of the head as it animates. The animating Skeleton to the left is the same character (same .usdc file) but exported from RCP3 as a Reality File. Notice how the hat does not move with the character's head. The position and orientation of the GeometricPins attached to this character always return nil. I've also noticed that the jointNames array is empty for this entity as well. Should I be able to access the jointNames and create Geometric pins on entities loaded from Reality files? I'm adding the pin to the model entity with the following helper function. The helper function is called in the exact same way for the usd and reality entities. func pinToJoint(_ entity: Entity, to target: Entity, at jointName: String, offset: SIMD3<Float> = .zero, orientation: simd_quatf = .init(angle: 0, axis: [0,1,0])) { let pinName = "pin_at_\(jointName)" if let rig:ModelEntity = target.findModelEntity() { for jointName in rig.jointNames { log.info("\(target.name): \(jointName)") } rig.pins.set(named: pinName, skeletalJointName: jointName, position: offset, orientation: simd_quatf(angle: -.pi/2.0, axis: .init(1,0,0))) entity.components.set( PinnedEntityComponent( pinnedto: rig, pinName: pinName, ) ) } } The PinnedEntitySystem just assigns the location of the pin to the entity with the following guard let pinPosition = pin.position(relativeTo: nil) else { continue } guard let pinOrientation = pin.orientation(relativeTo: nil) else { continue } entity.setPosition( pinPosition , relativeTo: nil) entity.setOrientation( pinOrientation , relativeTo: nil)
Replies
0
Boosts
1
Views
30
Activity
15h
Unable to share animations across compatible skeletons in RCP3.
I’m working with an asset pack that contains multiple characters with a common skeletal hierarchy. This asset pack also contains animations for these characters as separate files. i.e.: run pick up idle throw In RCP2, I was able to add these animations to an Animation Library component without issue. However, in RCP3, I cannot add the skeletal animations to compatible characters. The only animations available are the transform animations, which do not animate the character. So in the animation library, I will see i.e.: run_transform idle_transform throw_transform But not run idle throw Is there something that I need to do to make the skeletal animations visible? I’ve tried adding the animation library at various levels across the hierarchy and it doesn’t seem to make a difference. Only the _transform animation is visible. I can verify that the animations themselves are compatible by manually editing the tm_entity for a character and adding the animation clip. I have to do this while RCP3 is closed but it works. I did notice that each animation is referencing a skeleton uuid. Is the UI only exposing skeletal animations with a matching skeleton uuid? Lastly, I can import both the character and the animation files as USD in a RealityKit app and successfully assign animations.
Replies
2
Boosts
0
Views
964
Activity
2d
SwiftData ModelContext Pollution with Multiple ModelContainers and Schemas
I have two different VersionedSchema accessed via two different and distinct in-memory ModelContainers. However, both schemas have a model named Item. LocalSchema.Item and RemoteSchema.Item have slightly different properties. If I create and save RemoteSchema.Item in one context then I cannot create and save LocalSchema.Item in a different context due to missing origin property. enum LocalSchema: VersionedSchema { static var versionIdentifier: Schema.Version = .init(1, 0, 0) static var models: [any PersistentModel.Type] = [ Item.self ] @Model class Item { @Attribute(.unique) var title: String var created: Date var modified: Date init(title: String, created: Date, modified: Date) { self.title = title self.created = created self.modified = modified } } } enum RemoteSchema: VersionedSchema { static var versionIdentifier: Schema.Version = .init(1, 0, 0) static var models: [any PersistentModel.Type] = [ Item.self ] @Model class Item { var title: String var created: Date var modified: Date var origin: String init(title: String, created: Date, modified: Date, origin: String) { self.title = title self.created = created self.modified = modified self.origin = origin } } } In the above example, saving RemoteSchema.Item will cause LocalSchema.Item to fail. The error message I see is *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSManagedObject 0xa120f3750> setValue:forUndefinedKey:]: the entity Item is not key value coding-compliant for the key "origin".' Test Code @Test func createLocalItemWithManualSave() async throws { let context = ModelContext(try localStore()) let item = LocalSchema.Item(title: "local", created: .now, modified: .now) context.insert(item) try context.save() } @Test func createRemoteItemWithManualSave() async throws { let context = ModelContext(try remoteStore()) let item = RemoteSchema.Item(title: "remote", created: .now, modified: .now, origin: "from space") context.insert(item) try context.save() } func localStore() throws -> ModelContainer { let schema = Schema(versionedSchema: LocalSchema.self) let config = ModelConfiguration("local", schema: schema, isStoredInMemoryOnly: true, allowsSave: true, cloudKitDatabase: .none) return try ModelContainer(for: schema, configurations: config) } func remoteStore() throws -> ModelContainer { let schema = Schema(versionedSchema: RemoteSchema.self) let config = ModelConfiguration("remote", schema: schema, isStoredInMemoryOnly: true, allowsSave: true, cloudKitDatabase: .none) return try ModelContainer(for: schema, configurations: config) } I have created FB22310365
Replies
4
Boosts
0
Views
344
Activity
Mar ’26
macOS 26: retain cycle detected when navigation link label contains a Swift Chart
I'm running into an issue where my application will hang when switching tabs. The issue only seems to occur when I include a Swift Chart in a navigation label. The application does not hang If I replace the chart with a text field. This appears to only hang when running on macOS 26. When running on iOS (simulator) or visionOS (simulator, on-device) I do not observe a hang. The same code does not hang on macOS 15. Has any one seen this behavior? The use case is that my root view is a TabView where the first tab is a summary of events that have occurred. This summary is embedded in a NavigationStack and has a graph of events over the last week. I want the user to be able to click that graph to get additional information regarding the events (ie: a detail page or break down of events). Initially, the summary view loads fine and displays appropriately. However, when I switch to a different tab, the application will hang when I switch back to the summary view tab. In Xcode I see the following messages === AttributeGraph: cycle detected through attribute 162104 === === AttributeGraph: cycle detected through attribute 162104 === === AttributeGraph: cycle detected through attribute 162104 === === AttributeGraph: cycle detected through attribute 162104 === === AttributeGraph: cycle detected through attribute 162104 === A simple repro is the following import SwiftUI import Charts @main struct chart_cycle_reproApp: App { var body: some Scene { WindowGroup { TabView { Tab("Chart", systemImage: "chart.bar") { NavigationStack { NavigationLink { Text("this is an example of clicking the chart") } label: { Chart { BarMark( x: .value("date", "09/03"), y: .value("birds", 3) ) // additional marks trimmed } .frame(minHeight: 200, maxHeight: .infinity) } } } Tab("List", systemImage: "list.bullet") { Text("This is an example") } } } } }
Replies
3
Boosts
2
Views
380
Activity
Nov ’25
moveCharacter reports collision with itself
I'm running into an issue with collisions between two entities with a character controller component. In the collision handler for moveCharacter the collision has both hitEntity and characterEntity set to the same object. This object is the entity that was moved with moveCharacter() The below example configures 3 objects. stationary sphere with character controller falling sphere with character controller a stationary cube with a collision component if the falling sphere hits the stationary sphere then the collision handler reports both hitEntity and characterEntity to be the falling sphere. I would expect that the hitEntity would be the stationary sphere and the character entity would be the falling sphere. if the falling sphere hits the cube with a collision component the the hit entity is the cube and the characterEntity is the falling sphere as expected. Is this the expected behavior? The entities act as expected visually however if I want the spheres to react differently depending on what character they collided with then I am not getting the expected results. IE: If a player controlled character collides with a NPC then exchange resource with NPC. if player collides with enemy then take damage. import SwiftUI import RealityKit struct ContentView: View { @State var root: Entity = Entity() @State var stationary: Entity = createCharacter(named: "stationary", radius: 0.05, color: .blue) @State var falling: Entity = createCharacter(named: "falling", radius: 0.05, color: .red) @State var collisionCube: Entity = createCollisionCube(named: "cube", size: 0.1, color: .green) //relative to root @State var fallFrom: SIMD3<Float> = [0,0.5,0] var body: some View { RealityView { content in content.add(root) root.position = [0,-0.5,0.0] root.addChild(stationary) stationary.position = [0,0.05,0] root.addChild(falling) falling.position = fallFrom root.addChild(collisionCube) collisionCube.position = [0.2,0,0] collisionCube.components.set(InputTargetComponent()) } .gesture(SpatialTapGesture().targetedToAnyEntity().onEnded { tap in let tapPosition = tap.entity.position(relativeTo: root) falling.components.remove(FallComponent.self) falling.teleportCharacter(to: tapPosition + fallFrom, relativeTo: root) }) .toolbar { ToolbarItemGroup(placement: .bottomOrnament) { HStack { Button("Drop") { falling.components.set(FallComponent(speed: 0.4)) } Button("Reset") { falling.components.remove(FallComponent.self) falling.teleportCharacter(to: fallFrom, relativeTo: root) } } } } } } @MainActor func createCharacter(named name: String, radius: Float, color: UIColor) -> Entity { let character = ModelEntity(mesh: .generateSphere(radius: radius), materials: [SimpleMaterial(color: color, isMetallic: false)]) character.name = name character.components.set(CharacterControllerComponent(radius: radius, height: radius)) return character } @MainActor func createCollisionCube(named name: String, size: Float, color: UIColor) -> Entity { let cube = ModelEntity(mesh: .generateBox(size: size), materials: [SimpleMaterial(color: color, isMetallic: false)]) cube.name = name cube.generateCollisionShapes(recursive: true) return cube } struct FallComponent: Component { let speed: Float } struct FallSystem: System{ static let predicate: QueryPredicate<Entity> = .has(FallComponent.self) && .has(CharacterControllerComponent.self) static let query: EntityQuery = .init(where: predicate) let down: SIMD3<Float> = [0,-1,0] init(scene: RealityKit.Scene) { } func update(context: SceneUpdateContext) { let deltaTime = Float(context.deltaTime) for entity in context.entities(matching: Self.query, updatingSystemWhen: .rendering) { let speed = entity.components[FallComponent.self]?.speed ?? 0.5 entity.moveCharacter(by: down * speed * deltaTime, deltaTime: deltaTime, relativeTo: nil) { collision in if collision.hitEntity == collision.characterEntity { print("hit entity has collided with itself") } print("\(collision.characterEntity.name) collided with \(collision.hitEntity.name) ") } } } } #Preview(windowStyle: .volumetric) { ContentView() }
Replies
1
Boosts
0
Views
287
Activity
Aug ’25
Unexpected lines appear in PDFView on visionOS 26 beta
I’m attempting to display a PDF file in a visionOS application using the PDFView in PDFKit. When running on device with visionOS 26, a horizontal solid line appears on some pages, while on other pages, both a horizontal and vertical solid line appear. These lines do not appear in Xcode preview canvas (macOS, visionOS) on device running visionOS 2.5 on Mac running macOS 15.6 I thought that this could possibly be the page breaks, but setting displaysPageBreaks = false did not appear to be effective. Are there any other settings that could be causing the lines to display? Code Example struct ContentView: View { @State var pdf: PDFDocument? = nil var body: some View { PDFViewWrapper(pdf: pdf) .padding() } } #Preview(windowStyle: .automatic) { ContentView(pdf: PDFDocument(url: Bundle.main.url(forResource: "SampleApple", withExtension: "pdf")!)) .environment(AppModel()) } struct PDFViewWrapper: UIViewRepresentable { let pdf: PDFDocument? func makeUIView(context: Context) -> PDFView { let view = PDFView() view.document = pdf view.displaysPageBreaks = false return view } func updateUIView(_ uiView: PDFView, context: Context) { uiView.document = pdf } } Tested with Xcode Version 16.4 (16F6) Xcode Version 26.0 beta 5 (17A5295f) visionOS 2.5 visionOS 26 Beta 5 I
Replies
2
Boosts
0
Views
304
Activity
Aug ’25