27 lines
No EOL
888 B
C#
27 lines
No EOL
888 B
C#
using System.Linq;
|
|
using JD.Timeline.Plugin;
|
|
using JD.Timeline.View.Actions.Refactor;
|
|
using JD.Serialization;
|
|
|
|
namespace JD.Timeline.View.Actions
|
|
{
|
|
public class AssignToSelectedActorHandler : TapeActionHandlerBase
|
|
{
|
|
public override bool Update(TeaBox.ActionContext context, TeaBox.ActionInfo info)
|
|
{
|
|
return info.Visible = SelectedClips.OfType<ClipWithActor>().Any() && TimelinePlugin.Instance.World.SelectedActorNames.Any();
|
|
}
|
|
|
|
public override void Execute(TeaBox.ActionExecutionContext context)
|
|
{
|
|
foreach (var clip in SelectedClips.OfType<ClipWithActor>())
|
|
{
|
|
clip.ActorPaths.Clear();
|
|
foreach (var actor in TimelinePlugin.Instance.World.SelectedActorNames)
|
|
{
|
|
clip.ActorPaths.Add(actor);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |