48 Commits

Author SHA1 Message Date
daren cheng
0d41d8058c [Backout] - CL36699932
Causes issues in motion matching samples with parameters not updating correctly. Possibly due to blend stack graphs with same name.

[FYI] Thomas.Sarkanen
Original CL Desc
-----------------------------------------------------------------
Fixed compilation non-determinism in animation blueprints

Name-generation code in UAnimGraphNode_Base::GetDescriptiveCompiledName is taking the hash of a node's GUID, expecting it to be stable, but the calling code was passing the duplicated node, not the original, so the GUID varied each time. This fix passes the 'source' node instead for stability. Any additional duplicates are then handled as before by the NetNameMap incrementing the name's number.

#jira UE-226025
#rb Nicholas.Frechette, samuele.rigamonti
#rnx
#tests PIE, Anim BP Compile

[CL 36766127 by daren cheng in 5.5 branch]
2024-10-01 21:03:10 -04:00
thomas sarkanen
109064b52e Fixed compilation non-determinism in animation blueprints
Name-generation code in UAnimGraphNode_Base::GetDescriptiveCompiledName is taking the hash of a node's GUID, expecting it to be stable, but the calling code was passing the duplicated node, not the original, so the GUID varied each time. This fix passes the 'source' node instead for stability. Any additional duplicates are then handled as before by the NetNameMap incrementing the name's number.

#jira UE-226025
#rb Jurre.deBaare
#rnx

[CL 36764471 by thomas sarkanen in 5.5 branch]
2024-10-01 20:42:36 -04:00
jaime cifuentes
85aef43130 Fix for animation blueprints incorrectly showing animation graphs using animation layers default shared group in my blueprint.
#rb Thomas.Sarkanen
#jira UE-222911

[CL 36329986 by jaime cifuentes in 5.5 branch]
2024-09-17 06:21:40 -04:00
thomas sarkanen
57122faf0a AnimNext params in Anim BPs
Added a new anim node: AnimNext Parameters. This injects parameters into the AnimNext stack for all leafwards nodes.

Added a new way of binding to parameters on anim nodes.
- Added indirection to UAnimGraphNode_Base to allow different 'binding types' to be authored by deriving from UAnimGraphNodeBinding
- Added new binding type for AnimNext parameters
- Moved existing binding code (inc UI widget creation) into UAnimGraphNodeBinding_Base
- Binding types can be selected on a per-node or per-anim BP basis

Reworked FParamStack API a little
- Allow for better error checking when pushing/popping stack layers. Pushed layers can now only be subsequently popped by passing in the handle of the pushed layer.
- Standalone layers are now wrapped in an opaque handle rather than returning a unique ptr
- GetParamData APIs now perform more involved type checking, allowing derived object types & type conversions to be implemented

Improved parameter type sandboxing for automated tests. If running low-level type tests while execution was happening on another thread, the editor could crash because of invalidating already-existing types.

Lots of other small fixes to get workflows nicer and end-to-end functionality working

#rb Nicholas.Frechette,Jaime.Cifuentes,Jurre.deBaare

[CL 26455905 by thomas sarkanen in ue5-main branch]
2023-07-19 04:36:34 -04:00
kirill zorin
a469aafd78 Update callsites to prepare for upcoming TArray/TArrayView<TObjectPtr<...>> restrictions
#rb zousar.shaker
#rb devin.doucette
#rb steve.robb
#rb robert.manuszewski
#rb saam.barati
#preflight 643f4c09a35280ed4f53ccb3

[CL 25100071 by kirill zorin in ue5-main branch]
2023-04-18 22:39:29 -04:00
thomas sarkanen
caad3403d5 Fix sparse class data crash in the presence of circular dependencies
This ensures that 'old' sparse class data (that may be regenerated by a compilation) is always stashed when beginning a compilation pass. This is needed because when sparse class data is cleared, all (loaded) child classes are also cleared, so when they also come to be compiled, their sparse class data will already be null and there will be a dangling reference to it in the package's export table (despite it being moved into the transient package). The dangling reference will then cause any subsequent loads (e.g. further children) to reference an invalid structure.

#jira UE-171639
#rb Jurre.daBaare
#preflight 63906af667018b14b5fe96be

[CL 23431859 by thomas sarkanen in ue5-main branch]
2022-12-07 13:44:19 -05:00
benjamin jillich
bbeed383e4 [UE-168454] Some Watch Pins Show Incorrect Values in the Player AnimBP
The source of the issue was that the key of the mapping between the original and the folded property was not able to distinguish between the instance of the node. This means that e.g. when we had several blend nodes in the graph, only one of the properties was in the map and thus all pin watches were watching the single folded property that the map contains.

