I’m trying to expose the ability to mute/solo/disable a sequencer track from a c++ plugin to python, to be used in-editor by tools that would need to mute certains tracks based on a context, but only locally.
The mute functionality is perfect for that, but it’s not exposed to python API and I struggle to even reproduce it in c++.
On a UMovieSceneTrack, I see the functions SetEvalDisabled and SetLocalEvalDisabled, which corresponds to Disable and Mute. Using track->Modify(true) and track->SetEvalDisabled(true) is correctly disabling the track and the small icon turn white like it should. But with SetLocalEvalDisabled, the track is muted but the icon does not turn white, and when some other states are modified in the sequencer, the mute is reset.
Should I do something else to make it more persistent ?
I also tried another way, with the IMutableExtension and SetIsMuted function, which seems to be what is used by the slate UI.
However I struggle to retrieve the correct object types needed to be able to call this function.
So, in 5.6 (the engine version you’ve indicated you’re on), this is not possible to script; it’s something that we added in 5.7. Also, the methodology for scripting it is very different than other things due. Here’s the CL in Github where we added it: https://github.com/EpicGames/UnrealEngine/commit/3ac07f8ef939ea2c9741476078704959c33a22ca. Here’s what those functions look like in the blueprint version, and it is not like working with tracks typically.
In terms of using SetEvalDisabled and SetLocalEvalDisabled, they have different requirements to indicate that the track is modified. You’ve got the right of it for SetEvalDisabled, but for LocalEvalDisabled, you will need to do something like:
Yes I had tested with `Sequencer->NotifyMovieSceneDataChanged(EMovieSceneDataChangeType::TrackValueChanged);`, but it still does not make the little eye icon white
And whenever I click on any of the little eye icon, tracks that were muted via my script are automatically unmuted. I guess the information is not stored everywhere and something resets it.
That’s great if this will be easier in 5.7!
But I’d like to find a solution for 5.6 as we won’t pass on 5.7 for our project.
Do you think this is achievable ?
I’m almost there, I just miss one little thing: that the mute is not reset, and I think for that the eye icon should be modified somehow. (I don’t mean to save it in the asset, I know it is not saved)
Track->SetLocalRowEvalDisabled(bLocalEvalDisabled, TrackRowIndex);as well. But again, this isn’t really a method we sanction now, and so I would continue to recommend the above.
Unfortunately, I tried adding SetLocalRowEvalDisabled on index 0 (by default, not sure how to know which index I should set) but’s too much effective… now I cannot unmute the tracks ^^’ and the eye icon doesn’t get white.
It seems too much of a hassle and I lack time, so we’ll do without then.