QuickLook

RSS for tag

Create previews of files to use inside your app or perform simple edits on previews using QuickLook.

Posts under QuickLook tag

148 Posts

Post

Replies

Boosts

Views

Activity

How to modify in runtime the materials of a downloaded USDZ file and save it locally?
I am trying to configure the materials of a downloaded USDZ file and then save it in the Documents folder as a new USDZ file. Currently, I am using the ModelEntity class but I have two problems: I should modify the materials by using their names, but this class just seems that I can access the list of materials and eventually replace them but without knowing their name; I have no idea how to save it in the local Documents folder as a new USDZ file in order to pass the URL to the AR QuickLook controller to display the modified file in AR. Probably I should change my approach by using other classes. Could anyone give me some advice on how to proceed to achieve my goal? I would really appreciate any help.
0
0
1.1k
Jul ’22
USDZ in AR QuickLook flies on camera level, does not acknowledge the world/camera
I’m trying to use QuickLook AR to show a 3D ThreeJS model in AR on iOS. Exporting my 3D object to USDZ using the Three USDZ exporter works fine. When opening the USDZ file in XCode everything seems to be fine. Though, when opening the USDZ in QuickLook AR, the 3D model is flying above the ground, on my camera’s Y level. The camera PoV is positioned exactly in the middle of the X and Z axis of the 3D model and at the bottom of the Y level. I have another problem with opening the USDZ in QuickLook AR, which is; When opening the USDZ in QuickLook AR, the model is invisible at first. Then when I scale the model down to < 10%, the model becomes visible, though it does not scale in size at all. Also, the “Model” tab in QuickLook does not even show the 3D model. When switching between the “Model” and “AR” tabs, the model flies by really quick. For reference, I’ve added my USDZ model below. What I’m trying to accomplish is to position the 3D model in front of me, and for the 3D model to acknowledge the world shown by the camera. The 3D model should stick to walls, or at least the floor to begin with. Button click code: newScene.add(sceneRef) const pivot = new THREE.Object3D() newScene.add(pivot) pivot.add(sceneRef) // position the object on the pivot, so that it appears 5 meters // in front of the user. pivot.position.z = -50 const yaxis = new THREE.Vector3(0, 1, 0) const zaxis = new THREE.Vector3(0, 0, 1) const direction = zaxis.clone() // Apply the camera's quaternion onto the unit vector of one of the axes // of our desired rotation plane (the z axis of the xz plane, in this case). direction.applyQuaternion(cameraRef.quaternion) // Project the direction vector onto the y axis to get the y component // of the direction. const ycomponent = yaxis .clone() .multiplyScalar(direction.dot(yaxis)) // Subtract the y component from the direction vector so that we are // left with the x and z components. direction.sub(ycomponent) // Normalize the direction into a unit vector again. direction.normalize() // Set the pivot's quaternion to the rotation required to get from the z axis // to the xz component of the camera's direction. pivot.quaternion.setFromUnitVectors(zaxis, direction) // Finally, set the pivot's position as well, so that it follows the camera. newScene.getWorldPosition(cameraRef.position) newScene.updateMatrixWorld(true) iosExporter.parse(newScene).then((result) => { saveUSDZString(result, 'scene.usdz') }) saveUSDZString function: function saveString(text: any, filename: any) { save(new Blob([text], { type: 'application/json' }), filename) } save function: function save(blob: any, filename: any) { link.href = URL.createObjectURL(blob) link.download = filename link.rel = 'ar' let img = document.createElement('img') img.alt = 'hi' img.src = 'https://google.com/img' link.appendChild(img) link.click() } USDZ Model: https://wetransfer.com/downloads/2d2d2e840f9f964e036cd6077094c33220220630095321/a7f94b9f2bc730fead9107bf133e175220220630095338/193b81?utm_campaign=WT_email_tracking&utm_content=general&utm_medium=download_button&utm_source=notify_recipient_email
1
2
2.6k
Jul ’22
Problem with black background when taking a photo with AR Quick Look feature in iOS 15
Has the problem of the black background when taking a picture with the AR Quick look function in iOS 15 been resolved? I think it's a rather serious bug. On an iOS 15 device, go to the Quick Look page below and display any of the multiple 3D models in AR Quick Look; the background will be black when you take a picture with the AR Quick Look shooting function. https://developer.apple.com/augmented-reality/quick-look/ There are similar events below, but they do not seem to be addressed at all. https://developer.apple.com/forums/thread/691784
6
0
3.0k
Jun ’22
QuickLook Preview Extension for Mac app
I'd like to add a QuickLook Preview Extension to my Mac app (AppKit), however I don't see a template for the extension in Xcode 13 under macOS (though there is a templete for iOS). This seems to be a change as there was an extension template for Mac offered in Xcode 12. Is this simply an oversight, or are Quick Look Preview Extensions no longer a thing on the Mac?
1
0
1.6k
May ’22
Is QLSupportsSearchableItems:true required for document-based app quicklook-extension for MacCatalyst?
The WWDC '17 session for core spotlight said QLSupportsSearchableItems is only for "shoebox" apps and explicitly said it's not for document-based apps, but when trying to upload my UIDocumentBrowserViewController-based MacCatalyst app with a quicklook extension (the view-controller-based quicklook preview works great) to App Store connect, it prevents me from uploading without a QLSupportsSearchableItems keys in my quicklook extension's info.plist, and it prevents me from uploading it if the value is false (0). Is the app store validator correct, and I must have this key and it must be true? Do I have to implement func preparePreviewOfSearchableItem(identifier, and if so, can I just have it always fail? If it can't fail, how would I get a sandbox url for the document from a searchable item identifier? Also, Xcode won't find anything when I search for QLSupportsSearchableItems, which is not so much ironic as it is face-palmy.
0
1
1.3k
May ’22
QuickLook environment probes are always much too dark
It seems that on iOS 13 &amp; 14 environment probes are notably too dark, and never reach an acceptable brightness that matches the surrounding environment. Is there any way to get "reasonable" IBL lighting in QuickLook that is not like 50% gray all the time, without resorting to hacks such as using emissive colors/textures? Clearly there must be something wrong with the IBL estimation, as the same scene in Google SceneViewer is very bright and nice under the same circumstances. The issue reproduces for example with the QuickLook gallery; the ceramics piece there is nearly 100% white as per the USD file but renders dull and gray next to a physical ceramics piece. Video of the issue: drive.google.com/file/d/14mVQFTNe6pO_4tYNIvpZa9eAS2YzoVPO/view?usp=sharing More pictures: drive.google.com/drive/folders/1ej6g-gpBAu53z2Zn08eQFNZAkTmDA_XJ?usp=sharing Note that in those pictures, all spheres in that grid are purely white, with varying degrees of metallic and roughness being the only difference. My expectation would be that the diffuse ones would appear "white" and not dark grey; seems impossible to get a "realistic" picture. Happens here as well: https://developer.apple.com/augmented-reality/quick-look/models/cupandsaucer/cup_saucer_set.usdz
2
1
2.8k
May ’22
How to initiate the quicklook in object mode?
How to initiate the quicklook in object mode directly (but you can still switch the slider to AR if you like)? func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem { let url = Bundle.main.url(forResource: modelsName[selectedModelIndex], withExtension: "usdz")! return url as QLPreviewItem
0
0
789
May ’22
Open Quick Look from protected web space directory with Model Viewer
Hi Community, I am using Googles Model Viewer (https://modelviewer.dev/) to display 3D-models in the webbrowser. It also enables the user to open the 3D-models in AR-Applications. On iOS, Quick Look will be opened. It all works fine and well, except when the web space directory is protected by HTTP Basic Auth (protection of the usdz-model-files is a requirement of my client). As I understand it, Quick Look looses (or does not have any access to) the HTTP session, and therefore is not authenticated when trying to access the usdz-file on the protected web space directory. The error message in Quick Look is: "Object requires a newer version of iOS". Is there any way to open an usdz-file that is on a protected web space directory with Quick Look?
0
0
692
Mar ’22
Sandbox: ExternalQuickLoo(1253) deny(1) network-outbound*:42222
I've got an app with a quicklook generator bundled within it. The app opens port 42222 for localhost queries. The quicklook generator fails to connect to the socket. The log shows these 2 sandbox errors: Sandbox: 1 duplicate report for java deny(1) file-read-data /private/etc/hosts Sandbox: ExternalQuickLoo(1253) deny(1) network-outbound*:42222 ... which is weird because the app isn't sandboxed: % codesign -d --entitlements :- /Applications/Test.app                                                          Executable=/Applications/Test.app/Contents/MacOS/Test The same code functions correctly when executed from a separate app running on the same machine (rather than from the generator). Any idea why the quicklook generator isn't able to connect to a localhost socket? ... or why sandbox rules are being applied to a non-sandbox app?
3
0
1.3k
Mar ’22
QuickLook preview never displays NSImageView
I have an NSImageView-based preview appex plugin for macOS in Objective-C. It's based off the sample template that you can add to an app. It completely makes it through preparePreviewOfFileAtURL, and I stuff pixel data into a CGImage, then that into an NSImage and that onto an NSImageView that is self.view from the storyboard. I can see all data via qlManager -p, since it will print error messages for caveman debugging. I have no idea and there are no docs on using the "Quick Look Simulator" which appears to do nothing. I set background color of the NSImageView.layer to red, and it shows up red. So I know the NSImageView is visible, just not the image that it also points to. About 30% of the time, only the red shows up, and the other 70% of the time nothing shows up in preview just smokey blurred version of the icons underneath in Finder. My only recourse, is to disable the extension list for the preview appex, and let the thumbnailer appex provide the preview. There are no samples of this for macOS, and the default templates aren't a working version of this either.
1
0
1.1k
Feb ’22
Reality files do not open on iOS15
We create reality files on Reality Composer on an iPad Pro 2020 (iPad OS 14.8.1). They can be opened in AR correctly on iOS 14 devices (our iPad & an iPhone 12 Pro). However on our iOS 15 iPhone X (iOS 15.2.1), AR Quick Look opens but it displays an error message saying “the object cannot be opened”. I have tried creating a .reality file on Reality Composer directly on my iOS 15 iPhone X (I just exported the template project for horizontal plane tracking), but the export fails to open on the very same device. However, the file generated on my iOS 15 iPhone X opens fine on my iPad Pro (iPad OS 14.8.1). USDZ files work fine on iOS though. Any lead on how to solve this issue?
4
0
2.5k
Feb ’22
Quick Look AR not accessible in in-app browers // iOS 15.8
Will AR Quick Look support be provided via in-app browsers on iOS 15? The most recent update of iOS 15 doesn't provide this functionality. The user sees a greyed out AR button. The Object mode works as expected, however. To replicate: Send this link (https://www.apple.com/events) to the Gmail app, or message it to yourself in Slack or Discord Open it Tap on the Apple logo
3
0
2.0k
Feb ’22
How to modify in runtime the materials of a downloaded USDZ file and save it locally?
I am trying to configure the materials of a downloaded USDZ file and then save it in the Documents folder as a new USDZ file. Currently, I am using the ModelEntity class but I have two problems: I should modify the materials by using their names, but this class just seems that I can access the list of materials and eventually replace them but without knowing their name; I have no idea how to save it in the local Documents folder as a new USDZ file in order to pass the URL to the AR QuickLook controller to display the modified file in AR. Probably I should change my approach by using other classes. Could anyone give me some advice on how to proceed to achieve my goal? I would really appreciate any help.
Replies
0
Boosts
0
Views
1.1k
Activity
Jul ’22
USDZ in AR QuickLook flies on camera level, does not acknowledge the world/camera
I’m trying to use QuickLook AR to show a 3D ThreeJS model in AR on iOS. Exporting my 3D object to USDZ using the Three USDZ exporter works fine. When opening the USDZ file in XCode everything seems to be fine. Though, when opening the USDZ in QuickLook AR, the 3D model is flying above the ground, on my camera’s Y level. The camera PoV is positioned exactly in the middle of the X and Z axis of the 3D model and at the bottom of the Y level. I have another problem with opening the USDZ in QuickLook AR, which is; When opening the USDZ in QuickLook AR, the model is invisible at first. Then when I scale the model down to < 10%, the model becomes visible, though it does not scale in size at all. Also, the “Model” tab in QuickLook does not even show the 3D model. When switching between the “Model” and “AR” tabs, the model flies by really quick. For reference, I’ve added my USDZ model below. What I’m trying to accomplish is to position the 3D model in front of me, and for the 3D model to acknowledge the world shown by the camera. The 3D model should stick to walls, or at least the floor to begin with. Button click code: newScene.add(sceneRef) const pivot = new THREE.Object3D() newScene.add(pivot) pivot.add(sceneRef) // position the object on the pivot, so that it appears 5 meters // in front of the user. pivot.position.z = -50 const yaxis = new THREE.Vector3(0, 1, 0) const zaxis = new THREE.Vector3(0, 0, 1) const direction = zaxis.clone() // Apply the camera's quaternion onto the unit vector of one of the axes // of our desired rotation plane (the z axis of the xz plane, in this case). direction.applyQuaternion(cameraRef.quaternion) // Project the direction vector onto the y axis to get the y component // of the direction. const ycomponent = yaxis .clone() .multiplyScalar(direction.dot(yaxis)) // Subtract the y component from the direction vector so that we are // left with the x and z components. direction.sub(ycomponent) // Normalize the direction into a unit vector again. direction.normalize() // Set the pivot's quaternion to the rotation required to get from the z axis // to the xz component of the camera's direction. pivot.quaternion.setFromUnitVectors(zaxis, direction) // Finally, set the pivot's position as well, so that it follows the camera. newScene.getWorldPosition(cameraRef.position) newScene.updateMatrixWorld(true) iosExporter.parse(newScene).then((result) => { saveUSDZString(result, 'scene.usdz') }) saveUSDZString function: function saveString(text: any, filename: any) { save(new Blob([text], { type: 'application/json' }), filename) } save function: function save(blob: any, filename: any) { link.href = URL.createObjectURL(blob) link.download = filename link.rel = 'ar' let img = document.createElement('img') img.alt = 'hi' img.src = 'https://google.com/img' link.appendChild(img) link.click() } USDZ Model: https://wetransfer.com/downloads/2d2d2e840f9f964e036cd6077094c33220220630095321/a7f94b9f2bc730fead9107bf133e175220220630095338/193b81?utm_campaign=WT_email_tracking&utm_content=general&utm_medium=download_button&utm_source=notify_recipient_email
Replies
1
Boosts
2
Views
2.6k
Activity
Jul ’22
Problem with black background when taking a photo with AR Quick Look feature in iOS 15
Has the problem of the black background when taking a picture with the AR Quick look function in iOS 15 been resolved? I think it's a rather serious bug. On an iOS 15 device, go to the Quick Look page below and display any of the multiple 3D models in AR Quick Look; the background will be black when you take a picture with the AR Quick Look shooting function. https://developer.apple.com/augmented-reality/quick-look/ There are similar events below, but they do not seem to be addressed at all. https://developer.apple.com/forums/thread/691784
Replies
6
Boosts
0
Views
3.0k
Activity
Jun ’22
QuickLook Preview Extension for Mac app
I'd like to add a QuickLook Preview Extension to my Mac app (AppKit), however I don't see a template for the extension in Xcode 13 under macOS (though there is a templete for iOS). This seems to be a change as there was an extension template for Mac offered in Xcode 12. Is this simply an oversight, or are Quick Look Preview Extensions no longer a thing on the Mac?
Replies
1
Boosts
0
Views
1.6k
Activity
May ’22
Is QLSupportsSearchableItems:true required for document-based app quicklook-extension for MacCatalyst?
The WWDC '17 session for core spotlight said QLSupportsSearchableItems is only for "shoebox" apps and explicitly said it's not for document-based apps, but when trying to upload my UIDocumentBrowserViewController-based MacCatalyst app with a quicklook extension (the view-controller-based quicklook preview works great) to App Store connect, it prevents me from uploading without a QLSupportsSearchableItems keys in my quicklook extension's info.plist, and it prevents me from uploading it if the value is false (0). Is the app store validator correct, and I must have this key and it must be true? Do I have to implement func preparePreviewOfSearchableItem(identifier, and if so, can I just have it always fail? If it can't fail, how would I get a sandbox url for the document from a searchable item identifier? Also, Xcode won't find anything when I search for QLSupportsSearchableItems, which is not so much ironic as it is face-palmy.
Replies
0
Boosts
1
Views
1.3k
Activity
May ’22
QuickLook environment probes are always much too dark
It seems that on iOS 13 &amp; 14 environment probes are notably too dark, and never reach an acceptable brightness that matches the surrounding environment. Is there any way to get "reasonable" IBL lighting in QuickLook that is not like 50% gray all the time, without resorting to hacks such as using emissive colors/textures? Clearly there must be something wrong with the IBL estimation, as the same scene in Google SceneViewer is very bright and nice under the same circumstances. The issue reproduces for example with the QuickLook gallery; the ceramics piece there is nearly 100% white as per the USD file but renders dull and gray next to a physical ceramics piece. Video of the issue: drive.google.com/file/d/14mVQFTNe6pO_4tYNIvpZa9eAS2YzoVPO/view?usp=sharing More pictures: drive.google.com/drive/folders/1ej6g-gpBAu53z2Zn08eQFNZAkTmDA_XJ?usp=sharing Note that in those pictures, all spheres in that grid are purely white, with varying degrees of metallic and roughness being the only difference. My expectation would be that the diffuse ones would appear "white" and not dark grey; seems impossible to get a "realistic" picture. Happens here as well: https://developer.apple.com/augmented-reality/quick-look/models/cupandsaucer/cup_saucer_set.usdz
Replies
2
Boosts
1
Views
2.8k
Activity
May ’22
How to initiate the quicklook in object mode?
How to initiate the quicklook in object mode directly (but you can still switch the slider to AR if you like)? func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem { let url = Bundle.main.url(forResource: modelsName[selectedModelIndex], withExtension: "usdz")! return url as QLPreviewItem
Replies
0
Boosts
0
Views
789
Activity
May ’22
Open Quick Look from protected web space directory with Model Viewer
Hi Community, I am using Googles Model Viewer (https://modelviewer.dev/) to display 3D-models in the webbrowser. It also enables the user to open the 3D-models in AR-Applications. On iOS, Quick Look will be opened. It all works fine and well, except when the web space directory is protected by HTTP Basic Auth (protection of the usdz-model-files is a requirement of my client). As I understand it, Quick Look looses (or does not have any access to) the HTTP session, and therefore is not authenticated when trying to access the usdz-file on the protected web space directory. The error message in Quick Look is: "Object requires a newer version of iOS". Is there any way to open an usdz-file that is on a protected web space directory with Quick Look?
Replies
0
Boosts
0
Views
692
Activity
Mar ’22
Sandbox: ExternalQuickLoo(1253) deny(1) network-outbound*:42222
I've got an app with a quicklook generator bundled within it. The app opens port 42222 for localhost queries. The quicklook generator fails to connect to the socket. The log shows these 2 sandbox errors: Sandbox: 1 duplicate report for java deny(1) file-read-data /private/etc/hosts Sandbox: ExternalQuickLoo(1253) deny(1) network-outbound*:42222 ... which is weird because the app isn't sandboxed: % codesign -d --entitlements :- /Applications/Test.app                                                          Executable=/Applications/Test.app/Contents/MacOS/Test The same code functions correctly when executed from a separate app running on the same machine (rather than from the generator). Any idea why the quicklook generator isn't able to connect to a localhost socket? ... or why sandbox rules are being applied to a non-sandbox app?
Replies
3
Boosts
0
Views
1.3k
Activity
Mar ’22
QuickLookUIService preview Stop Working in Sierra
Somehow my QuickLookUIService Preview Sierra 10.12 has stopped working and cannot preview audio files neither with video files ... I have tried to Force Quit in activity Monitor but the file QuickLookUIService doesn´t appear to be in the system so it is not in the Library Folder Quick Look. Any solution for this? Thanks!
Replies
0
Boosts
1
Views
965
Activity
Feb ’22
QuickLook preview never displays NSImageView
I have an NSImageView-based preview appex plugin for macOS in Objective-C. It's based off the sample template that you can add to an app. It completely makes it through preparePreviewOfFileAtURL, and I stuff pixel data into a CGImage, then that into an NSImage and that onto an NSImageView that is self.view from the storyboard. I can see all data via qlManager -p, since it will print error messages for caveman debugging. I have no idea and there are no docs on using the "Quick Look Simulator" which appears to do nothing. I set background color of the NSImageView.layer to red, and it shows up red. So I know the NSImageView is visible, just not the image that it also points to. About 30% of the time, only the red shows up, and the other 70% of the time nothing shows up in preview just smokey blurred version of the icons underneath in Finder. My only recourse, is to disable the extension list for the preview appex, and let the thumbnailer appex provide the preview. There are no samples of this for macOS, and the default templates aren't a working version of this either.
Replies
1
Boosts
0
Views
1.1k
Activity
Feb ’22
Reality files do not open on iOS15
We create reality files on Reality Composer on an iPad Pro 2020 (iPad OS 14.8.1). They can be opened in AR correctly on iOS 14 devices (our iPad & an iPhone 12 Pro). However on our iOS 15 iPhone X (iOS 15.2.1), AR Quick Look opens but it displays an error message saying “the object cannot be opened”. I have tried creating a .reality file on Reality Composer directly on my iOS 15 iPhone X (I just exported the template project for horizontal plane tracking), but the export fails to open on the very same device. However, the file generated on my iOS 15 iPhone X opens fine on my iPad Pro (iPad OS 14.8.1). USDZ files work fine on iOS though. Any lead on how to solve this issue?
Replies
4
Boosts
0
Views
2.5k
Activity
Feb ’22
Quick Look AR not accessible in in-app browers // iOS 15.8
Will AR Quick Look support be provided via in-app browsers on iOS 15? The most recent update of iOS 15 doesn't provide this functionality. The user sees a greyed out AR button. The Object mode works as expected, however. To replicate: Send this link (https://www.apple.com/events) to the Gmail app, or message it to yourself in Slack or Discord Open it Tap on the Apple logo
Replies
3
Boosts
0
Views
2.0k
Activity
Feb ’22