You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

32 lines
1.2 KiB

using System;
using UnityEngine;
using UnityEngine.Animations.Rigging;
namespace UnityEditor.Animations.Rigging
{
/// <summary>
/// The [InverseRigConstraint] attribute allows to match an inverse constraint (inverse solve) to its
/// base constraint (forward solve) counterpart. This is used in bi-directional baking to override
/// constraints when baking animations to constraints.
/// </summary>
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public sealed class InverseRigConstraintAttribute : Attribute
{
/// <summary>
/// Constructor.
/// </summary>
/// <param name="targetBinderType">The base constraint type.</param>
public InverseRigConstraintAttribute(Type targetBinderType)
{
if (targetBinderType == null || !typeof(IRigConstraint).IsAssignableFrom(targetBinderType))
Debug.LogError("Invalid constraint for InverseRigConstraint attribute.");
this.baseConstraint = targetBinderType;
}
/// <summary>
/// Retrieves the base constraint type.
/// </summary>
public Type baseConstraint { get; }
}
}