using Newtonsoft.Json;
using Shuttle.Api.AfterEffectsDTO.Properties;
namespace Shuttle.Api.AfterEffectsDTO
{
///
/// The Layer object provides access to layers within compositions. It can be accessed from an item’s
/// layer collection either by index number or by a name string.
///
public class Layer
{
///
/// When true, the layer’s video is active at the current time. For this to be true, the layer must be
/// enabled, no other layer may be soloing unless this layer is soloed too, and the time must be
/// between the inPointandoutPoint values of this layer. This value is never true in an audio layer; there is
/// a separate audioActive attribute in the AVLayer object.
///
[JsonProperty("active")]
public bool Active { get; set; }
///
/// True if the layer is an adjustment layer.
///
[JsonProperty("adjustmentLayer")]
public bool AdjustmentLayer { get; set; }
///
/// True if the layer’s audio is active at the current time. For this value to be true, audioEnabled
/// must be true, no other layer with audio may be soloing unless this layer is soloed too, and the time
/// must be between the inPointand outPoint of this layer.
///
[JsonProperty("audioActive", NullValueHandling = NullValueHandling.Ignore)]
public bool? AudioActive { get; set; }
///
/// When true, the layer’s audio is enabled. This value corresponds to the audio toggle switch in the
/// Timeline panel.
///
[JsonProperty("audioEnabled", NullValueHandling = NullValueHandling.Ignore)]
public bool? AudioEnabled { get; set; }
///
/// The type of automatic orientation to perform for the layer.
///
[JsonProperty("autoOrient")]
public int AutoOrient { get; set; }
///
/// The blending mode of the layer.
///
[JsonProperty("blendingMode", NullValueHandling = NullValueHandling.Ignore)]
public int? BlendingMode { get; set; }
///
/// True if it is legal to change the value of the collapseTransformation attribute on this layer.
///
[JsonProperty("canSetCollapseTransformation", NullValueHandling = NullValueHandling.Ignore)]
public bool? CanSetCollapseTransformation { get; set; }
[JsonProperty("canSetEnabled")]
public bool CanSetEnabled { get; set; }
///
/// True if it is legal to change the value of the timeRemapEnabled attribute on this layer.
///
[JsonProperty("canSetTimeRemapEnabled", NullValueHandling = NullValueHandling.Ignore)]
public bool? CanSetTimeRemapEnabled { get; set; }
///
/// True if collapse transformation is on for this layer.
///
[JsonProperty("collapseTransformation", NullValueHandling = NullValueHandling.Ignore)]
public bool? CollapseTransformation { get; set; }
///
/// A descriptive comment for the layer.
///
[JsonProperty("comment")]
public string Comment { get; set; }
///
/// Id of the composition that contains this layer.
///
[JsonProperty("containingComp")]
public int ContainingCompId { get; set; }
///
/// True if the layer’s effects are active, as indicated by the <f> icon next to it in the user
/// interface.
///
[JsonProperty("effectsActive", NullValueHandling = NullValueHandling.Ignore)]
public bool? EffectsActive { get; set; }
[JsonProperty("elided")]
public bool Elided { get; set; }
///
/// When true, the layer is enabled; otherwise false. This corresponds to the video switch state of
/// the layer in the Timeline panel.
///
[JsonProperty("enabled")]
public bool Enabled { get; set; }
///
/// True if this is an environment layer in a Ray-traced 3D composition. Setting this attribute to
/// true automaticallymakes the layer 3D (threeDLayer becomes true).
///
[JsonProperty("environmentLayer")]
public bool EnvironmentLayer { get; set; }
///
/// True if frame blending is enabled for the layer.
///
[JsonProperty("frameBlending", NullValueHandling = NullValueHandling.Ignore)]
public bool? FrameBlending { get; set; }
///
/// The type of frame blending to perform when frame blending is enabled for the layer.
///
[JsonProperty("frameBlendingType", NullValueHandling = NullValueHandling.Ignore)]
public int? FrameBlendingType { get; set; }
///
/// True if the layer is a guide layer.
///
[JsonProperty("guideLayer", NullValueHandling = NullValueHandling.Ignore)]
public bool? GuideLayer { get; set; }
///
/// True if the layer contains an audio component, regardless of whether it is audio-enabled or
/// soloed.
///
[JsonProperty("hasAudio", NullValueHandling = NullValueHandling.Ignore)]
public bool? HasAudio { get; set; }
///
/// True if the layer in front of this layer is being used as a track matte on this layer. When true,
/// this layer’s trackMatteType value controls how the matte is applied.
///
[JsonProperty("hasTrackMatte", NullValueHandling = NullValueHandling.Ignore)]
public bool? HasTrackMatte { get; set; }
///
/// When true, the layer has a video switch (the eyeball icon) in the Timeline panel; otherwise false.
///
[JsonProperty("hasVideo")]
public bool HasVideo { get; set; }
///
/// The height of the layer in pixels.
///
[JsonProperty("height", NullValueHandling = NullValueHandling.Ignore)]
public int? Height { get; set; }
///
/// The “in” point of the layer, expressed in composition time (seconds).
///
[JsonProperty("inPoint")]
public float InPoint { get; set; }
///
/// The index position of the layer.
///
[JsonProperty("index")]
public int Index { get; set; }
[JsonProperty("isEffect")]
public bool IsEffect { get; set; }
[JsonProperty("isMask")]
public bool IsMask { get; set; }
[JsonProperty("isModified")]
public bool IsModified { get; set; }
///
/// True if the layer has no expressly set name, but contains a named source. In this case, layer.name
/// has the same value as layer.source.name. False if the layer has an expressly set name, or if the
/// layer does not have a source.
///
[JsonProperty("isNameFromSource", NullValueHandling = NullValueHandling.Ignore)]
public bool? IsNameFromSource { get; set; }
///
/// True if the value of the name attribute has been set explicitly, rather than automatically from
/// the source.
///
[JsonProperty("isNameSet")]
public bool IsNameSet { get; set; }
///
/// True if this layer is being used as a track matte for the layer behind it.
///
[JsonProperty("isTrackMatte", NullValueHandling = NullValueHandling.Ignore)]
public bool? IsTrackMatte { get; set; }
[JsonProperty("label")]
public int Label { get; set; }
///
/// When true, the layer is locked; otherwise false. This corresponds to the lock toggle in the Layer
/// panel.
///
[JsonProperty("locked")]
public bool Locked { get; set; }
[JsonProperty("matchName")]
public string MatchName { get; set; }
///
/// True if motion blur is enabled for the layer.
///
[JsonProperty("motionBlur", NullValueHandling = NullValueHandling.Ignore)]
public bool? MotionBlur { get; set; }
///
/// The name of the layer. By default, this is the same as the Source name (which cannot be changed in
/// the Layer panel), but you can set it to be different.
///
[JsonProperty("name")]
public string Name { get; set; }
///
/// When true, the layer was created as a null object; otherwise false.
///
[JsonProperty("nullLayer")]
public bool NullLayer { get; set; }
[JsonProperty("numProperties")]
public int NumProperties { get; set; }
///
/// The “out” point of the layer, expressed in composition time (seconds).
///
[JsonProperty("outPoint")]
public float OutPoint { get; set; }
///
/// True if preserve transparency is enabled for the layer.
///
[JsonProperty("preserveTransparency", NullValueHandling = NullValueHandling.Ignore)]
public bool? PreserveTransparency { get; set; }
///
/// The quality with which this layer is displayed.
///
[JsonProperty("quality", NullValueHandling = NullValueHandling.Ignore)]
public int? Quality { get; set; }
///
/// Set/get layer sampling method (bicubic or bilinear)
///
[JsonProperty("samplingQuality", NullValueHandling = NullValueHandling.Ignore)]
public int? SamplingQuality { get; set; }
[JsonProperty("selected")]
public bool Selected { get; set; }
///
/// An array containing all of the currently selected Property and PropertyGroup objects in the layer.
///
[JsonProperty("selectedProperties")]
public PropertyBase[] SelectedProperties { get; private set; } = new PropertyBase[0];
///
/// When true, the layer is “shy”, meaning that it is hidden in the Layer panel if the composition’s
/// “Hide all shy layers” option is toggled on.
///
[JsonProperty("shy")]
public bool Shy { get; set; }
///
/// When true, the layer is soloed, otherwise false.
///
[JsonProperty("solo")]
public bool Solo { get; set; }
///
/// The source AVItem for this layer. The value is null in a Text layer. Use AVLayer.replaceSource()
/// to change the value.
///
[JsonProperty("source", NullValueHandling = NullValueHandling.Ignore)]
public int? Source { get; set; }
///
/// The start time of the layer, expressed in composition time (seconds).
///
[JsonProperty("startTime")]
public float StartTime { get; set; }
///
/// The layer’s time stretch, expressed as a percentage. A value of 100 means no stretch. Values
/// between 0 and 1 are set to 1, and values between -1 and 0 (not including 0) are set to -1.
///
[JsonProperty("stretch")]
public float Stretch { get; set; }
///
/// True if this is a 3D layer.
///
[JsonProperty("threeDLayer", NullValueHandling = NullValueHandling.Ignore)]
public bool? ThreeDLayer { get; set; }
///
/// True if this layer has the Enable Per-character 3D switch set, allowing its characters to be
/// animated off the plane of the text layer. Applies only to text layers.
///
[JsonProperty("threeDPerChar", NullValueHandling = NullValueHandling.Ignore)]
public bool? ThreeDPerChar { get; set; }
///
/// The current time of the layer, expressed in composition time (seconds).
///
[JsonProperty("time")]
public float Time { get; set; }
///
/// True if time remapping is enabled for this layer.
///
[JsonProperty("timeRemapEnabled", NullValueHandling = NullValueHandling.Ignore)]
public bool? TimeRemapEnabled { get; set; }
///
/// If this layer has a track matte, specifies the way the track matte is applied.
///
[JsonProperty("trackMatteType", NullValueHandling = NullValueHandling.Ignore)]
public int? TrackMatteType { get; set; }
///
/// The width of the layer in pixels.
///
[JsonProperty("width", NullValueHandling = NullValueHandling.Ignore)]
public int? Width { get; set; }
///
/// For a light layer, its light type. Trying to set this attribute for a non-light layer produces an
/// error.
///
[JsonProperty("lightType", NullValueHandling = NullValueHandling.Ignore)]
public int? LightType { get; set; }
///
/// The parent of this layer; can be null. Offset values are calculated to counterbalance any
/// transforms above this layer in the hierarchy, so that when you set the parent there is no apparent jump in
/// the layer’s transform. For example, if the new parent has a rotation of 30 degrees, the child layer
/// is assigned a rotation of -30 degrees. To set the parent without changing the child layer’s transform
/// values, use the setParentWithJump method.
///
[JsonProperty("parent")]
public Layer Parent { get; set; }
public override string ToString()
{
return Name;
}
}
}