# Sequencer: Mute tracks at runtime from C++

**URL:** <https://forums.unrealengine.com/t/sequencer-mute-tracks-at-runtime-from-c/476278>\
**Category:** Cinematics & Media\
**Tags:** unreal-engine, question\
**Created:** [December 22, 2020, 2:37pm UTC](https://forums.unrealengine.com/t/sequencer-mute-tracks-at-runtime-from-c/476278 "2020-12-22T14:37:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_bcbe794b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_bcbe794b](https://forums.unrealengine.com/u/anonymous_user_bcbe794b)\
**Post date:** [December 22, 2020, 2:37pm UTC](https://forums.unrealengine.com/t/sequencer-mute-tracks-at-runtime-from-c/476278/1 "2020-12-22T14:37:36Z")

</div>

Hi -

Is there a way to mute, i.e. disable the evaluation, of a track at runtime. Specifically, I want to be able to mute a transform track at runtime without explicitly setting the mute flag on the track in the level sequence.

Thanks,

---

<div class="post-metadata">

**Author:** ![Max.Chen](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/max.chen/32/1194502_2.png) [@Max.Chen](https://forums.unrealengine.com/u/Max.Chen)\
**Post date:** [January 12, 2021, 6:02pm UTC](https://forums.unrealengine.com/t/sequencer-mute-tracks-at-runtime-from-c/476278/2 "2021-01-12T18:02:40Z")

</div>

You’ll need to get the object’s tracks, find the transform track, and then find the sections on the track. Once you have the section, you can toggle the active boolean.

Here’s a snippet of what you can do in an editor utility widget blueprint graph (same can be done in python). If you’re looking for code, take a look at FSequencer::ToggleNodeActive.

 ![327025-setsections.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/4/d/f4dbaa9ac75eb2bab064c0e9bf30be39e5dec53c.jpeg)

---

<div class="post-metadata">

**Author:** ![Megurine](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/megurine/32/490361_2.png) [@Megurine](https://forums.unrealengine.com/u/Megurine)\
**Post date:** [November 22, 2022, 2:26pm UTC](https://forums.unrealengine.com/t/sequencer-mute-tracks-at-runtime-from-c/476278/3 "2022-11-22T14:26:28Z")

</div>

Hello, this solution is far from perfect because the SetIsActive() call Modify() , a WITH\_EDITORONLY function.  
You can compile but the function is not called in build.

If anyone else has another solution or idea that would be great!, thank you 🙂

---

<div class="post-metadata">

**Author:** ![JulienChevallay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JulienChevallay](https://forums.unrealengine.com/u/JulienChevallay)\
**Post date:** [November 23, 2022, 11:53am UTC](https://forums.unrealengine.com/t/sequencer-mute-tracks-at-runtime-from-c/476278/4 "2022-11-23T11:53:48Z")

</div>

Hello, to disable sequencer tracks at runtime I used

- UMovieSceneTrack::SetEvalDisabled(bool)
- ULevelSequence::MarkAsChanged()
- MovieSceneCompiledDataManager::GetPrecompiledData()-\>Compile(ULevelSequence\*)

```auto
// You first have to set the unwanted track as disabled via 
void YourDisableTrackFunction(UMovieSceneTrack* MovieSceneTrack, bool Value)
{
	if (MovieSceneTrack)
	{
		MovieSceneTrack->SetEvalDisabled(Value);
	}
}

// Then notify the sequencer that the tracks have been modified using MarkAsChanged and UMovieSceneCompiledDataManager::GetPrecompiledData()->Compile.
void YourMarkAsChangedFunction(ULevelSequence* Sequence)
{
	if (Sequence)
	{
		Sequence->MarkAsChanged();
		if (UMovieSceneCompiledDataManager::GetPrecompiledData())
		{
			UMovieSceneCompiledDataManager::GetPrecompiledData()->Compile(Sequence);
		}
	}
}

```

Use this if you want to notify multiple modifications at one time during runtime.

There is another option to set the concerned track as volatile which if I understood well, doesn’t need to markaschanged and compile the sequencer when you modify the tracks at runtime.  
I didn’t tried it.

```auto
// this needs to be done in the editor on the concerned tracks
void YourSetLevelSequenceAsVolatileFunction(ULevelSequence* Sequence)
{
	if (Sequence)
	{
		Sequence->SetSequenceFlags(Sequence->GetFlags() | EMovieSceneSequenceFlags::Volatile);
		Sequence->MarkAsChanged();
		if (UMovieSceneCompiledDataManager::GetPrecompiledData())
		{ UMovieSceneCompiledDataManager::GetPrecompiledData()->Compile(Sequence);
		}
	}
}

```

Ps: Do not forget to reenable the tracks if you need them later on .

---

<div class="post-metadata">

**Author:** ![Eagleton](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Eagleton](https://forums.unrealengine.com/u/Eagleton)\
**Post date:** [January 29, 2024, 12:22pm UTC](https://forums.unrealengine.com/t/sequencer-mute-tracks-at-runtime-from-c/476278/5 "2024-01-29T12:22:15Z")

</div>

Is there any way to mute tracks for UUMGSequencePlayer in apk?

---

<div class="post-metadata">

**Author:** ![chibitotoro](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chibitotoro/32/1145779_2.png) [@chibitotoro](https://forums.unrealengine.com/u/chibitotoro)\
**Post date:** [April 19, 2024, 9:09pm UTC](https://forums.unrealengine.com/t/sequencer-mute-tracks-at-runtime-from-c/476278/6 "2024-04-19T21:09:59Z")

</div>

Originally I thought I was going crazy with it not working, but it turns out the mistake was with using Get Display Name to compare the Binding Track names. If you’re using this, make sure you’re using Get Name instead and it should work. Thanks to JulienChevallay!
