I need a MeshResource from ModelEntity to generate a box collider, but ModelEntity fails to load USDZ files from the Reality Composer Pro (RCP) bundle.
This code works for loading an Entity:
// Successfully loads as generic Entity
previewEntity = try await Entity(named: fileName, in: realityKitContentBundle)
But this fails when trying to load as ModelEntity:
// Fails to load as ModelEntity
modelEntity = try await ModelEntity(named: fileName, in: realityKitContentBundle)
I found this thread mentioning:
"You'll likely go from USDZ to Entity which contains a MeshResource when you load/init the USDZ file."
But it doesn't explain how to actually extract the MeshResource. Could anyone advise:
How to properly load USDZ files as ModelEntity from RCP bundles?
How to extract MeshResource from a successfully loaded Entity?
Alternative approaches to generate box colliders if direct extraction isn't possible?
Sample code for extraction or workarounds would be greatly appreciated!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Is there any limitation in Vision Pro when loading scenes with large-scale models?
Test Case:
Asset: Composite USDA file containing 10 individual models (total triangles count: ~4.2M)
Simulator: Loads and renders correctly
Real Device:
Loads asset successfully but failure during rendering phase:
Environment abruptly dims
System spontaneously reboots
How can we resolve this issue?
Below are excerpted logs preceding the crash:
<<<< FigAudioSession(AV) >>>> audioSessionAVAudioSession_CopyMXSessionProperty signalled err=-19224 (kFigAudioSessionError_UnsupportedOperation) (getMXSessionProperty unsupported) at FigAudioSession_AVAudioSession.m:606
Attempted to add ornament: <MRUIPlatterOrnament: 0x10a658f00; _isInternal: YES; _displaceWindowChrome: NO; _canCaptureUI: NO; _isBeingRemoved: NO; contentAnchorPoint3D: "{0.5, 0.5, 0}"; position: <MRUIPlatterOrnamentRelativePosition: 0x105b68e70; anchorPoint: {0.5, 0.5, 1}>; rotation: "{{0, 0, 0}, 0}"; opacity: 1.000000; canFollowUser: YES; effectiveOffset: "{0, 0, 0}"; presentingViewController: 0x0; billboardingBehavior: 0x0; scalingBehavior: 0x0; relativeToParent: NO; nonHeritableDepthDisplacement: 0.000000; order: 0.000000; _window._determinedSize: {0, 0}; _window: (null)> to nil or non-supporting UIScene: <UIWindowScene: 0x10a8a0000; role: UISceneSessionRoleImmersiveSpaceApplication; persistentIdentifier: test.test:SFBSystemService-BA3A21A3-D1AB-42E2-8AF0-AE0AB83BE528; activationState: UISceneActivationStateUnattached>. No action taken.
Failed to set dependencies on asset 2823930584475958382 because NetworkAssetManager does not have an asset entity for that id.
apply fence tx failed (client=0x98490e18) [0x10000003 (ipc/send) invalid destination port]
Failed to commit transaction (client=0xa86516e2) [0x10000003 (ipc/send) invalid destination port]