2014-12-07 19:09:38 -05:00
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
2014-07-08 09:43:39 -04:00
# include "AnimGraphPrivatePCH.h"
# include "AnimGraphNode_BoneDrivenController.h"
2015-06-17 18:54:05 -04:00
# include "CompilerResultsLog.h"
# include "PropertyEditing.h"
2015-06-30 22:25:56 -04:00
# include "AnimationCustomVersion.h"
2014-07-08 09:43:39 -04:00
# define LOCTEXT_NAMESPACE "A3Nodes"
2014-10-14 10:29:11 -04:00
UAnimGraphNode_BoneDrivenController : : UAnimGraphNode_BoneDrivenController ( const FObjectInitializer & ObjectInitializer )
: Super ( ObjectInitializer )
2014-07-08 09:43:39 -04:00
{
}
2015-06-30 22:25:56 -04:00
void UAnimGraphNode_BoneDrivenController : : Serialize ( FArchive & Ar )
{
Super : : Serialize ( Ar ) ;
Ar . UsingCustomVersion ( FAnimationCustomVersion : : GUID ) ;
2015-07-13 19:53:41 -04:00
const int32 AnimVersion = Ar . CustomVer ( FAnimationCustomVersion : : GUID ) ;
2015-06-30 22:25:56 -04:00
2015-07-13 19:53:41 -04:00
if ( AnimVersion < FAnimationCustomVersion : : BoneDrivenControllerRemapping )
{
if ( AnimVersion < FAnimationCustomVersion : : BoneDrivenControllerMatchingMaya )
2015-06-30 22:25:56 -04:00
{
2015-07-13 19:53:41 -04:00
// The node used to be able to only drive a single component rather than a selection of components
Node . ConvertTargetComponentToBits ( ) ;
// The old definition of range was clamping the output, rather than the input
if ( Node . bUseRange & & ! FMath : : IsNearlyZero ( Node . Multiplier ) )
{
// Before: Output = clamp(Input * Multipler)
// After: Output = clamp(Input) * Multiplier
Node . RangeMin / = Node . Multiplier ;
Node . RangeMax / = Node . Multiplier ;
}
2015-06-30 22:25:56 -04:00
}
2015-07-13 19:53:41 -04:00
Node . RemappedMin = Node . RangeMin ;
Node . RemappedMax = Node . RangeMax ;
2015-06-30 22:25:56 -04:00
}
}
2014-09-03 18:14:09 -04:00
FText UAnimGraphNode_BoneDrivenController : : GetTooltipText ( ) const
2014-07-08 09:43:39 -04:00
{
2014-09-03 18:14:09 -04:00
return LOCTEXT ( " UAnimGraphNode_BoneDrivenController_ToolTip " , " Drives the transform of a bone using the transform of another " ) ;
2014-07-08 09:43:39 -04:00
}
FText UAnimGraphNode_BoneDrivenController : : GetNodeTitle ( ENodeTitleType : : Type TitleType ) const
{
2015-06-30 22:25:56 -04:00
if ( ( Node . SourceBone . BoneName = = NAME_None ) & & ( Node . TargetBone . BoneName = = NAME_None ) & & ( ( TitleType = = ENodeTitleType : : ListView ) | | ( TitleType = = ENodeTitleType : : MenuTitle ) ) )
2014-07-08 09:43:39 -04:00
{
2014-09-04 11:25:05 -04:00
return GetControllerDescription ( ) ;
}
2015-06-30 22:25:56 -04:00
else
2014-09-04 11:25:05 -04:00
{
2015-06-30 22:25:56 -04:00
// Determine the mapping
FText FinalSourceExpression ;
{
FFormatNamedArguments SourceArgs ;
SourceArgs . Add ( TEXT ( " SourceBone " ) , FText : : FromName ( Node . SourceBone . BoneName ) ) ;
SourceArgs . Add ( TEXT ( " SourceComponent " ) , ComponentTypeToText ( Node . SourceComponent ) ) ;
if ( Node . DrivingCurve ! = nullptr )
{
FinalSourceExpression = LOCTEXT ( " BoneDrivenByCurve " , " curve({SourceBone}.{SourceComponent}) " ) ;
}
else
{
2015-07-13 19:53:41 -04:00
if ( Node . bUseRange )
2015-06-30 22:25:56 -04:00
{
2015-07-13 19:53:41 -04:00
if ( Node . Multiplier = = 1.0f )
{
FinalSourceExpression = LOCTEXT ( " WithRangeBoneMultiplierIs1 " , " remap({SourceBone}.{SourceComponent}) " ) ;
}
else
{
SourceArgs . Add ( TEXT ( " Multiplier " ) , FText : : AsNumber ( Node . Multiplier ) ) ;
FinalSourceExpression = LOCTEXT ( " WithRangeNonUnityMultiplier " , " remap({SourceBone}.{SourceComponent}) * {Multiplier} " ) ;
}
2015-06-30 22:25:56 -04:00
}
else
{
2015-07-13 19:53:41 -04:00
if ( Node . Multiplier = = 1.0f )
{
FinalSourceExpression = LOCTEXT ( " BoneMultiplierIs1 " , " {SourceBone}.{SourceComponent} " ) ;
}
else
{
SourceArgs . Add ( TEXT ( " Multiplier " ) , FText : : AsNumber ( Node . Multiplier ) ) ;
FinalSourceExpression = LOCTEXT ( " NonUnityMultiplier " , " {SourceBone}.{SourceComponent} * {Multiplier} " ) ;
}
2015-06-30 22:25:56 -04:00
}
}
FinalSourceExpression = FText : : Format ( FinalSourceExpression , SourceArgs ) ;
}
2014-09-04 11:25:05 -04:00
FFormatNamedArguments Args ;
Args . Add ( TEXT ( " ControllerDesc " ) , GetControllerDescription ( ) ) ;
Args . Add ( TEXT ( " TargetBone " ) , FText : : FromName ( Node . TargetBone . BoneName ) ) ;
2014-08-21 18:50:33 -04:00
2015-06-30 22:25:56 -04:00
// Determine the target component
int32 NumComponents = 0 ;
EComponentType : : Type TargetComponent = EComponentType : : None ;
# define UE_CHECK_TARGET_COMPONENT(ComponentProperty, ComponentChoice) if (ComponentProperty) { ++NumComponents; TargetComponent = ComponentChoice; }
UE_CHECK_TARGET_COMPONENT ( Node . bAffectTargetTranslationX , EComponentType : : TranslationX ) ;
UE_CHECK_TARGET_COMPONENT ( Node . bAffectTargetTranslationY , EComponentType : : TranslationY ) ;
UE_CHECK_TARGET_COMPONENT ( Node . bAffectTargetTranslationZ , EComponentType : : TranslationZ ) ;
UE_CHECK_TARGET_COMPONENT ( Node . bAffectTargetRotationX , EComponentType : : RotationX ) ;
UE_CHECK_TARGET_COMPONENT ( Node . bAffectTargetRotationY , EComponentType : : RotationY ) ;
UE_CHECK_TARGET_COMPONENT ( Node . bAffectTargetRotationZ , EComponentType : : RotationZ ) ;
UE_CHECK_TARGET_COMPONENT ( Node . bAffectTargetScaleX , EComponentType : : ScaleX ) ;
UE_CHECK_TARGET_COMPONENT ( Node . bAffectTargetScaleY , EComponentType : : ScaleY ) ;
UE_CHECK_TARGET_COMPONENT ( Node . bAffectTargetScaleZ , EComponentType : : ScaleZ ) ;
Args . Add ( TEXT ( " TargetComponents " ) , ( NumComponents < = 1 ) ? ComponentTypeToText ( TargetComponent ) : LOCTEXT ( " MultipleTargetComponents " , " multiple " ) ) ;
if ( ( TitleType = = ENodeTitleType : : ListView ) | | ( TitleType = = ENodeTitleType : : MenuTitle ) )
2014-08-21 18:50:33 -04:00
{
2014-09-04 11:25:05 -04:00
Args . Add ( TEXT ( " Delim " ) , FText : : FromString ( TEXT ( " - " ) ) ) ;
}
else
{
Args . Add ( TEXT ( " Delim " ) , FText : : FromString ( TEXT ( " \n " ) ) ) ;
2014-08-21 18:50:33 -04:00
}
2014-07-08 09:43:39 -04:00
2015-06-30 22:25:56 -04:00
Args . Add ( TEXT ( " SourceExpression " ) , FinalSourceExpression ) ;
return FText : : Format ( LOCTEXT ( " AnimGraphNode_BoneDrivenController_Title " , " {TargetBone}.{TargetComponents} = {SourceExpression}{Delim}{ControllerDesc} " ) , Args ) ;
2014-09-04 11:25:05 -04:00
}
2014-07-08 09:43:39 -04:00
}
FText UAnimGraphNode_BoneDrivenController : : GetControllerDescription ( ) const
{
return LOCTEXT ( " BoneDrivenController " , " Bone Driven Controller " ) ;
}
void UAnimGraphNode_BoneDrivenController : : Draw ( FPrimitiveDrawInterface * PDI , USkeletalMeshComponent * SkelMeshComp ) const
{
static const float ArrowHeadWidth = 5.0f ;
static const float ArrowHeadHeight = 8.0f ;
2015-06-17 18:54:05 -04:00
const int32 SourceIdx = SkelMeshComp - > GetBoneIndex ( Node . SourceBone . BoneName ) ;
const int32 TargetIdx = SkelMeshComp - > GetBoneIndex ( Node . TargetBone . BoneName ) ;
2014-07-08 09:43:39 -04:00
2015-06-17 18:54:05 -04:00
if ( ( SourceIdx ! = INDEX_NONE ) & & ( TargetIdx ! = INDEX_NONE ) )
2014-07-08 09:43:39 -04:00
{
2015-06-17 18:54:05 -04:00
const FTransform SourceTM = SkelMeshComp - > GetSpaceBases ( ) [ SourceIdx ] * SkelMeshComp - > ComponentToWorld ;
const FTransform TargetTM = SkelMeshComp - > GetSpaceBases ( ) [ TargetIdx ] * SkelMeshComp - > ComponentToWorld ;
2014-07-08 09:43:39 -04:00
PDI - > DrawLine ( TargetTM . GetLocation ( ) , SourceTM . GetLocation ( ) , FLinearColor ( 0.0f , 0.0f , 1.0f ) , SDPG_Foreground , 0.5f ) ;
2015-06-17 18:54:05 -04:00
const FVector ToTarget = TargetTM . GetTranslation ( ) - SourceTM . GetTranslation ( ) ;
const FVector UnitToTarget = ToTarget . GetSafeNormal ( ) ;
2014-07-08 09:43:39 -04:00
FVector Midpoint = SourceTM . GetTranslation ( ) + 0.5f * ToTarget + 0.5f * UnitToTarget * ArrowHeadHeight ;
FVector YAxis ;
FVector ZAxis ;
UnitToTarget . FindBestAxisVectors ( YAxis , ZAxis ) ;
2015-06-17 18:54:05 -04:00
const FMatrix ArrowMatrix ( UnitToTarget , YAxis , ZAxis , Midpoint ) ;
2014-07-08 09:43:39 -04:00
DrawConnectedArrow ( PDI , ArrowMatrix , FLinearColor ( 0.0f , 1.0f , 0.0 ) , ArrowHeadHeight , ArrowHeadWidth , SDPG_Foreground ) ;
PDI - > DrawPoint ( SourceTM . GetTranslation ( ) , FLinearColor ( 0.8f , 0.8f , 0.2f ) , 5.0f , SDPG_Foreground ) ;
PDI - > DrawPoint ( SourceTM . GetTranslation ( ) + ToTarget , FLinearColor ( 0.8f , 0.8f , 0.2f ) , 5.0f , SDPG_Foreground ) ;
}
}
2015-06-17 18:54:05 -04:00
void UAnimGraphNode_BoneDrivenController : : ValidateAnimNodeDuringCompilation ( USkeleton * ForSkeleton , FCompilerResultsLog & MessageLog )
{
if ( ForSkeleton - > GetReferenceSkeleton ( ) . FindBoneIndex ( Node . SourceBone . BoneName ) = = INDEX_NONE )
{
MessageLog . Warning ( * LOCTEXT ( " NoSourceBone " , " @@ - You must pick a source bone as the Driver joint " ) . ToString ( ) , this ) ;
}
if ( Node . SourceComponent = = EComponentType : : None )
{
MessageLog . Warning ( * LOCTEXT ( " NoSourceComponent " , " @@ - You must pick a source component on the Driver joint " ) . ToString ( ) , this ) ;
}
if ( ForSkeleton - > GetReferenceSkeleton ( ) . FindBoneIndex ( Node . TargetBone . BoneName ) = = INDEX_NONE )
{
MessageLog . Warning ( * LOCTEXT ( " NoTargetBone " , " @@ - You must pick a target bone as the Driven joint " ) . ToString ( ) , this ) ;
}
2015-06-30 22:25:56 -04:00
const bool bAffectsTranslation = Node . bAffectTargetTranslationX | | Node . bAffectTargetTranslationY | | Node . bAffectTargetTranslationZ ;
const bool bAffectsRotation = Node . bAffectTargetRotationX | | Node . bAffectTargetRotationY | | Node . bAffectTargetRotationZ ;
const bool bAffectsScale = Node . bAffectTargetScaleX | | Node . bAffectTargetScaleY | | Node . bAffectTargetScaleZ ;
if ( ! bAffectsTranslation & & ! bAffectsRotation & & ! bAffectsScale )
2015-06-17 18:54:05 -04:00
{
2015-06-30 22:25:56 -04:00
MessageLog . Warning ( * LOCTEXT ( " NoTargetComponent " , " @@ - You must pick one or more target components on the Driven joint " ) . ToString ( ) , this ) ;
2015-06-17 18:54:05 -04:00
}
Super : : ValidateAnimNodeDuringCompilation ( ForSkeleton , MessageLog ) ;
}
2015-06-30 22:25:56 -04:00
void UAnimGraphNode_BoneDrivenController : : AddTripletPropertyRow ( const FText & Name , const FText & Tooltip , IDetailCategoryBuilder & Category , TSharedRef < IPropertyHandle > PropertyHandle , const FName XPropertyName , const FName YPropertyName , const FName ZPropertyName )
{
const float XYZPadding = 5.0f ;
TSharedPtr < IPropertyHandle > XProperty = PropertyHandle - > GetChildHandle ( XPropertyName ) ;
Category . GetParentLayout ( ) . HideProperty ( XProperty ) ;
TSharedPtr < IPropertyHandle > YProperty = PropertyHandle - > GetChildHandle ( YPropertyName ) ;
Category . GetParentLayout ( ) . HideProperty ( YProperty ) ;
TSharedPtr < IPropertyHandle > ZProperty = PropertyHandle - > GetChildHandle ( ZPropertyName ) ;
Category . GetParentLayout ( ) . HideProperty ( ZProperty ) ;
Category . AddCustomRow ( Name )
. NameContent ( )
[
SNew ( STextBlock )
. Text ( Name )
. ToolTipText ( Tooltip )
. Font ( IDetailLayoutBuilder : : GetDetailFont ( ) )
]
. ValueContent ( )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. Padding ( 0.f , 0.f , XYZPadding , 0.f )
. AutoWidth ( )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
[
XProperty - > CreatePropertyNameWidget ( )
]
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
[
XProperty - > CreatePropertyValueWidget ( )
]
]
+ SHorizontalBox : : Slot ( )
. Padding ( 0.f , 0.f , XYZPadding , 0.f )
. AutoWidth ( )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
[
YProperty - > CreatePropertyNameWidget ( )
]
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
[
YProperty - > CreatePropertyValueWidget ( )
]
]
+ SHorizontalBox : : Slot ( )
. Padding ( 0.f , 0.f , XYZPadding , 0.f )
. AutoWidth ( )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
[
ZProperty - > CreatePropertyNameWidget ( )
]
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
[
ZProperty - > CreatePropertyValueWidget ( )
]
]
] ;
}
2015-07-13 19:53:41 -04:00
void UAnimGraphNode_BoneDrivenController : : AddRangePropertyRow ( const FText & Name , const FText & Tooltip , IDetailCategoryBuilder & Category , TSharedRef < IPropertyHandle > PropertyHandle , const FName MinPropertyName , const FName MaxPropertyName , TAttribute < EVisibility > VisibilityAttribute )
{
const float MiddlePadding = 4.0f ;
TSharedPtr < IPropertyHandle > MinProperty = PropertyHandle - > GetChildHandle ( MinPropertyName ) ;
Category . GetParentLayout ( ) . HideProperty ( MinProperty ) ;
TSharedPtr < IPropertyHandle > MaxProperty = PropertyHandle - > GetChildHandle ( MaxPropertyName ) ;
Category . GetParentLayout ( ) . HideProperty ( MaxProperty ) ;
Category . AddCustomRow ( Name )
. Visibility ( VisibilityAttribute )
. NameContent ( )
[
SNew ( STextBlock )
. Text ( Name )
. ToolTipText ( Tooltip )
. Font ( IDetailLayoutBuilder : : GetDetailFont ( ) )
]
. ValueContent ( )
. MinDesiredWidth ( 100.0f * 2.0f )
. MaxDesiredWidth ( 100.0f * 2.0f )
[
SNew ( SHorizontalBox )
+ SHorizontalBox : : Slot ( )
. FillWidth ( 1 )
. Padding ( 0.0f , 0.0f , MiddlePadding , 0.0f )
. VAlign ( VAlign_Center )
[
MinProperty - > CreatePropertyValueWidget ( )
]
+ SHorizontalBox : : Slot ( )
. AutoWidth ( )
[
SNew ( STextBlock )
. Text ( LOCTEXT ( " MinMaxSpacer " , " .. " ) )
. Font ( IDetailLayoutBuilder : : GetDetailFont ( ) )
]
+ SHorizontalBox : : Slot ( )
. FillWidth ( 1 )
. Padding ( MiddlePadding , 0.0f , 0.0f , 0.0f )
. VAlign ( VAlign_Center )
[
MaxProperty - > CreatePropertyValueWidget ( )
]
] ;
}
2015-06-17 18:54:05 -04:00
void UAnimGraphNode_BoneDrivenController : : CustomizeDetails ( IDetailLayoutBuilder & DetailBuilder )
{
TSharedRef < IPropertyHandle > NodeHandle = DetailBuilder . GetProperty ( GET_MEMBER_NAME_CHECKED ( UAnimGraphNode_BoneDrivenController , Node ) , GetClass ( ) ) ;
2015-06-30 22:25:56 -04:00
TAttribute < EVisibility > NotUsingCurveVisibility = TAttribute < EVisibility > : : Create ( TAttribute < EVisibility > : : FGetter : : CreateUObject ( this , & UAnimGraphNode_BoneDrivenController : : AreNonCurveMappingValuesVisible ) ) ;
2015-07-13 19:53:41 -04:00
TAttribute < EVisibility > MapRangeVisiblity = TAttribute < EVisibility > : : Create ( TAttribute < EVisibility > : : FGetter : : CreateUObject ( this , & UAnimGraphNode_BoneDrivenController : : AreRemappingValuesVisible ) ) ;
2015-06-30 22:25:56 -04:00
// Source (Driver) category
IDetailCategoryBuilder & SourceCategory = DetailBuilder . EditCategory ( TEXT ( " Source (Driver) " ) ) ;
// Mapping category
IDetailCategoryBuilder & MappingCategory = DetailBuilder . EditCategory ( TEXT ( " Mapping " ) ) ;
2015-06-17 18:54:05 -04:00
MappingCategory . AddProperty ( NodeHandle - > GetChildHandle ( GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , DrivingCurve ) ) ) ;
2015-06-30 22:25:56 -04:00
MappingCategory . AddProperty ( NodeHandle - > GetChildHandle ( GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , bUseRange ) ) ) . Visibility ( NotUsingCurveVisibility ) ;
2015-07-13 19:53:41 -04:00
AddRangePropertyRow (
/*Name=*/ LOCTEXT ( " InputRangeLabel " , " Source Range " ) ,
/*Tooltip=*/ LOCTEXT ( " InputRangeTooltip " , " The range (relative to the reference pose) over which to limit the effect of the input component on the output component " ) ,
/*Category=*/ MappingCategory ,
/*PropertyHandle=*/ NodeHandle ,
/*X=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , RangeMin ) ,
/*Y=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , RangeMax ) ,
MapRangeVisiblity ) ;
AddRangePropertyRow (
/*Name=*/ LOCTEXT ( " MappedRangeLabel " , " Mapped Range " ) ,
/*Tooltip=*/ LOCTEXT ( " MappedRangeTooltip " , " The range of mapped values that correspond to the input range " ) ,
/*Category=*/ MappingCategory ,
/*PropertyHandle=*/ NodeHandle ,
/*X=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , RemappedMin ) ,
/*Y=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , RemappedMax ) ,
MapRangeVisiblity ) ;
MappingCategory . AddProperty ( NodeHandle - > GetChildHandle ( GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , Multiplier ) ) ) . Visibility ( NotUsingCurveVisibility ) ;
2015-06-30 22:25:56 -04:00
// Destination (Driven) category
IDetailCategoryBuilder & TargetCategory = DetailBuilder . EditCategory ( TEXT ( " Destination (Driven) " ) ) ;
TargetCategory . AddProperty ( NodeHandle - > GetChildHandle ( GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , TargetBone ) ) ) ;
2015-07-13 19:53:41 -04:00
// Add a note about the space (it is not configurable, and this helps set expectations)
const FText TargetBoneSpaceName = LOCTEXT ( " TargetComponentSpace " , " Target Component Space " ) ;
TargetCategory . AddCustomRow ( TargetBoneSpaceName )
. NameContent ( )
[
SNew ( STextBlock )
. Text ( TargetBoneSpaceName )
. Font ( IDetailLayoutBuilder : : GetDetailFont ( ) )
]
. ValueContent ( )
[
SNew ( STextBlock )
. Text ( LOCTEXT ( " TargetComponentSpaceIsAlwaysParentBoneSpace " , " Parent Bone Space " ) )
. Font ( IDetailLayoutBuilder : : GetDetailFont ( ) )
] ;
2015-06-30 22:25:56 -04:00
AddTripletPropertyRow (
/*Name=*/ LOCTEXT ( " DrivenTranslationLabel " , " Translation " ) ,
/*Tooltip=*/ LOCTEXT ( " DrivenTranslationTooltip " , " Should the source bone drive one or more translation components of the target bone? " ) ,
/*Category=*/ TargetCategory ,
/*PropertyHandle=*/ NodeHandle ,
/*X=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , bAffectTargetTranslationX ) ,
/*Y=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , bAffectTargetTranslationY ) ,
/*Z=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , bAffectTargetTranslationZ ) ) ;
AddTripletPropertyRow (
/*Name=*/ LOCTEXT ( " DrivenRotationLabel " , " Rotation " ) ,
/*Tooltip=*/ LOCTEXT ( " DrivenRotationTooltip " , " Should the source bone drive one or more rotation components of the target bone? " ) ,
/*Category=*/ TargetCategory ,
/*PropertyHandle=*/ NodeHandle ,
/*X=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , bAffectTargetRotationX ) ,
/*Y=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , bAffectTargetRotationY ) ,
/*Z=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , bAffectTargetRotationZ ) ) ;
AddTripletPropertyRow (
/*Name=*/ LOCTEXT ( " DrivenScaleLabel " , " Scale " ) ,
/*Tooltip=*/ LOCTEXT ( " DrivenScaleTooltip " , " Should the source bone drive one or more scale components of the target bone? " ) ,
/*Category=*/ TargetCategory ,
/*PropertyHandle=*/ NodeHandle ,
/*X=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , bAffectTargetScaleX ) ,
/*Y=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , bAffectTargetScaleY ) ,
/*Z=*/ GET_MEMBER_NAME_CHECKED ( FAnimNode_BoneDrivenController , bAffectTargetScaleZ ) ) ;
}
FText UAnimGraphNode_BoneDrivenController : : ComponentTypeToText ( EComponentType : : Type Component )
{
switch ( Component )
{
case EComponentType : : TranslationX :
return LOCTEXT ( " ComponentType_TranslationX " , " translateX " ) ;
case EComponentType : : TranslationY :
return LOCTEXT ( " ComponentType_TranslationY " , " translateY " ) ;
case EComponentType : : TranslationZ :
return LOCTEXT ( " ComponentType_TranslationZ " , " translateZ " ) ;
case EComponentType : : RotationX :
return LOCTEXT ( " ComponentType_RotationX " , " rotateX " ) ;
case EComponentType : : RotationY :
return LOCTEXT ( " ComponentType_RotationY " , " rotateY " ) ;
case EComponentType : : RotationZ :
return LOCTEXT ( " ComponentType_RotationZ " , " rotateZ " ) ;
case EComponentType : : Scale :
return LOCTEXT ( " ComponentType_ScaleMax " , " scaleMax " ) ;
case EComponentType : : ScaleX :
return LOCTEXT ( " ComponentType_ScaleX " , " scaleX " ) ;
case EComponentType : : ScaleY :
return LOCTEXT ( " ComponentType_ScaleY " , " scaleY " ) ;
case EComponentType : : ScaleZ :
return LOCTEXT ( " ComponentType_ScaleZ " , " scaleZ " ) ;
default :
return LOCTEXT ( " ComponentType_None " , " (none) " ) ;
}
2015-06-17 18:54:05 -04:00
}
EVisibility UAnimGraphNode_BoneDrivenController : : AreNonCurveMappingValuesVisible ( ) const
{
return ( Node . DrivingCurve ! = nullptr ) ? EVisibility : : Collapsed : EVisibility : : Visible ;
}
2015-07-13 19:53:41 -04:00
EVisibility UAnimGraphNode_BoneDrivenController : : AreRemappingValuesVisible ( ) const
{
return ( ( Node . DrivingCurve = = nullptr ) & & Node . bUseRange ) ? EVisibility : : Visible : EVisibility : : Collapsed ;
}
2014-07-08 09:43:39 -04:00
# undef LOCTEXT_NAMESPACE