Launching AR via Intent

Hi,

I know it’s a really clumsy way to approach user interaction with AR, but is it okay to start AR via Open URL with an intent applied to the URL?

For example…

intent://arvr.google.com/scene-viewer/1.0?file=https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Avocado/glTF/Avocado.gltf&mode=ar_only#Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;S.browser_fallback_url=https://developers.google.com/ar;end;

… basically, to launch the AR content in Scene Viewer so that it can be repositioned, scaled and rotated by the user?

I’m certain that there’s a much (much!) more elegant solution to allowing users to reposition, scale and rotate AR (I know that @ROBYER1, you produced something that looked really amazing :slightly_smiling_face: ) but unfortunately getting those other options to work is a bit beyond my capabilities at this point. So, I ended up wondering if launching into Scene Viewer might be a simple workaround for me but I wanted to check, first, that it doesn’t ‘mess anything up’ if I use the method I’ve described.

Cheeeeeeeeeeers, in advance, for any advice :slightly_smiling_face:

Original Post on Discord

by user 908977119781060648

Changed the channel name: Launching AR via Intent

by user 908977119781060648

@ROBYER1 I believe had shared some scripts for Needle to allow for that

I personally wouldn’t recommend SceneViewer, it is quite dated by now (even Google doesn’t use it anymore, they switched to WebXR too) and has a bunch of rendering issues

If you still want to use it you could either call the intent as you wrote it - did you try it and where there problems?

I have my own AR controls for WebXR AR on Android here which I have shared on Github - anyone is welcome to contribute or suggest improvements. It’s not perfect but I’m using it in production for Android AR, Apple AR is handled by Quick Look on iOS as the alternative
https://discord.com/channels/717429793926283276/1088477952263598110

by user 103054507105067008

Hi again and big thanks for the replies. They’re much appreciated! :smiling_face_with_three_hearts:

herbst, I did run some tests using the Scene Viewer ‘method’ and it worked… kinda… but I totally agree, it’s definitely quite flaky and not ideal by any means.

ROBYER1, I spotted your brilliant solution when you first posted it up and I scooted straight over to check it all out on GitHub but, sadly, I couldn’t figure out how to implement it. The demo looks great and works really well but, when I downloaded a zip of the repo, the Unity project didn’t contain any scene content and I couldn’t get my head around where things were supposed to be placed or applied.

I’ve probably missed something, so I’ll definitely take another look :slightly_smiling_face::+1:

by user 908977119781060648

I don’t think you can download a zip of the project as it is using Git LFS - you need to clone it using a Git client

by user 103054507105067008

Aha! Cheers @ROBYER1, I’ll give that a go :+1:

by user 908977119781060648

Doh. Sadly I’m still none the wiser :face_with_spiral_eyes:

As mentioned, I’m afraid that this is beyond my capabilities, until I become more experienced with Unity/Needle etc anyway. Many thanks for your suggestion, though @ROBYER1. Much appreciated :slightly_smiling_face:

by user 908977119781060648

If you just want to clone the web project from the repository Robert linked you can paste this link in the ExportInfo and it should download what you need if you’re using latest Needle Engine: https://github.com/ROBYER1/Needle-AR-Demo?path=Needle/ARDemo - with that you get the web project folder in the repository cloned to run it locally - it contains the scripts you’re interested in

just like that

That might be useful for you as well @ROBYER1 :slightly_smiling_face: ?path is optional if you want a subdirectory

Ooooooo, thanks @marcel :cactus: ! I will try that!

The repo that I downloaded as a zip did contain the scripts in question, but I couldn’t see them applied to anything within the project.

Maybe it’ll look different if I do as you’ve suggested. I’ll give it a go right now :slightly_smiling_face:

by user 908977119781060648

and @ROBYER1 with that it’s also possible to create custom templates pulled from git
image.png
image.png

I think you need to open the script directory right now and save each script again so it generates the Unity components. That doesnt happen automatically right now - I’ll make a task internally for that

and then we have to ask @ROBYER1 again which scripts you need and how to use them :slightly_smiling_face:

If you open the files and save them and focus Unity it will generate the components @frannie :beer:
image.png
image.png

Thanks. I’ll try that :+1:

by user 908977119781060648

Actually, I don’t think that’s the problem. The generated scripts do already exist.

by user 908977119781060648