2016-01-07 08:17:16 -05:00
|
|
|
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
|
2014-07-08 09:43:39 -04:00
|
|
|
|
2015-06-10 10:57:15 -04:00
|
|
|
#include "AnimGraphRuntimePrivatePCH.h"
|
|
|
|
|
#include "BoneControllers/AnimNode_BoneDrivenController.h"
|
|
|
|
|
|
2016-02-24 14:23:53 -05:00
|
|
|
#include "AnimInstanceProxy.h"
|
|
|
|
|
|
2015-06-10 10:57:15 -04:00
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
|
// FAnimNode_BoneDrivenController
|
2014-07-08 09:43:39 -04:00
|
|
|
|
|
|
|
|
FAnimNode_BoneDrivenController::FAnimNode_BoneDrivenController()
|
2015-06-10 10:57:15 -04:00
|
|
|
: SourceComponent(EComponentType::None)
|
|
|
|
|
, Multiplier(1.0f)
|
|
|
|
|
, bUseRange(false)
|
|
|
|
|
, RangeMin(-1.0f)
|
|
|
|
|
, RangeMax(1.0f)
|
2015-07-13 19:53:41 -04:00
|
|
|
, RemappedMin(0.0f)
|
|
|
|
|
, RemappedMax(1.0f)
|
2016-02-24 14:23:53 -05:00
|
|
|
, DestinationMode(EDrivenDestinationMode::Bone)
|
2015-06-30 22:25:56 -04:00
|
|
|
, TargetComponent_DEPRECATED(EComponentType::None)
|
|
|
|
|
, bAffectTargetTranslationX(false)
|
|
|
|
|
, bAffectTargetTranslationY(false)
|
|
|
|
|
, bAffectTargetTranslationZ(false)
|
|
|
|
|
, bAffectTargetRotationX(false)
|
|
|
|
|
, bAffectTargetRotationY(false)
|
|
|
|
|
, bAffectTargetRotationZ(false)
|
|
|
|
|
, bAffectTargetScaleX(false)
|
|
|
|
|
, bAffectTargetScaleY(false)
|
|
|
|
|
, bAffectTargetScaleZ(false)
|
2016-02-24 14:23:53 -05:00
|
|
|
, ModificationMode(EDrivenBoneModificationMode::AddToInput)
|
2014-07-08 09:43:39 -04:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FAnimNode_BoneDrivenController::GatherDebugData(FNodeDebugData& DebugData)
|
|
|
|
|
{
|
|
|
|
|
FString DebugLine = DebugData.GetNodeName(this);
|
|
|
|
|
DebugLine += "(";
|
|
|
|
|
AddDebugNodeData(DebugLine);
|
2016-02-24 14:23:53 -05:00
|
|
|
if (DestinationMode == EDrivenDestinationMode::Bone)
|
|
|
|
|
{
|
|
|
|
|
DebugLine += FString::Printf(TEXT(" DrivingBone: %s\nDrivenBone: %s"), *SourceBone.BoneName.ToString(), *TargetBone.BoneName.ToString());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
DebugLine += FString::Printf(TEXT(" DrivingBone: %s\nDrivenParameter: %s"), *SourceBone.BoneName.ToString(), *ParameterName.ToString());
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-08 09:43:39 -04:00
|
|
|
DebugData.AddDebugItem(DebugLine);
|
|
|
|
|
|
|
|
|
|
ComponentPose.GatherDebugData(DebugData);
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-30 22:25:56 -04:00
|
|
|
void FAnimNode_BoneDrivenController::EvaluateBoneTransforms(USkeletalMeshComponent* SkelComp, FCSPose<FCompactPose>& MeshBases, TArray<FBoneTransform>& OutCSBoneTransforms)
|
2014-07-08 09:43:39 -04:00
|
|
|
{
|
2015-06-30 22:25:56 -04:00
|
|
|
check(OutCSBoneTransforms.Num() == 0);
|
2016-02-24 14:23:53 -05:00
|
|
|
|
2014-07-08 09:43:39 -04:00
|
|
|
// Early out if we're not driving from or to anything
|
2016-02-24 14:23:53 -05:00
|
|
|
if (SourceComponent == EComponentType::None || DestinationMode != EDrivenDestinationMode::Bone)
|
2014-07-08 09:43:39 -04:00
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Get the Local space transform and the ref pose transform to see how the transform for the source bone has changed
|
2015-05-19 06:19:22 -04:00
|
|
|
const FBoneContainer& BoneContainer = MeshBases.GetPose().GetBoneContainer();
|
2016-02-24 14:23:53 -05:00
|
|
|
const FTransform& SourceRefPoseBoneTransform = BoneContainer.GetRefPoseArray()[SourceBone.BoneIndex];
|
|
|
|
|
const FTransform SourceCurrentBoneTransform = MeshBases.GetLocalSpaceTransform(SourceBone.GetCompactPoseIndex(BoneContainer));
|
2014-07-08 09:43:39 -04:00
|
|
|
|
2016-02-24 14:23:53 -05:00
|
|
|
const float FinalDriverValue = ExtractSourceValue(SourceCurrentBoneTransform, SourceRefPoseBoneTransform);
|
|
|
|
|
|
2014-07-08 09:43:39 -04:00
|
|
|
|
2015-06-30 22:25:56 -04:00
|
|
|
// Calculate a new local-space bone position by adding or replacing target components in the current local space position
|
|
|
|
|
const FCompactPoseBoneIndex TargetBoneIndex = TargetBone.GetCompactPoseIndex(BoneContainer);
|
2014-07-08 09:43:39 -04:00
|
|
|
|
2015-06-30 22:25:56 -04:00
|
|
|
const FTransform OriginalLocalTM = MeshBases.GetLocalSpaceTransform(TargetBoneIndex);
|
|
|
|
|
FVector NewTrans(OriginalLocalTM.GetTranslation());
|
|
|
|
|
FVector NewScale(OriginalLocalTM.GetScale3D());
|
|
|
|
|
FQuat NewRot(OriginalLocalTM.GetRotation());
|
|
|
|
|
|
|
|
|
|
if (ModificationMode == EDrivenBoneModificationMode::AddToInput)
|
2014-07-08 09:43:39 -04:00
|
|
|
{
|
2015-06-30 22:25:56 -04:00
|
|
|
// Add the mapped value to the target components
|
|
|
|
|
if (bAffectTargetTranslationX) { NewTrans.X += FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetTranslationY) { NewTrans.Y += FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetTranslationZ) { NewTrans.Z += FinalDriverValue; }
|
|
|
|
|
|
|
|
|
|
if (bAffectTargetRotationX || bAffectTargetRotationY || bAffectTargetRotationZ)
|
|
|
|
|
{
|
|
|
|
|
FVector NewRotDeltaEuler(ForceInitToZero);
|
|
|
|
|
if (bAffectTargetRotationX) { NewRotDeltaEuler.X = FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetRotationY) { NewRotDeltaEuler.Y = FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetRotationZ) { NewRotDeltaEuler.Z = FinalDriverValue; }
|
|
|
|
|
NewRot = NewRot * FQuat::MakeFromEuler(NewRotDeltaEuler);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bAffectTargetScaleX) { NewScale.X += FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetScaleY) { NewScale.Y += FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetScaleZ) { NewScale.Z += FinalDriverValue; }
|
2014-07-08 09:43:39 -04:00
|
|
|
}
|
2015-06-30 22:25:56 -04:00
|
|
|
else if (ModificationMode == EDrivenBoneModificationMode::ReplaceComponent)
|
2014-07-08 09:43:39 -04:00
|
|
|
{
|
2015-06-30 22:25:56 -04:00
|
|
|
// Replace the target components with the mapped value
|
|
|
|
|
if (bAffectTargetTranslationX) { NewTrans.X = FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetTranslationY) { NewTrans.Y = FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetTranslationZ) { NewTrans.Z = FinalDriverValue; }
|
|
|
|
|
|
|
|
|
|
if (bAffectTargetRotationX || bAffectTargetRotationY || bAffectTargetRotationZ)
|
|
|
|
|
{
|
|
|
|
|
FVector NewRotEuler(NewRot.Euler());
|
|
|
|
|
if (bAffectTargetRotationX) { NewRotEuler.X = FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetRotationY) { NewRotEuler.Y = FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetRotationZ) { NewRotEuler.Z = FinalDriverValue; }
|
|
|
|
|
NewRot = FQuat::MakeFromEuler(NewRotEuler);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bAffectTargetScaleX) { NewScale.X = FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetScaleY) { NewScale.Y = FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetScaleZ) { NewScale.Z = FinalDriverValue; }
|
|
|
|
|
}
|
|
|
|
|
else if (ModificationMode == EDrivenBoneModificationMode::AddToRefPose)
|
|
|
|
|
{
|
|
|
|
|
const FTransform RefPoseTransform = MeshBases.GetPose().GetRefPose(TargetBoneIndex);
|
|
|
|
|
|
|
|
|
|
// Add the mapped value to the ref pose components
|
|
|
|
|
if (bAffectTargetTranslationX) { NewTrans.X = RefPoseTransform.GetTranslation().X + FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetTranslationY) { NewTrans.Y = RefPoseTransform.GetTranslation().Y + FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetTranslationZ) { NewTrans.Z = RefPoseTransform.GetTranslation().Z + FinalDriverValue; }
|
|
|
|
|
|
|
|
|
|
if (bAffectTargetRotationX || bAffectTargetRotationY || bAffectTargetRotationZ)
|
|
|
|
|
{
|
|
|
|
|
const FVector RefPoseRotEuler(RefPoseTransform.GetRotation().Euler());
|
|
|
|
|
|
|
|
|
|
// Replace any components that are being driven with their ref pose value first and create a delta rotation as well
|
|
|
|
|
FVector SourceRotationEuler(NewRot.Euler());
|
|
|
|
|
FVector NewRotDeltaEuler(ForceInitToZero);
|
|
|
|
|
if (bAffectTargetRotationX) { SourceRotationEuler.X = RefPoseRotEuler.X; NewRotDeltaEuler.X = FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetRotationY) { SourceRotationEuler.Y = RefPoseRotEuler.Y; NewRotDeltaEuler.Y = FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetRotationZ) { SourceRotationEuler.Z = RefPoseRotEuler.Z; NewRotDeltaEuler.Z = FinalDriverValue; }
|
|
|
|
|
|
|
|
|
|
// Combine the (modified) source and the delta rotation
|
|
|
|
|
NewRot = FQuat::MakeFromEuler(SourceRotationEuler) * FQuat::MakeFromEuler(NewRotDeltaEuler);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bAffectTargetScaleX) { NewScale.X = RefPoseTransform.GetScale3D().X + FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetScaleY) { NewScale.Y = RefPoseTransform.GetScale3D().Y + FinalDriverValue; }
|
|
|
|
|
if (bAffectTargetScaleZ) { NewScale.Z = RefPoseTransform.GetScale3D().Z + FinalDriverValue; }
|
2014-07-08 09:43:39 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-06-30 22:25:56 -04:00
|
|
|
ensureMsgf(false, TEXT("Unknown entry in EDrivenBoneModificationMode"));
|
2014-07-08 09:43:39 -04:00
|
|
|
}
|
|
|
|
|
|
2015-06-30 22:25:56 -04:00
|
|
|
const FTransform ModifiedLocalTM(NewRot, NewTrans, NewScale);
|
2014-07-08 09:43:39 -04:00
|
|
|
|
|
|
|
|
// If we have a parent, concatenate the transform, otherwise just take the new transform
|
2015-06-17 18:54:05 -04:00
|
|
|
const FCompactPoseBoneIndex ParentIndex = MeshBases.GetPose().GetParentBoneIndex(TargetBoneIndex);
|
2015-05-19 06:19:22 -04:00
|
|
|
|
2015-06-17 18:54:05 -04:00
|
|
|
if (ParentIndex != INDEX_NONE)
|
2014-07-08 09:43:39 -04:00
|
|
|
{
|
2015-06-17 18:54:05 -04:00
|
|
|
const FTransform& ParentTM = MeshBases.GetComponentSpaceTransform(ParentIndex);
|
2016-02-24 14:23:53 -05:00
|
|
|
|
2015-06-30 22:25:56 -04:00
|
|
|
OutCSBoneTransforms.Add(FBoneTransform(TargetBoneIndex, ModifiedLocalTM * ParentTM));
|
2014-07-08 09:43:39 -04:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-06-30 22:25:56 -04:00
|
|
|
OutCSBoneTransforms.Add(FBoneTransform(TargetBoneIndex, ModifiedLocalTM));
|
2014-07-08 09:43:39 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-24 14:23:53 -05:00
|
|
|
void FAnimNode_BoneDrivenController::EvaluateComponentSpaceInternal(FComponentSpacePoseContext& Context)
|
|
|
|
|
{
|
|
|
|
|
// Early out if we're not driving from or to anything
|
|
|
|
|
if (SourceComponent == EComponentType::None || DestinationMode == EDrivenDestinationMode::Bone)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Get the Local space transform and the ref pose transform to see how the transform for the source bone has changed
|
|
|
|
|
const FBoneContainer& BoneContainer = Context.Pose.GetPose().GetBoneContainer();
|
|
|
|
|
const FTransform& SourceRefPoseBoneTransform = BoneContainer.GetRefPoseArray()[SourceBone.BoneIndex];
|
|
|
|
|
const FTransform SourceCurrentBoneTransform = Context.Pose.GetLocalSpaceTransform(SourceBone.GetCompactPoseIndex(BoneContainer));
|
|
|
|
|
|
|
|
|
|
const float FinalDriverValue = ExtractSourceValue(SourceCurrentBoneTransform, SourceRefPoseBoneTransform);
|
|
|
|
|
|
|
|
|
|
if (DestinationMode == EDrivenDestinationMode::MorphTarget || DestinationMode == EDrivenDestinationMode::MaterialParameter)
|
|
|
|
|
{
|
|
|
|
|
// Morph target and Material parameter curves
|
|
|
|
|
USkeleton* Skeleton = Context.AnimInstanceProxy->GetSkeleton();
|
2016-06-16 11:54:44 -04:00
|
|
|
FSmartNameMapping::UID NameUID = Skeleton->GetUIDByName(USkeleton::AnimCurveMappingName, ParameterName);
|
|
|
|
|
if (NameUID != FSmartNameMapping::MaxUID)
|
|
|
|
|
{
|
Copying //UE4/Dev-Framework to //UE4/Dev-Main (Source: //UE4/Dev-Framework @ 3038004)
#rb None
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3021479 on 2016/06/21 by Marc.Audy
Fix child actor properties set in the parent's construction script from being wiped out (4.12)
#jira UE-31956
Change 3021703 on 2016/06/21 by Marc.Audy
Fix crash due to copying properties to registered components and then reregistering them. (4.12)
#jira UE-31973
Change 3022105 on 2016/06/21 by Jeremy.Ernst
-new test assets for James for PSD node
Change 3022621 on 2016/06/22 by James.Golding
Add AnimBP for testing PSD
Change 3022622 on 2016/06/22 by James.Golding
Only restrict anim asset selection for UAnimGraphNode_AssetPlayerBase derived nodes
Change 3022656 on 2016/06/22 by James.Golding
UE-30537 Fix solid collision geom drawing not working when mirrored
Change 3022657 on 2016/06/22 by James.Golding
Don't crash in FAnimGraphNodeDetails::OnShouldFilterAnimAsset if AnimAsset doesn't have Skeleton asset registry tag (shouldn't happen, but shouldn't crash)
Change 3022663 on 2016/06/22 by James.Golding
UE-31283 Additional extensibility for anim and physics
PR #2434: Morpheme integration changes (Contributed by NaturalMotionTechnology)
Change 3022683 on 2016/06/22 by James.Golding
- Change OrientationDriver to always use PoseAsset for target poses
- Remove NumPoses from PoseAsset and use GetAssetRegistryTags instead
Change 3022891 on 2016/06/22 by mason.seay
Test asset for component hit
Change 3023203 on 2016/06/22 by mason.seay
Updated map to use more noticeable sound assets
Change 3023335 on 2016/06/22 by Marc.Audy
Use AddReferencedObjects instead of iterating array manuallly
Change 3023351 on 2016/06/22 by Ori.Cohen
Fix the case where physics hit events were passing the wrong component's bone info to the hit event.
#JIRA UE-32376
Change 3023368 on 2016/06/22 by mason.seay
Renamed actors in World Outliner
Change 3023425 on 2016/06/22 by mason.seay
Moved asset to new folder and fixed deprecated node
Change 3023429 on 2016/06/22 by mason.seay
Disabled collision on proc mesh
Change 3023553 on 2016/06/22 by Jon.Nabozny
Fix issue where MaxAngularVelocity resets to default on UPrimitiveComponent->BodyInstance. Replicated from CL 3009477.
#JIRA UE-31670
Change 3024669 on 2016/06/23 by James.Golding
Update PSD test assets (removing unused)
Change 3024864 on 2016/06/23 by Marc.Audy
Audio Threading!
Change 3024877 on 2016/06/23 by James.Golding
PR #2375: Allow the creation of custom IStreamingManager (Contributed by bozaro)
Change 3024880 on 2016/06/23 by James.Golding
PR #2209: Fix UGameplayStatics::*Game*Slot documentation (Contributed by Lectem)
Change 3024939 on 2016/06/23 by James.Golding
- Add SwingOnly options to OrientationDriver
- Move EBoneAxis from AnimNode_RotationMultiplier.h to AnimTypes.h
- Calculate gaussian radius per pose, not globally
Change 3024940 on 2016/06/23 by James.Golding
PoseAsset editor improvements
- Replace pose edit box with inline-editable style (with validation)
- Add filter highlight
- Show curve values for each pose when selected
- Add different background for curve list
- Filter box only searches pose list, moved location to indicate that
Change 3024949 on 2016/06/23 by James.Golding
Small update to PSD test AnimBP
Change 3025002 on 2016/06/23 by Ori.Cohen
Fix the case where fixed frame rate combined with t.maxfps would lead to negative delta time. We now take the min of t.maxfps and fixed frame rate.
#JIRA UE-32219
Change 3025214 on 2016/06/23 by mason.seay
Updated Character Movement Map
Change 3025319 on 2016/06/23 by Ori.Cohen
Make sure changing skeletal mesh updates the bone index on body instances already created.
Change 3025435 on 2016/06/23 by Ori.Cohen
Fix welded bodies not updating their collision profile when calling SetCollisionProfile
#JIRA UE-32394
Change 3025581 on 2016/06/23 by mason.seay
Test asset for slicing procedural mesh
Change 3026483 on 2016/06/24 by Marc.Audy
Don't reschedule multiple times tick functions used as prerequisites
#jira UE-32414
Change 3026498 on 2016/06/24 by mason.seay
Updating blueprint for bug repro
Change 3026547 on 2016/06/24 by Thomas.Sarkanen
Fixed crash in FKismetDebugUtilities::GetWatchText()
Crash reported by this UDN: https://udn.unrealengine.com/questions/300110/crash-in-kismetdebugutilities-when-printing-watchp.html
Change 3026598 on 2016/06/24 by James.Golding
Double clicking on poses now toggles them between 1.0 and 0.0 strength
Change 3026768 on 2016/06/24 by Marc.Audy
Change up suspend audio thread cvar sink warning about disabled threading to avoid inappropriate warnings
#jira UE-32468
Change 3026802 on 2016/06/24 by Lina.Halper
#Pose Asset work
# additive blending change : additive scale is saved to [targetscale/sourcescale - 1] where it used to be [targetscale/sourcescale] since blending doesn't work with it
- Blending should work once we save to [targetscale/sourcescale - 1] as normal - i.e. if you blend 0.3, it should not shrink the mesh because you applyed additive to 0.3
- When apply the scale to base, it should multiply [additive scale + 1 ] where additive scale is [targetscale/sourcescale - 1]
- Changed FTransform::Blend to FTransform::Lerp since it's literally just Lerp. Name Blend should be used for Accumulate but changing the name now is dangerous, so I'm keeping Accumulate but changed Blend to Lerp
# pose asset preview fix
- made sure it adds to curve, so you don't have to use delegate to apply
- PreviewOverride is now added to output curve, so we don't have to apply that curve later
- only reason of anim instance delegate is now for normal anim blueprint.
#pose asset change
- Curve extraction happens with ExtractContext, the output curve is stricly output curve
- Pose Asset supports Shrink now, but only shrink if full pose
- Added PoseHandler to handle most of common stuff between different pose nodes
- Still have to work on how to update pose asset - wip
- todo: clean up single node player to handle pose asset in a function
#code review:Martin.Wilson, James.Golding
Change 3026978 on 2016/06/24 by Lina.Halper
- Delete DrivePose Curve type
- Renamed TriggerEvent to DriveAttribute for consistency
- Replaced drive pose to drive attribute
- right now it can't have 0 curve type flags, so everything is DriveAttribute
#code review: James.Golding, Martin.Wilson
Change 3027113 on 2016/06/24 by mason.seay
Test Pose Assets
Change 3027454 on 2016/06/24 by Aaron.McLeran
UE-32492 Fix for cleaning up xaudio2 source voices and xaudio2 buffers if the source fails to initialize
https://answers.unrealengine.com/questions/441080/audio-crash.html
http://crashreporter/Crashes/Show/5689478
Change 3027519 on 2016/06/24 by Lina.Halper
Reverted FTransform name change as that causes compile errors due to lack of deprecated messages
- not worth to keep the old functions and add new one
#code review: Martin.Wilson
Change 3027887 on 2016/06/25 by Lina.Halper
Fix clang build warning
Change 3028703 on 2016/06/27 by Lukasz.Furman
gameplay debugger config improvements, categories and extensions can now be toggled while PIE/simulate is active
#ue4
Change 3028792 on 2016/06/27 by Lukasz.Furman
compilation fix for gameplay debugger
Change 3028950 on 2016/06/27 by Lukasz.Furman
compilation fix for gameplay debugger
Change 3029003 on 2016/06/27 by Ori.Cohen
Added PhysicalAnimation component that allows us to physically drive skeletal mesh from animation
Change 3029019 on 2016/06/27 by Lina.Halper
Update pose from source asset
Change 3029094 on 2016/06/27 by Marc.Audy
If Player->StartSpot is null disregard ShouldSpawnAtStartPoint returned true.
Change 3029308 on 2016/06/27 by Jeremy.Ernst
-adding test animation for PSD node. Has morphs built in to compare against driver result
Change 3029372 on 2016/06/27 by Marc.Audy
Fix compile error after merge
Also just fix the logic to be explicit rather than using suppression for static analysis warning
Change 3029493 on 2016/06/27 by Ori.Cohen
Move PhysicsAsset.h out of public engine header.
Change 3029550 on 2016/06/27 by Lina.Halper
Fix crash with Nan when additive blending of poses\
Change 3029659 on 2016/06/27 by Aaron.McLeran
Adding new minor feature to add new concurrency mode
- stop by lowest priorty but prevent new rather than stop oldest.
Change 3029673 on 2016/06/27 by Aaron.McLeran
#JIRA FORT-24936 Disable EQ on AMD machines since it is causing them to stall and starve other important threads. This is only a temporary solution until a better one is found.
Implementation in CL 3024124
Change 3030470 on 2016/06/28 by Ori.Cohen
Fix OnConstraintBrokenWrapper being accidently wrapped with if WITH_CLOTHING
#JIRA UE-32561
Change 3030586 on 2016/06/28 by Lina.Halper
Preview curve fix from anim curve viewer
#code review: Martin.Wilson
Change 3031054 on 2016/06/28 by Aaron.McLeran
#jira UE-32566 Incorrectly copied CL 3024124 to Dev-Framework
Change 3031535 on 2016/06/28 by mason.seay
Re-saving concurrency asset
Change 3031691 on 2016/06/28 by Marc.Audy
Fix stat sounds not turning on correctly unless a sort was specified
#jira UE-32597
Change 3031883 on 2016/06/28 by Zak.Middleton
#ue4 - Prevent bNotifyJumpApex from being editable, and clean up comments.
Change 3031898 on 2016/06/28 by Zak.Middleton
#ue4 - Fix mesh smoothing on clients popping briefly when crouching. This was due to the change in 4.12 where we started smoothing Z location rather than always zeroing it (in certain movement modes).
#udn https://udn.unrealengine.com/questions/300494/networked-crouching-jitter.html
Change 3032539 on 2016/06/29 by Marc.Audy
Don't destroy AudioDevices before draining audio commands and stopping audio thread
#jira UE-32611
Change 3032633 on 2016/06/29 by Marc.Audy
In the same way that SpawnActor doesn't work during world teardown, don't allow new components to be added which could introduce recursion within the destroy logic.
#jira UE-32574
Change 3032644 on 2016/06/29 by Lina.Halper
- Fixed issue where pose node evaluator doesn't show up in the menu with asset
- it showed twice of pose node (none) - jira UE-32358
- Fixed issue where anim evaluator/pose asset by name/blend space evaluator failed to display assets properly
- jira UE-32359
- support create pose menu from create asset - UE-32596
- added create pose asset from current pose
- update source should refresh list - UE-32576
- fixed blendspace to be in the blendspaces category
Change 3032847 on 2016/06/29 by Tom.Looman
Added PredictProjectilePath and SuggestProjectileVelocity_MediumArc utilities to UGameplayStatics.
Updated SuggestProjectileVelocity to avoid floating point precision errors on gravity value comparison.
#jira UE-32103
Change 3033124 on 2016/06/29 by Jon.Nabozny
Fix issue where InstancedStaticMeshComponent InstanceBodies don't move when the mesh is updated.
#JIRA: UE-13673
Change 3033155 on 2016/06/29 by Lina.Halper
- montage is playing and montage is pure
- made montage parameter to be mostly const (except play), and made it consistently pointer
Change 3033157 on 2016/06/29 by Lina.Halper
Check in missing file
Change 3033456 on 2016/06/29 by Lukasz.Furman
fixed path following changes broken by merge
#ue4
Change 3033956 on 2016/06/30 by bruce.nesbit
PR #2483: Fix/Improvment Move Component To Rotation (Contributed by Nachtmahr87)
#test PIE
Change 3034019 on 2016/06/30 by Benn.Gallagher
Anim blueprint sub-instances, allowing anim blueprints to run within anim blueprints and expose parameters back to the "parent" instance.
Caveats:
- Slots and state machine names are unique and boxed per instance, meaning playing a montage on a slot will only affect slots in the outermost instance and state machine getters are local to their instance.
#jira UEFW-1
Change 3034085 on 2016/06/30 by Benn.Gallagher
Missed LOCTEXT_NAMESPACE undefs from the subinstance checkin, for some reason doesn't get caught on windows, likely how the unity files are stuck together.
Change 3034162 on 2016/06/30 by Martin.Wilson
Refactor bone reference widget so that selection tree can be used seperately
Change 3034205 on 2016/06/30 by Lina.Halper
#ANIM: fix issue with addiitve blending with non-full weight applying wrong scale
#jira: UE-32643, UE-32593
Change 3034339 on 2016/06/30 by James.Golding
Moving functionality from Skeleton Curves tab into Anim Curve Viewer tab
Change 3034426 on 2016/06/30 by Martin.Wilson
CIS Fix
Change 3034629 on 2016/06/30 by Lina.Halper
Support non-zero curves to be stippred out upon importing
Change 3035863 on 2016/07/01 by Marc.Audy
When pasting components in to a blueprint, make the relative position and rotation of the root 0,0,0
#jira UE-31344
Change 3035916 on 2016/07/01 by Jon.Nabozny
Fixed PaperGroupedSprite doesn't update InstanceBodies data in physics. This change is related to CL-3033124
Change 3035973 on 2016/07/01 by Lukasz.Furman
fixed hash function for FRecastDebugPathfindingNode
#ue4
Change 3036024 on 2016/07/01 by Zak.Middleton
#ue4 - Avoid filling in array in AActor::FixupNativeActorComponents() unless we detect a null scene component. Avoid copying TWeakObjectPtr in ValidateDeferredTransformCache().
Change 3036157 on 2016/07/01 by Marc.Audy
Protect against running commands on game thread when the audio device has already been freed
#jira UE-32611
Change 3036178 on 2016/07/01 by Marc.Audy
Don't bitpack the gamethread specific boolean.
Change 3036906 on 2016/07/04 by bruce.nesbit
Fixed a typo in HasDefaultBuildSettings - (bCompi8leLeanAndMeanUE should be bCompileLeanAndMeanUE)
#tests Compiled
Change 3036929 on 2016/07/04 by James.Golding
UE-32405 Label Rotator components X/Y/Z instead of Roll/Pitch/Yaw
Change 3036930 on 2016/07/04 by James.Golding
UE-30414 Move constraint warnings to Message Log
Change 3036931 on 2016/07/04 by James.Golding
PR #2427: SkeletalMeshMerge now can transform the UVs of the source meshes. (Contributed by Bogustus)
Change 3037123 on 2016/07/04 by Ori.Cohen
Added physical animation preview in PhAT as well as physical animation profiles.
Change 3037420 on 2016/07/05 by Jurre.deBaare
Moved BodySetup_DEPRECATED out of WITH_EDITORONLY_DATA since it's being used in postload (fixes shipping builds)
#jira UE-32771
Change 3037702 on 2016/07/05 by Thomas.Sarkanen
Copying change 3037701 from Release-4.12:
Fixed crash when viewing uncompressed animation
Made sure that objects required by the animation evaluation are set up when performing game-thread side work in the editor.
#jira UE-32715 - Crash when selecting "show" > "uncompressed animation" in Persona
Change 3037837 on 2016/07/05 by Marc.Audy
sound stats will now still be displayed when creating a new audio device
#jira UE-32743
[CL 3038035 by Marc Audy in Main branch]
2016-07-05 14:25:57 -04:00
|
|
|
Context.Curve.Set(NameUID, FinalDriverValue, (DestinationMode == EDrivenDestinationMode::MorphTarget) ? EAnimCurveFlags::ACF_DriveMorphTarget : EAnimCurveFlags::ACF_DriveMaterial);
|
2016-06-16 11:54:44 -04:00
|
|
|
}
|
2016-02-24 14:23:53 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const float FAnimNode_BoneDrivenController::ExtractSourceValue(const FTransform &InCurrentBoneTransform, const FTransform &InRefPoseBoneTransform)
|
|
|
|
|
{
|
|
|
|
|
// Resolve source value
|
|
|
|
|
float SourceValue = 0.0f;
|
|
|
|
|
if (SourceComponent < EComponentType::RotationX)
|
|
|
|
|
{
|
|
|
|
|
const FVector TranslationDiff = InCurrentBoneTransform.GetLocation() - InRefPoseBoneTransform.GetLocation();
|
|
|
|
|
SourceValue = TranslationDiff[(int32)(SourceComponent - EComponentType::TranslationX)];
|
|
|
|
|
}
|
|
|
|
|
else if (SourceComponent < EComponentType::Scale)
|
|
|
|
|
{
|
|
|
|
|
const FVector RotationDiff = (InCurrentBoneTransform.GetRotation() * InRefPoseBoneTransform.GetRotation().Inverse()).Euler();
|
|
|
|
|
SourceValue = RotationDiff[(int32)(SourceComponent - EComponentType::RotationX)];
|
|
|
|
|
}
|
|
|
|
|
else if (SourceComponent == EComponentType::Scale)
|
|
|
|
|
{
|
|
|
|
|
const FVector CurrentScale = InCurrentBoneTransform.GetScale3D();
|
|
|
|
|
const FVector RefScale = InRefPoseBoneTransform.GetScale3D();
|
|
|
|
|
const float ScaleDiff = FMath::Max3(CurrentScale[0], CurrentScale[1], CurrentScale[2]) - FMath::Max3(RefScale[0], RefScale[1], RefScale[2]);
|
|
|
|
|
SourceValue = ScaleDiff;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const FVector ScaleDiff = InCurrentBoneTransform.GetScale3D() - InRefPoseBoneTransform.GetScale3D();
|
|
|
|
|
SourceValue = ScaleDiff[(int32)(SourceComponent - EComponentType::ScaleX)];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Determine the resulting value
|
|
|
|
|
float FinalDriverValue = SourceValue;
|
|
|
|
|
if (DrivingCurve != nullptr)
|
|
|
|
|
{
|
|
|
|
|
// Remap thru the curve if set
|
|
|
|
|
FinalDriverValue = DrivingCurve->GetFloatValue(FinalDriverValue);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Apply the fixed function remapping/clamping
|
|
|
|
|
if (bUseRange)
|
|
|
|
|
{
|
Copying //UE4/Dev-Framework to //UE4/Dev-Main (Source: //UE4/Dev-Framework @ 2964666)
#lockdown Nick.Penwarden
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2945310 on 2016/04/15 by Jon.Nabozny
Fix UI locking Angular Rotation Offset for PhysicsConstraintComponents when the motion is for axes is Free or Locked.
#JIRA UE-29368
Change 2945490 on 2016/04/15 by Jon.Nabozny
Remove extraneous changes introduced in CL-2945310.
Change 2946706 on 2016/04/18 by James.Golding
Checkin of slice test assets
Change 2947895 on 2016/04/19 by Benn.Gallagher
PR #2292: Use ref instead of copy in FAnimNode_ModifyBone::EvaluateBoneTransforms (Contributed by MiKom)
#jira UE-29567
Change 2947944 on 2016/04/19 by Benn.Gallagher
Fixed a few extra needless bone container copies
Change 2948279 on 2016/04/19 by Marc.Audy
Add well defined Map and Set Property names
Change 2948280 on 2016/04/19 by Marc.Audy
Properly name parameters
Change 2948792 on 2016/04/19 by Marc.Audy
Remove unused ini class name settings
Change 2948917 on 2016/04/19 by Aaron.McLeran
UE-29654 FadeIn invalidates Audio Components in 4.11
Change 2949567 on 2016/04/20 by James.Golding
- Add SliceProceduralMesh utility to UKismetProceduralMeshLibrary. It will slice the ProcMeshComp with a plan, including simple collision geom, and optionally create cap geometry, and create an addition ProceduralMeshComponent for the other half
- Add support for simple collision on ProceduralMeshComponent, and added bUseComplexAsSimpleCollision to allow it to be used
- Move GeomTools.h and .cpp from Editor to Engine module, so it can be used at runtime. Also move utils into an FGeomTools namespace.
- Add GetSectionFromStaticMesh and CopyProceduralMeshFromStaticMeshComponent utilities to UKismetProceduralMeshLibrary
- Expose UStaticMesh::GetNumLODs to BP, and add BP exposed UStaticMesh:: GetNumSections function
Change 2950482 on 2016/04/20 by Aaron.McLeran
FORT-22973 SoundMix Fade Time not fading audio properly
- Bug was due to bApplyToChildren case where the FSoundClassAdjuster wasn't getting the interpolated value before calling RecursiveApplyAdjuster in the case of non-overriden sound mixes.
Change 2951102 on 2016/04/21 by Thomas.Sarkanen
Un-deprecated blueprint functions for attachment/detachment
Renamed functions to <FuncName> (Deprecated).
Hid functions in the BP context menu so new ones cant be added.
#jira UE-23216 - "Snap to Target, Keep World Scale" when attaching doesn't work properly if parent is scaled.
Change 2951173 on 2016/04/21 by James.Golding
Fix cap geom generation when more than one polygon is generated
Fix CIS warning in KismetProceduralMeshLibrary.cpp
Change 2951334 on 2016/04/21 by Osman.Tsjardiwal
Add CapMaterial param to SliceProceduralMesh util
Change 2951528 on 2016/04/21 by Marc.Audy
Fix spelling errors in comments
Change 2952933 on 2016/04/22 by Lukasz.Furman
fixed behavior tree getting stuck on instantly finished gameplay tasks
copy of CL# 2952930
Change 2953948 on 2016/04/24 by James.Golding
Put #if WITH_EDITOR back into FPoly::Triangulate to fix non-editor builds (FPoly::Finalize not available in non-editor)
Change 2954558 on 2016/04/25 by Marc.Audy
Make USceneComponent::Attach* members private and remove deprecation messages and pragmas disabling/enabling deprecation throughout SceneComponent.h/cpp
#jira UE-29038
Change 2954865 on 2016/04/25 by Aaron.McLeran
UE-29763 Use HMD audio device only in VR preview mode, not for other PIE session types.
Change 2955009 on 2016/04/25 by Zak.Middleton
#ue4 - Wrap call from UCharacterMovementComponent::PostPhysicsTickComponent() to UpdateBasedMovement() in a FScopedMovementUpdate to accumulate moves with better perf.
Change 2955878 on 2016/04/26 by Benn.Gallagher
[Epic Friday] - Added spherical constraints to anim dynamics
Change 2956380 on 2016/04/26 by Lina.Halper
PR #2298: Step interpolation for UAnimSequence (Contributed by douglaslassance)
Change 2956383 on 2016/04/26 by Lina.Halper
Fixed to match coding standard
Change 2957866 on 2016/04/27 by Zak.Middleton
#ue4 - Add max depenetration distance settings for CharacterMovementComponent. Add controls to throttle logging when character is stuck in geometry so it doesn't spam the log.
- Depenetration settings are separated based on whether overlapping a Pawn versus other geometry, and furthermore by whether the Character is a proxy or not. Simulated proxies typically should not depenetrate a large amount because that effectively ignores the server authoritative location update.
- "Stuck" logging is controlled by the console var "p.CharacterStuckWarningPeriod". Set to number of seconds between logged events, or less than zero to disable logging.
#tests QA-Surfaces multiplayer, walking in to moving objects and pawns.
Change 2957953 on 2016/04/27 by Aaron.McLeran
UE-30018 Fixing up audio component ref-counting to prevent triggering notifications when an audio component is still active after a sound finishes playing.
Change 2958011 on 2016/04/27 by Jon.Nabozny
CalcAABB wasn't properly accounting for current transform on Convex elements, causing bad results.
#JIRA UE-29525
Change 2958321 on 2016/04/27 by Lukasz.Furman
path following update pass, added flags to request result, fixed AITask stacking vs scripted/BP move requests
Change 2959506 on 2016/04/28 by Aaron.McLeran
PR #2330: Fix for ambient sounds not stopping when active and told to play again (Contributed by hgamiel)
Change 2959686 on 2016/04/28 by Marc.Audy
Correctly handle multiple viewpoints when significance is being sorted descending
Change 2959773 on 2016/04/28 by Marc.Audy
Fix shadowing warning
Change 2959785 on 2016/04/28 by Aaron.McLeran
UE-30083 Sound concatenator node doesn't progress if child nodes don't produce wave instances
Change 2960852 on 2016/04/29 by Marc.Audy
Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 2960738
Change 2960946 on 2016/04/29 by Marc.Audy
Fix post merge compile error
Change 2962501 on 2016/05/02 by Marc.Audy
Remove interim GetMutableAttach accessors and use the variables directly now that they are private
Change 2962535 on 2016/05/02 by Marc.Audy
Merging //UE4/Dev-Main to Dev-Framework (//UE4/Dev-Framework) @ 2962478
Change 2962578 on 2016/05/02 by Marc.Audy
Switch ObjectGraphMove to using UserFlags instead of custom move data
Change 2962651 on 2016/05/02 by Marc.Audy
VS2015 shadow variable fixes
Change 2962662 on 2016/05/02 by Lukasz.Furman
deprecated old implementation of gameplay debugger
#jira UE-30011
Change 2962919 on 2016/05/02 by Marc.Audy
VS2015 shadow variable fixes
Change 2963475 on 2016/05/02 by Mieszko.Zielinski
Made SimpleMoveToLocation/Actor not reset velocity if agent not already at goal #UE4
#jira UE-30176
Change 2964098 on 2016/05/03 by Marc.Audy
Spelling fix
Change 2964099 on 2016/05/03 by Marc.Audy
VS2015 shadow variable fixes
Change 2964156 on 2016/05/03 by Marc.Audy
VS2015 shadow variable fixes
Change 2964272 on 2016/05/03 by Marc.Audy
VS2015 Shadow Variable fixes
Change 2964395 on 2016/05/03 by Marc.Audy
VS2015 Shadow Variable Fixes
Change 2964460 on 2016/05/03 by Marc.Audy
Reschedule coolingdown tick functions during pause frames.
#jira UE-30221
Change 2964666 on 2016/05/03 by Marc.Audy
Fix shipping compile error
[CL 2964775 by Marc Audy in Main branch]
2016-05-03 15:44:33 -04:00
|
|
|
const float ClampedAlpha = FMath::Clamp(FMath::GetRangePct(RangeMin, RangeMax, FinalDriverValue), 0.0f, 1.0f);
|
|
|
|
|
FinalDriverValue = FMath::Lerp(RemappedMin, RemappedMax, ClampedAlpha);
|
2016-02-24 14:23:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FinalDriverValue *= Multiplier;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FinalDriverValue;
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-01 14:45:04 -04:00
|
|
|
bool FAnimNode_BoneDrivenController::IsValidToEvaluate(const USkeleton* Skeleton, const FBoneContainer& RequiredBones)
|
2014-07-08 09:43:39 -04:00
|
|
|
{
|
2016-02-24 14:23:53 -05:00
|
|
|
return SourceBone.IsValid(RequiredBones) && ( TargetBone.IsValid(RequiredBones) || DestinationMode != EDrivenDestinationMode::Bone );
|
2014-07-08 09:43:39 -04:00
|
|
|
}
|
|
|
|
|
|
2015-06-30 22:25:56 -04:00
|
|
|
void FAnimNode_BoneDrivenController::ConvertTargetComponentToBits()
|
|
|
|
|
{
|
|
|
|
|
switch (TargetComponent_DEPRECATED)
|
|
|
|
|
{
|
|
|
|
|
case EComponentType::TranslationX:
|
|
|
|
|
bAffectTargetTranslationX = true;
|
|
|
|
|
break;
|
|
|
|
|
case EComponentType::TranslationY:
|
|
|
|
|
bAffectTargetTranslationY = true;
|
|
|
|
|
break;
|
|
|
|
|
case EComponentType::TranslationZ:
|
|
|
|
|
bAffectTargetTranslationZ = true;
|
|
|
|
|
break;
|
|
|
|
|
case EComponentType::RotationX:
|
|
|
|
|
bAffectTargetRotationX = true;
|
|
|
|
|
break;
|
|
|
|
|
case EComponentType::RotationY:
|
|
|
|
|
bAffectTargetRotationY = true;
|
|
|
|
|
break;
|
|
|
|
|
case EComponentType::RotationZ:
|
|
|
|
|
bAffectTargetRotationZ = true;
|
|
|
|
|
break;
|
|
|
|
|
case EComponentType::Scale:
|
|
|
|
|
bAffectTargetScaleX = true;
|
|
|
|
|
bAffectTargetScaleY = true;
|
|
|
|
|
bAffectTargetScaleZ = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-01 14:45:04 -04:00
|
|
|
void FAnimNode_BoneDrivenController::InitializeBoneReferences(const FBoneContainer& RequiredBones)
|
2014-07-08 09:43:39 -04:00
|
|
|
{
|
|
|
|
|
SourceBone.Initialize(RequiredBones);
|
|
|
|
|
TargetBone.Initialize(RequiredBones);
|
|
|
|
|
}
|