# 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:** 1\
**Showing post:** 4

<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 .

---

_[View the full topic](https://forums.unrealengine.com/t/sequencer-mute-tracks-at-runtime-from-c/476278)._