This is now solved by using a graph pin as key for the map, which is unique per node instance.

An additional issue was that nodes like get variable were not compiled by the blueprint compiler and thus their pins were not part of the map as well. This got fixed by adding linked pins to the map as well.

The fix got verified in game as well. Please make sure to reload/recompile the "avg_player" and "sourcepose" anim bp before verifying.

#jira https://jira.it.epicgames.com/browse/UE-168454
#preflight 637e36baf514e1ded9722abe

[CL 23249548 by benjamin jillich in ue5-main branch]
2022-11-23 10:21:39 -05:00
ben woodhouse
e507b6a39b Fix PIE crash - more fallout from this->IsChildOf() check where this == nullptr.
[FYI] thomas.sarkanen

#ROBOMERGE-AUTHOR: ben.woodhouse
#ROBOMERGE-SOURCE: CL 20973133 via CL 20974483 via CL 20978365
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 20980957 by ben woodhouse in ue5-main branch]
2022-07-07 01:59:26 -04:00
thomas sarkanen
8d1de28971 Fix crash in cooked builds where references to editor-only properties were left in anim BP bytecode
This was inadvertenly caused by CL 19250839 that renamed some generated properties to that of the same name as an anim node property (BlendSpace - they used to be called ObjectProperty). Then the code that expanded anim nodes to link up BP logic left a 'set struct member to null' behind because the generated member name matched the pin on the anim graph node.
This fix switches generated members to have a "__" prefix to avoid collisions with user properties, as well as fixing the code on expansion to check the correct property name, which will cause the 'set struct member to null' node to not be left in the exec path.


#ROBOMERGE-AUTHOR: thomas.sarkanen
#ROBOMERGE-SOURCE: CL 19568495 via CL 19568548 via CL 19568614 via CL 19568625 via CL 19568631
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19568916 by thomas sarkanen in ue5-main branch]
2022-03-30 23:02:36 -04:00
thomas sarkanen
e1151831f9 Fixed tagged-property-serialization causing warnings with generated sparse class data structs in animation blueprints
This changes the generated property names for object properties to ensure that object properties of differing class types dont collide. This avoids the warning in FObjectPropertyBase::CheckValidObject (Serialized Class X for a property of Class Y. Reference will be nullptred.).

#jira UE-144970
#jira FORT-455566
#preflight 62262d20b97fb949cf4bea13
#rb Jurre.deBaare
#lockdown simon.tourangeau

#p4v-cherrypick 19251391

#ROBOMERGE-AUTHOR: thomas.sarkanen
#ROBOMERGE-SOURCE: CL 19285792 in //UE5/Release-5.0/... via CL 19286676
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v924-19243027)

[CL 19291659 by thomas sarkanen in ue5-main branch]
2022-03-07 15:54:51 -05:00
jamie dale
cfdad64946 Added context to PostCDOCompiled and also call it for skeleton-only compiles
#jira
#preflight 6210112553204823ae8bcf4f
#rb Michael.Noland

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 19058032 via CL 19058041 via CL 19058078 via CL 19058094 via CL 19059619
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v918-19018356)

[CL 19066317 by jamie dale in ue5-main branch]
2022-02-21 02:04:58 -05:00
thomas sarkanen
ff1e91c927 Fix issues with child anim BP compilation ordering & sparse class data fixup
This partially ports a fix from CL 18740288, but improves on when and how sparse class data gets fixed up.
This allows this fix to cover more parent->child load/compile orderings (the previous fix only worked if they were all compiled in the same batch, which isnt always guaranteed.

Original CL desc:

Ensures that cleaned-up sparse class data structs are moved out of the package they are in, thus not requiring a GC step to ensure that batch compilation works correctly.
Without this, it is possible for the NewObject call in FAnimBlueprintCompilerContext::RecreateSparseClassData to attempt to re-use (as it has a fixed name) the currently-existing (but not referenced) object rather than creating a new one.
This also reverts some other changes that were made to try to address related issues.

#jira FORT-444463
#jira UE-140565
#jira UE-140530
#lockdown laurent.delayen
#rb jurre.debaare
#preflight 61fbddc53b22793ca35ebfc0

#ROBOMERGE-AUTHOR: thomas.sarkanen
#ROBOMERGE-SOURCE: CL 18843087 in //UE5/Release-5.0/... via CL 18843109 via CL 18843285
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18843294 by thomas sarkanen in ue5-main branch]
2022-02-03 10:36:00 -05:00
jurre debaare
92fa622bf6 Variable watch within state machines is broken
- Ensure that any folded AnimNode property gets remapped correctly for pin-to-property map in FBlueprintDebugData
- Ensure  pin value watching for folded properties retrieves the correct value
- Const-ifying some code paths around blueprint pin watching
#jira UE-139995
#preflight 61fa624ddb42673a60239ce1
#rb Thomas.Sarkanen
#lockdown Cristina.Riveron

