I could really use some help here. I tried to simplify this as much as possible so I created a bare bones app with the standard template for a volumetric view. I downloaded this usdz file from Apple.com: https://developer.apple.com/augmented-reality/quick-look/models/stratocaster/fender_stratocaster.usdz
I copied that to asset to my main app bundle. I load it with this code:
RealityView { content in
// Add the initial RealityKit content
if let scene = try? await Entity(named: "fender_stratocaster") {
print("success!")
content.add(scene)
}
But when I run it on the simulator or the device I see "success" in the console but I don't see the image.
Post
Replies
Boosts
Views
Activity
I added error checking and also print "success" when the call is call to init the entity is successful. I see success every time. I removed the code for "scaling" and the made the usdz file from apple work. So then I changed to one that I downloaded from sketchfab - here is the link: https://sketchfab.com/search?q=Amethyst_Trunced_Dodecahedron&type=models
And that one does not show. I downloaded this and added it to my main bundle. This works with Model3D.
I'm not sure if this will be helpful but I print the entity object after a successful load and this is what I see:
Success
▿ '' : Entity, children: 1
⟐ Transform
⟐ SynchronizationComponent
⟐ AnimationLibraryComponent
▿ 'scene' : Entity, children: 1
⟐ Transform
⟐ SynchronizationComponent
⟐ AnimationLibraryComponent
▿ 'Meshes' : Entity, children: 1
⟐ Transform
⟐ SynchronizationComponent
⟐ AnimationLibraryComponent
▿ 'Sketchfab_model' : Entity, children: 1
⟐ Transform
⟐ SynchronizationComponent
⟐ AnimationLibraryComponent
▿ 'root' : Entity, children: 1
⟐ Transform
⟐ SynchronizationComponent
⟐ AnimationLibraryComponent
▿ 'GLTF_SceneRootNode' : Entity, children: 1
⟐ Transform
⟐ SynchronizationComponent
⟐ AnimationLibraryComponent
▿ 'Fragment_Icosphere_2' : Entity, children: 2
⟐ Transform
⟐ SynchronizationComponent
⟐ AnimationLibraryComponent
▿ 'Object_4' : Entity, children: 1
⟐ Transform
⟐ SynchronizationComponent
▿ 'Object_0' : ModelEntity
⟐ ModelComponent
⟐ Transform
⟐ SynchronizationComponent
▿ 'Object_5' : Entity, children: 1
⟐ Transform
⟐ SynchronizationComponent
▿ 'Object_1' : ModelEntity
⟐ ModelComponent
⟐ Transform
⟐ SynchronizationComponent
Updating