My visionOS app can install custom fonts.
My visionOS app also lists these fonts as available within the application, and I can see them in a list using CTFontManagerCopyAvailableFontFamilyNames
I manually track which fonts have been installed.
So far, so good. But here’s my problem: When a user uninstalls a font via Settings, I have no way to tell. That’s because CTFontManagerCopyAvailableFontFamilyNames will still list that font because it’s still available within the application.
How can I track these changes in my app when a font is uninstalled via Settings?
General
RSS for tagDiscuss Spatial Computing on Apple Platforms.
Post
Replies
Boosts
Views
Activity
I am seeking a comprehensive pathway to learning Metal programming on VisionOS. The official documentation’s Pathway on Metal is insufficient in this regard. I kindly request that someone create a detailed pathway to assist me in this endeavor.
The pathway should encompass the following key areas:
Knowledge Base:
Understand the fundamental principles of Metal and other frameworks, as well as basic concepts, to prepare for future learning.
Metal3 (very important) :
Gain a deep understanding of Metal itself, the programming language used to communicate with the GPU on the device to render graphics. This knowledge forms the foundation for all Metal-related tasks.
Compositor Services and ARKit (important) :
Learn how to display Metal scenes within the Vision device’s space and enable augmented reality (AR) and hand interaction. This knowledge is essential for creating interactive and immersive experiences.
Metal Performance Shaders:
Acquire expertise in optimizing material rendering to enhance performance.
MetalKit:
Simplifies the tasks that display your Metal content onscreen.
MetalFX:
Develop proficiency in using MetalFX to improve rendering efficiency and achieve visually stunning effects.
I would appreciate it if you could provide me with a detailed and comprehensive pathway, including the URLs of relevant documents, to guide my learning journey. Thank you for your assistance.
Hi!
I'm creating an app like this:
Using Image Tracking to set world anchor in real world first.
The timeline in Reality Composer Pro scene needs to be played in same time(for the people in same place using the app).
People using the app will see the same contents in same position in same time in same place.
I already made Image Tracking feature worked. But the big problem is "Synchronization". I found Group Activities and TabletopKit to solve the problem. But I don't know if this are the right modules for this project.
How do I solve this problem technically?
If you have ideas, please let me know. I really need help for this.
Hi, I heve a problem with an visionOS app and I couldn't find a solution. I have 3D carousel with cards and when I use the drag gesture and I drag to the left I want the carousel to rotate clockwise and when I drag to the right I want the carousel to rotate counter clockwise. My problem is when I rotate my body more than 90 degrees to the left or to the right the drag gesture changes it's value and the carousel rotates in the opposite direction? Do you know how can I maintain the right sense taking into account that the user can rotate his body?
I've tried to take the user orientation with device tracking and check if rotation on Y axis is greater than 90 degrees in both direction but It is a very small area bettween 70-110 degrees when it still rotates in the opposite direction. I think that's because the device traker doesn't update at the same rate as drag gesture or it doesn't have the same acurracy.
Hi, since I updated my device to visionOS 2.0 or higher I have some problems with my app. Sometimes when I go with my eyes over buttons or the tabview which is a SwiftUI component that many apps use, the hover effect doesn't trigger anymore, I can tap on the icon from the tabview but doesn't extend when I hover it to se the description of the button. It is weird because it doesn't happen all the time. But in VisionOS 1.0 doesn't happen at all.
My second issue is that I have an navbar as an attachment and this attachment has a draggable modifier that we created. The buttons are not tappable until I drag the navbar a little, this also never happened in VisionOS 1.0 but always happen in Vision 2.0+ because I've tested in the simulator with different versions.
Is it possible these problems to be related to handTracking Service that we use from ARKit? Because sometimes when we close the trackers the app works as intended.
Can apple vision pro can shareplay differents apps at the same time? How about this on the iphone or ipad?
Hello everyone,
I'm currently working through this example project Exploring object tracking with ARKit to learn how to use Object Tracking with visionOS.
I was able to modify the example project to overlay a different model onto the detected object. However, with the example code, I'm only able to track 1 instance of the trained object at a time. I'm wondering if there is a way to track multiple instances of 1 object?
For example, I have a usdz model of a box, then trained that box for object tracking, I'm able to overlay a model of a chair over that box once it's detected. But now, I have multiple copies of that same box, and I want to arrange them so that when I wear the Vision Pro, I can see the chairs arranged however I want.
I'm still new to visionOS development, so I'm not sure if there's a way to accomplish that by just training 1 object and having copies of it.
If it helps, this is my current modification to overlay a virtual object ontop of a detected object.
func loadReferenceObjects() async -> [ReferenceObject] {
// Get a list of all reference object files in the app's main bundle and attempt to load each.
var referenceObjectFiles: [String] = []
if let resourcesPath = Bundle.main.resourcePath {
print("resource path: \(resourcesPath)")
try? referenceObjectFiles = FileManager.default.contentsOfDirectory(atPath: resourcesPath).filter { $0.hasSuffix(".referenceobject") }
}
await withTaskGroup(of: Void.self) { group in
for file in referenceObjectFiles {
let objectURL = Bundle.main.bundleURL.appending(path: file)
group.addTask {
// get the file name
let fileNameWithoutExtension = (file as NSString).deletingPathExtension
// load each ref objs as task
await self.loadSingleReferenceObject(url: objectURL, fileName: fileNameWithoutExtension)
}
}
}
return self.referenceObjects
}
// Private helper method to load a single object
// and assign entity to it.
private func loadSingleReferenceObject(url: URL, fileName: String) async {
var referenceObject: ReferenceObject
do {
print("Loading reference object from \(url)")
// Load the file as a `ReferenceObject` - this can take a while for larger objects.
try await referenceObject = ReferenceObject(from: url)
} catch {
fatalError("Failed to load reference object with error \(error)")
}
// add the ref obj to the ref objs array
self.referenceObjects.append(referenceObject)
// entity with each file
var model: Entity = Entity()
// add entity according to the file name
switch fileName {
// Box1 ref obj binds with Chair1
case "Box1":
// try to load the model
do {
try await model = Entity(named: "chair1", in: realityKitContentBundle)
} catch {
print("Failed to load chair1")
}
// Box2 ref obj binds with Chair2
case "Box2":
// try to load the model
do {
try await model = Entity(named: "chair2", in: realityKitContentBundle)
} catch {
print("Failed to load chair2")
}
default:
print("no model associated with this file name: \(fileName)")
break
}
// map entity to ref objs
usdzPerReferenceObject[referenceObject.id] = model
}
Any help or suggestions would be greatly appreciated.
Thank you.
How can I access the player’s camera vector in VisionOS, specifically using RealityKit?
In Unity and other game engines, there’s often an API like Camera.main.transform.forward for this purpose. I’ve found the head anchor but haven’t identified a way to obtain the forward vector in RealityKit.
Is there a related API for this? Any guidance would be greatly appreciated.
Thanks!
How can I access the player’s camera vector in VisionOS, specifically using RealityKit?
In Unity and other game engines, there’s often an API like "Camera.main.transform.forward for this purpose. "
I’ve found the head anchor but haven’t identified a way to obtain the forward vector in RealityKit.
Is there a related API for this? Any guidance would be greatly appreciated.
Thanks!
Function Introduction "https://developer.apple.com/documentation/avkit/creating-a-multiview-video-playback-experience-in-visionos/"
When I use this function, my videoPlayer has no back Action in player.
And we did not find any method provided by the system "addChildViewControllerAndView(form)"
"https://developer.apple.com/documentation/avkit/adopting-the-system-player-interface-in-visionos"
Referencing this document also did not work
As long as you enter this line of code
let playerController = AVPlayerViewController()
// Enable the multiview experience along with the default recommended set.
playerController.experienceController.allowedExperiences = .recommended(including: [.multiview])
there is no back button, only full screen and zoom out
In VisionOS versions 2.1 and 2.2, I’m encountering a significant limitation when using the .immersionStyle(selection: .constant(.mixed), in: .mixed) mode, specifically in mixed immersive style. Here’s a breakdown of the behavior:
In full immersion mode (.immersionStyle(selection: .constant(.full), in: .full)), users can interact with and manipulate system windows while inside a 3D model, allowing typical interactions like moving windows, pinching, or activating UI switches.
However, in mixed immersive mode, using the exact same layout “inside” a 3D model (which doesn’t visually obstruct the window), users are unable to interact with window content or move the window. Basic interactions like pinching or toggling switches require users to physically touch these elements in AR space, which is inconsistent with the behavior in full immersion.
From a usability perspective, this restriction seems unnecessary, as the software should ideally allow for similar interaction capabilities across both immersive styles. The expected behavior is to enable window manipulation within a 3D model in mixed mode, matching the functionality observed in full immersion.
The scene in question is a House in which the user is placed during the immersion that's why I am referring to the user being "Inside" of the scene.
Has anyone else experienced this or found a workaround?
When using ARView of RealityKit, I can code like this let results = arView.raycast(from: point, allowing: .estimatedPlane, alignment: .any) to get the 3D position of where I tap on the plane. In iOS 18, we can use RealityView and I found that unproject(_:from:to:ontoPlane:) may implement the same function, but I don't know how to set the ontoPlane parameter.
Can someone help me with some code snippets?
I am trying to rotate topEntity around the origin point of shapeEntity, but have not found a way to do so.
topEntity is an entity group that also contains shapeEntity, so I cannot set topEntity as a child of shapeEntity.
From Blender I set the correct origin of topEntity, but when I import the usd model into Reality Composer Pro it does not save the origin point and there is no way to set the origin in Reality Composer Pro.
DragGesture()
.targetedToEntity(where: .has(CustomComponent.self))
.onChanged({ value in
let rotation = -Float(value.translation.height)
let clampedRotation = min(max(rotation, 0), 45)
if value.entity.name == "grab"{
if let topEntity = selectedEntity.findEntity(named: "top"),
let shapeEntity = selectedEntity.findEntity(named: "Shape_1"){
topEntity.transform.rotation = simd_quatf(
angle: clampedRotation * .pi / 180,
axis: SIMD3(x: 0, y: 0, z: 1)
)
}
}
})
Despite being enrolled, I am utterly unable to locate any option to download 2.2 beta on my Vision Pro. All I see in the system update is that I'm uptodate with 2.1.
How do I locate beta download option?
thanks
When using a trackpad (or screen-shared Mac) with the Vision Pro, moving your attention to a new window or app immediately refocuses the mouse cursor, which in many circumstances is really useful. But in circumstances where there is a viewer-only window, that window jumping gets in the way. Imagine a 3d object editor of some sort, with a live viewer in a second window, maybe a browser. Manipulating the 3d object with the mouse in the editor gets continually interrupted when looking at the live viewer because the cursor jumps to the viewer window.
Is there anyway to reject that focus?
Hi,
I'm building a windowed game in visionOS which requires a gamepad. And I'm using a PS5 controller for this case.
However, I found a few problems:
When looking at the window close button, and press X in the gamepad, the window will be closed. This can happen accidentally when the user is playing.
When press the PS button(the home button), I want my app to handle it, e.g. take the user to the title screen. But visionOS will always capture this input and opens the home screen(App Library).
How to avoid these 2 issues? Or in general, how to make the gamepad input only available to my app but not the visionOS system?
I'm having trouble re-setting the position of a child entity during app re-load even though it appears that I am correctly obtaining and persisting the correct translation values after a drag gesture.
The problem exists when I drag a child element to a new location (persist those new values) then reload the app to force re-positioning from persisted translation values.
I notice that the parent relationship changes during interaction (tap or drag) which can be seen in the debug statements. I'm wondering if this is related to the problem, or, if the parent change is normal during re-rendering and is un-related to my problem.
My thought process is since we care about relative translation values when persisting, if the parent relationship is changed just before persistence, then, are we persisting and setting the wrong values?
Project Link: Private
STEPS TO REPRODUCE
Run the app.
Drag the pre-loaded stage down the Y axis so that the floor of the stage is more visible to your eye (in order to better visualize the problem).
Tap the button in the timeline to create a new project.
Drag the only visible element from the left panel onto the timeline (element is labeled f_works_entity_1).
There should now be a green 3d model added to the stage.
Drag this green element to a new location (be careful to hover over the green element so that you don't inadvertently drag the stage).
Re-run the app to see that the green element is offset to a new location, not the last dragged location.
To reset and try again, delete the project canvas next to the project name (trash button) then restart the app.
Areas of concern:
RealityKitView is the only file you may need.
Line 119 is where we create new child entities
Lines 185-219 is where we persist and apply persisted values.
You can also search FIXME in the file to see areas of concern.
Tip:
I have a tap gesture on each entity that produces a debug statement with info about the entity and its parent including IDs.
I am developing with Apple Vision Pro to implement object tracking functionality, but each model needs to go into Create ML for training, and the training time is very long. Are there other ways to shorten training time while obtaining reference files in the same format?
Additionally, can the delay in object tracking be further optimized? Although the refresh rate has been optimized, there is still a noticeable delay.
We used real-time object tracking, and with enterprise permissions, we can improve the smoothness to 30Hz, but there are still noticeable delays. On one hand, we want to know why this delay occurs; is it due to performance considerations? Because we found that the delay in hand tracking is actually very low.
On the other hand, we consider that it may be due to the complexity of 3D objects, so I considered using image tracking. However, we found that there are even more serious delays in image tracking and QR code tracking. We hope to optimize it. Currently, the frame rate for recognizing images for tracking seems to be one frame per second, and we hope to increase it because object recognition and tracking can be very smooth on other Apple platforms, such as iOS.
Additionally, can we appropriately consider interfaces for depth recognition to obtain depth data?
We want to know what accuracy vision can achieve in measuring the physical world, as well as the accuracy in rendering on the screen. We wonder if this is related to hardware devices like radar. Also, what accuracy can we achieve in tracking the movement distance of objects?
Hello,
Is there a way to always have the attachments of a RealityView always face the user?
For example, in a visionOS app, in an immersive space, we have an attachment. When the user either walks around the attachment, or rotates the parent entity, we would like the attachment to automatically rotate to face the user.
How do we do this?
I anticipated this to be a trivial feature to implement, since I thought I remembered seeing this feature as a built-in/opt-in option for attachments. But, I cannot find that feature.
All and any recommendations are appreciated, thanks.