#ROBOMERGE-AUTHOR: jurre.debaare
#ROBOMERGE-SOURCE: CL 18824229 in //UE5/Release-5.0/... via CL 18825883 via CL 18826298
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18826349 by jurre debaare in ue5-main branch]
2022-02-02 09:54:14 -05:00
dave jones2
c8574d3b74 Merging //UE5/Dev-LargeWorldCoordinates [at] 18802167 to //UE5/Release-5.0
Blueprint real number support.

This change deprecates the use the of "float" and "double" types in Blueprints in favor of a new "real". By default, "real" is back by a double precision floating point number. However, it can be single precision if the number is a native float property or function parameter. This distinction won't be visible to the Blueprint user: in both instances, they'll be represented by "real" pin types. During deserialization, we'll automatically convert Blueprint pin types to use real/doubles, unless they're used to represent native code (including delegate signatures).

One consequence of this change is that we need to perform implicit casts between single and double precision real numbers. During Blueprint compilation, the compiler will detect points in the graph for when either a widening or narrowing conversion needs to occur. Subsequently, the script bytecode will contain a new cast instruction that performs the conversion. This also works on container types, but each entry in the container will have to be converted. This can introduce unwanted overhead for large containers that are frequently passed between Blueprint and native code.

The scope of this change affects Blueprints used by Gameplay, Animation, Control Rig, and UMG.

#rb marc.audy (serialization changes)
#jira UE-116484
#preflight 61f8bdd5a2514ba12ff7bdfc

#ROBOMERGE-AUTHOR: dave.jones2
#ROBOMERGE-SOURCE: CL 18809077 in //UE5/Release-5.0/... via CL 18809455 via CL 18822548
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18823569 by dave jones2 in ue5-main branch]
2022-02-02 05:50:50 -05:00
jose villarroel
9746cc9977 [Backout] - CL18751910
[FYI] Thomas.Sarkanen
Original CL Desc
-----------------------------------------------------------------
Fix asserts/warnings around child anim BPs

Ensures that cleaned-up sparse class data structs are moved out of the package they are in, thus not requiring a GC step to ensure that batch compilation works correctly.
Without this, it is possible for the NewObject call in FAnimBlueprintCompilerContext::RecreateSparseClassData to attempt to re-use (as it has a fixed name) the currently-existing (but not referenced) object rather than creating a new one.
This also reverts some other changes that were made to try to address related issues.

#jira FORT-444463
#rb Phillip.Kavan
#preflight 61f18be3f8088a3d298e6419
#p4v-cherrypick 18740288

#ROBOMERGE-AUTHOR: jose.villarroel
#ROBOMERGE-SOURCE: CL 18773105 in //UE5/Release-5.0/... via CL 18773189 via CL 18773693
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18773704 by jose villarroel in ue5-main branch]
2022-01-28 12:39:05 -05:00
thomas sarkanen
8f861ede89 Fix asserts/warnings around child anim BPs
Ensures that cleaned-up sparse class data structs are moved out of the package they are in, thus not requiring a GC step to ensure that batch compilation works correctly.
Without this, it is possible for the NewObject call in FAnimBlueprintCompilerContext::RecreateSparseClassData to attempt to re-use (as it has a fixed name) the currently-existing (but not referenced) object rather than creating a new one.
This also reverts some other changes that were made to try to address related issues.

#rb Phillip.Kavan
#preflight 61f18be3f8088a3d298e6419

#ROBOMERGE-AUTHOR: thomas.sarkanen
#ROBOMERGE-SOURCE: CL 18740288 via CL 18740350 via CL 18740373 via CL 18742029 via CL 18742887
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18743237 by thomas sarkanen in ue5-main branch]
2022-01-26 15:37:52 -05:00
bob tellez
db60633312 #UE Fix for crash overwriting NewAnimBlueprintConstants object during load
#ROBOMERGE-AUTHOR: bob.tellez
#ROBOMERGE-SOURCE: CL 18720630 via CL 18720632 via CL 18720638 via CL 18720809 via CL 18720870
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18720871 by bob tellez in ue5-main branch]
2022-01-25 04:38:05 -05:00
bob tellez
f3eba66899 #UE4 Add more info to an assert
#ROBOMERGE-AUTHOR: bob.tellez
#ROBOMERGE-SOURCE: CL 18476381 via CL 18477404 via CL 18477469 via CL 18477893 via CL 18481497
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18481767 by bob tellez in ue5-release-engine-test branch]
2021-12-16 19:52:49 -05:00
thomas sarkanen
fff3c9141f Added anim node data flags to reduce overhead introduced by anim node functions
Now we dont have to fetch the data out of folded constants to determine that it is invalid

