# Can you add a spatializer to an existing 2D event?

**URL:** <https://qa.fmod.com/t/can-you-add-a-spatializer-to-an-existing-2d-event/19055>\
**Category:** FMOD Engine\
**Created:** [July 26, 2022, 10:03am UTC](https://qa.fmod.com/t/can-you-add-a-spatializer-to-an-existing-2d-event/19055 "2022-07-26T10:03:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobinBouchez](https://avatars.discourse-cdn.com/v4/letter/r/c6cbf5/32.png) [@RobinBouchez](https://qa.fmod.com/u/RobinBouchez)\
**Post date:** [July 26, 2022, 10:03am UTC](https://qa.fmod.com/t/can-you-add-a-spatializer-to-an-existing-2d-event/19055/1 "2022-07-26T10:03:19Z")

</div>

Hi!

I already have all my events but I want to turn them all into 3D events instead of 2D events. Can this be done through the Scripting API?

Thanks,

```auto
function AddSpatializer()
{
    _event.addEffect("SpatialiserEffect")
}

studio.menu.addMenuItem({
    name: "***\\Add Spatializer",
    isEnabled: function() { var _event = studio.window.browserCurrent(); return _event && _event.isOfExactType("Event"); },
    execute: function() { AddSpatializer(); }
});

```

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [July 27, 2022, 4:50am UTC](https://qa.fmod.com/t/can-you-add-a-spatializer-to-an-existing-2d-event/19055/2 "2022-07-27T04:50:42Z")

</div>

Hi,

Yes! You can, it will be a lot easier to do it in FMOD Studio using [FMOD Studio | Bulk Editing Events](https://fmod.com/docs/2.02/studio/authoring-events.html#bulk-editing-events). Select all your `Events` in Studio and right-click on the Deck, where to find the Deck in the Studio is explained in the [Glossary](https://www.fmod.com/docs/2.01/studio/glossary.html#deck), then add `FMOD Spatializer`. The `Spatializer` should then be added to all selected `Events`.

> **Studio Example**
>
> ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/4/4d7f7db36625b4475ee986a6d0d5f13f4594134b.png)

To add Spatializers through scripting add this script to the FMOD Directory e.g. `C:\Program Files\FMOD SoundSystem\FMOD Studio 2.02.07\scripts`

> **Add Spatializer**
>
> ```auto
> // Adding menu option 
> studio.menu.addMenuItem({
> name: "Add Spatializer",
> execute: function() { AddSpatializer();},
> })
> 
> // Function to add Spatializers 
> function AddSpatializer() {
> // Retrieve an array of all the events in our project 
> var allEvents = studio.project.model.Event.findInstances();
> 
> for(var i=0; i < allEvents.length; i++) {
> // If the event already has a spatializer then skip it 
> if (allEvents[i].is3D() == true)
> continue; 
> else
> allEvents[i].masterTrack.mixerGroup.effectChain.addEffect("SpatialiserEffect");
> }
> // Print when it has run successfully 
> alert("Added Spatializer");
> }
> 
> ```

I hope this helps!

---

<div class="post-metadata">

**Author:** ![RobinBouchez](https://avatars.discourse-cdn.com/v4/letter/r/c6cbf5/32.png) [@RobinBouchez](https://qa.fmod.com/u/RobinBouchez)\
**Post date:** [August 1, 2022, 8:35am UTC](https://qa.fmod.com/t/can-you-add-a-spatializer-to-an-existing-2d-event/19055/3 "2022-08-01T08:35:05Z")

</div>

Yes, thanks a lot!
