# Interactions with quicklook using python tools

**URL:** <https://forum.aousd.org/t/interactions-with-quicklook-using-python-tools/1508>\
**Category:** USD\
**Tags:** python, quicklook\
**Created:** [May 9, 2024, 5:39am UTC](https://forum.aousd.org/t/interactions-with-quicklook-using-python-tools/1508 "2024-05-09T05:39:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevlon](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kevlon](https://forum.aousd.org/u/Kevlon)\
**Post date:** [May 9, 2024, 5:39am UTC](https://forum.aousd.org/t/interactions-with-quicklook-using-python-tools/1508/1 "2024-05-09T05:39:17Z")

</div>

Hi all,

I would like to add some interactions in usd using python tools. Specifically I would like some tap/click interactions in usd files that eventually will be ported to usdz.

Specially in this example:  
[https://openusd.org/release/tut\_xforms.html](https://openusd.org/release/tut_xforms.html)

In step 3,

def AddSpin(top):  
spin = top.AddRotateZOp(opSuffix=‘spin’)  
spin.Set(time=1, value=0)  
spin.Set(time=192, value=1440)

def Step3():  
stage = MakeInitialStage(‘Step3.usda’)  
stage.SetMetadata(‘comment’, ‘Step 3: Adding spin animation’)  
top = AddReferenceToGeometry(stage, ‘/Top’)  
AddSpin(top)  
stage.Save()

Is there a way to add an interaction to start/stop the animation? e.g. if I were to open this in quicklook (after exporting to usdz).

Also any other helpful information on interactivity would be very helpful!  
Thanks!

---

<div class="post-metadata">

**Author:** ![dhruvgovil](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/dhruvgovil/32/3_2.png) [@dhruvgovil](https://forum.aousd.org/u/dhruvgovil)\
**Post date:** [May 18, 2024, 2:05pm UTC](https://forum.aousd.org/t/interactions-with-quicklook-using-python-tools/1508/2 "2024-05-18T14:05:33Z")

</div>

Sorry for the delayed response. Since the behaviour schemas for QuickLook are bespoke/preliminary schemas, personally I would recommend exporting an example of what you want out of Reality Composer (non-Pro) as a USDZ file.

If you convert the USDZ file to a usda, you should be able to see the exact schema names and attributes to use.

I believe @herbst has done some work for his web product for some common ones and might be of assistance too.

---

<div class="post-metadata">

**Author:** ![Kevlon](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kevlon](https://forum.aousd.org/u/Kevlon)\
**Post date:** [May 19, 2024, 1:04am UTC](https://forum.aousd.org/t/interactions-with-quicklook-using-python-tools/1508/3 "2024-05-19T01:04:11Z")

</div>

No worries! thanks for the response!

Unfortunately I have a newer OS and can’t install/use non-Pro reality composer. I have read multiple times that USDZ can do this even on the Apple developer website!

> **[Preliminary\_Behavior | Apple Developer Documentation](https://developer.apple.com/documentation/arkit/arkit_in_ios/usdz_schemas_for_ar/actions_and_triggers/preliminary_behavior)**
>
> A typed schema that combines one or more triggers with associated actions.

But I don’t know how to put the pieces together in python or manually through editing a usda file. I placed a post on the Apple dev forums too  
([USD/Z schemas and Declarations | Apple Developer Forums](https://developer.apple.com/forums/thread/751671)) but that place seems quite dead!

I would even settle for an interactive USDZ file but I can’t find one anywhere!

---

<div class="post-metadata">

**Author:** ![dhruvgovil](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/dhruvgovil/32/3_2.png) [@dhruvgovil](https://forum.aousd.org/u/dhruvgovil)\
**Post date:** [May 19, 2024, 1:05am UTC](https://forum.aousd.org/t/interactions-with-quicklook-using-python-tools/1508/4 "2024-05-19T01:05:56Z")

</div>

If you have an iPhone or iPad, you can run the non Pro Reality Composer on it and export to USDZ from there perhaps.

---

<div class="post-metadata">

**Author:** ![Kevlon](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kevlon](https://forum.aousd.org/u/Kevlon)\
**Post date:** [May 19, 2024, 1:32am UTC](https://forum.aousd.org/t/interactions-with-quicklook-using-python-tools/1508/5 "2024-05-19T01:32:45Z")

</div>

unfortunately no option to export usdz just .reality ☹

I’m a little lost on how to add a schema to a usda file

or to use this declaration with the usda file  
class Preliminary\_Behavior “Preliminary\_Behavior” (  
inherits =   
)

do you know any resources that can help? that would be a big help thanks! 🙂

---

<div class="post-metadata">

**Author:** ![dhruvgovil](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/dhruvgovil/32/3_2.png) [@dhruvgovil](https://forum.aousd.org/u/dhruvgovil)\
**Post date:** [May 19, 2024, 1:33am UTC](https://forum.aousd.org/t/interactions-with-quicklook-using-python-tools/1508/6 "2024-05-19T01:33:50Z")

</div>

Oh sorry, forgot to mention. Go to the settings app, look for Reality Composer there and there’s an option to Enable USDZ Export. It’s off by default.

With regards to using the schema, you can create it ad hoc.

In Python, you have stage.DefinePrim and one of the arguments is the type name. You can give it any arbitrary string. As long as it matches something known, it’ll be fine.

---

<div class="post-metadata">

**Author:** ![Kevlon](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kevlon](https://forum.aousd.org/u/Kevlon)\
**Post date:** [May 19, 2024, 1:41am UTC](https://forum.aousd.org/t/interactions-with-quicklook-using-python-tools/1508/7 "2024-05-19T01:41:04Z")

</div>

oh awesome, thank you for that! huge help!

I’ll have play and report back too for others! 🙂

---

<div class="post-metadata">

**Author:** ![herbst](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/herbst/32/905_2.png) [@herbst](https://forum.aousd.org/u/herbst)\
**Post date:** [June 5, 2024, 8:42am UTC](https://forum.aousd.org/t/interactions-with-quicklook-using-python-tools/1508/8 "2024-06-05T08:42:30Z")

</div>

Needle indeed has the capability to generate USDZ with `Preliminary_Behavior` on the fly from browser applications, including an API that can emit arbitrarily compex behaviour chains (more complex than what Reality Composer allows for). It also includes higher-level logic for commonly used scenarios such as playing multiple animations, switching materials, and so on.

You can take a look at some examples here:

> **[Augmented Reality Showcase](https://engine.needle.tools/projects/ar-showcase/)**
>
> High-quality interactive augmented reality projects – try them now on iOS and Android.

and in the docs:

> **[Needle Engine Documentation](https://engine.needle.tools/docs/everywhere-actions.html)**
>
> \---
> Needle's Everywhere Actions are a set of carefully chosen components that allow you to create interactive experiences in Unity without writing a single line of code.
> They are designed to serve as building blocks for experiences across the web,...

---

<div class="post-metadata">

**Author:** ![Kevlon](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kevlon](https://forum.aousd.org/u/Kevlon)\
**Post date:** [June 6, 2024, 12:32am UTC](https://forum.aousd.org/t/interactions-with-quicklook-using-python-tools/1508/9 "2024-06-06T00:32:59Z")

</div>

Wow!

This is incredible stuff! I have managed to build the interactivity I needed by using Reality Composer and manually editing the usda file as a template (I am building this to be unique and defined per user) - but this looks incredible.

I will take a look - many thanks!