#jira UE-130378 - Optimization pass on new UE5 anim node features
#rb Martin.Wilson
#preflight 61b758e3fc57089133808370

#ROBOMERGE-AUTHOR: thomas.sarkanen
#ROBOMERGE-SOURCE: CL 18443507 in //UE5/Release-5.0/... via CL 18445092
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18445251 by thomas sarkanen in ue5-release-engine-test branch]
2021-12-13 13:34:59 -05:00
thomas sarkanen
45b9547da9 Anim blueprints now dont participate in unneeded dependency compilation
This is because dependent BPs at least need a re-link to pick up layout changes in their property access 'bytecode'.

The also requires some re-arranging of where sparse class data gets created, linked and patched.
 - Previously sparse class data was patched in the linker at the point of re-creation, but this meant that stale TRASHCLASS sparse class data was could still be in the struct hierarchy when we are BATCH compiling (when batch compiling, each compilation phase is performed in turn for all compiling/dependent BPs). This change removes the sparse class data when the class is sanitized prior to full compilation and stashes it for later patching. This ensures that sparse class data doesnt get linked into stale structs that can then get GCed later, invalidating property links.
- Sparse class data is now linked when its containing ABPGC is linked. It also ensures that the hierarchy of sparse class data mirrors that of the ABPGC. The 'mirror hierarchy' is currently only an invariant of anim blueprints.

Part of this change alters the behavior of UClass::SetSparseClassDataStruct when passed a NULL value. This will now ensure that subclasses are left in a valid state when this occurs. Previously if sparse class data was nulled-out, subclasses would be left pointing at a potentially stale struct in the case where the struct was being regenerated.

Added an override point for subsystems to participate in Link() and made sure property access offsets are patched there, to catch cases where dependent BPs get either a bytecode-only or link-only compile

#jira UE-136035 - Unexpected results from Property Access after changing Lyra animbp
#jira UE-130965 - Multiple crashes involving anim BP sparse class data, inheritance & GC
#rb Phillip.Kavan,Matt.Peters
#preflight 61af321f470c73a8c4933ff5

#ROBOMERGE-AUTHOR: thomas.sarkanen
#ROBOMERGE-SOURCE: CL 18393342 in //UE5/Release-5.0/... via CL 18393349
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469)

[CL 18393353 by thomas sarkanen in ue5-release-engine-test branch]
2021-12-07 05:32:13 -05:00
thomas sarkanen
d9d8fc91ed Fix crash compiling child anim BPs with certain configurations
Copy mutable data (in the same way as constant data) to ensure that child class containers are coorectly initialized

#jira UE-135480 - Crash compiling child anim BP with invalid mutable data
#rb Jurre.deBaare
#preflight 619cbaaa801b361978a544d8

#ROBOMERGE-AUTHOR: thomas.sarkanen
#ROBOMERGE-SOURCE: CL 18268116 in //UE5/Release-5.0/... via CL 18268125
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18268128 by thomas sarkanen in ue5-release-engine-test branch]
2021-11-23 05:26:00 -05:00
aurel cordonnier
fc542f6cfd Merge from Release-Engine-Staging @ 18081189 to Release-Engine-Test
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971

[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
2021-11-07 23:43:01 -05:00
aurel cordonnier
a6e741e007 Merge from Release-Engine-Staging @ 17915896 to Release-Engine-Test
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035

[CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-25 20:05:28 -04:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
thomas sarkanen
d708b24c66 Anim node references
Added the abiity to tag and retrieve any anim graph node (similar to how we could reference linked anim graph nodes previously).
Ported linked anim graph nodes to use the new system
Added the ability to reference any anim graph node by tag (via a new custom node, spawnable from the context menu, with the appearance of an actor reference in a level blueprint)
Added tag display and editing in the bottom-right of anim graph nodes
Added new override point to SGraphNodeK2Var to allow for title widget parameters to be overriden by child classes

#jira UE-126286 - Anim node functions: Add anim node references
#rb Jurre.deBaare

#ROBOMERGE-AUTHOR: thomas.sarkanen
#ROBOMERGE-SOURCE: CL 17472894 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)

[CL 17472913 by thomas sarkanen in ue5-release-engine-test branch]
2021-09-09 11:42:21 -04:00