This is currently not possible because much of the logic in a given AnimBP is using data linked to a specific (I.E. nodes referencing bones, any kind of IK logic, etc). AnimTrees from UE3 are similar to State Machines, but State Machines are only one component of the larger system that is an Animation Blueprint.
We find that, through iteration, characters with different bone structures that warrant a new tend to have such different animation logic needs (in both the event and animgraph) that it isnât worth having a Child AnimBP system that spans different skeletons. Due to the significant overhaul this would require and major problems that will most definitely arise from a system like this, it is recommended that different skeletons get their own unique animation blueprints. Hell, we often end up making different AnimBPs for characters using the same because they have different needs logic needs.
Seriously though, Iâm glad youâre questioning this. We like to hear this kind of feedback. Itâs something Iâve considered in the past, but as you continue to iterate on your characters past the most basic AnimBP logic youâll find that this is not practical.
@.Williams, I donât actually think it requires any overhaul of the system, or much of an update at all, because I am currently using multiple skeletons on a single Animgraph. I replied with my âhackâ to force animgraphs to use multiple skeletons above by duplicating assets and replacing them on delete with assets of new skeletons. This would be one of my highest requested features so I can stop doing this. To have the same logic to exist across animgraphs is a nightmare for development. And retargetting doesnât even make sense on our project because each character moves so differently, but not enough for their behavior to be scripted differently.
I am now sad this has been resolved.
Really, the main problem that Iâm seeing is that animation overrides only show assets from the of the original Animgraph (even if the child uses a different ). If you could just show any animation asset regardless of this would be amazing.
thatâs not true!
a pig , a dragon, a man, can have different , but each one have stand, run, attack, defend animations.
in animblueprint, they all have same logic: when to run and when to attack!
Hildogenâs pin solution also nudged me in the right direction. We did not want to use retargeting to create duplicate assets for different skeletons that shared the same rig and bone signatures. Our tree logic is quite complex, and in constant iteration so duplicating that logic for multiple skeletons that use the same pattern seemed like an unacceptable workflow risk.
We now have a single AnimBP for multiple pawns using different skeletons. Theoretically, the solution we use might even support different skeletons with completely different bone structures, such as Humans and Puppies.
As erebel55 pointed out, that AnimBP can still only be associated with the same unless you make an engine mod to"USkeletalMeshComponent::NeedToSpawnAnimScriptInstance()". Commenting out the âIsCompatibleMesh()â checks to allow that function to return true for incompatible meshes will let you to make your Puppy pawn/ use the AnimBP created for the Human pawn/.
After that, make sure your AnimBP is your own C++ class that inherits from UAnimInstance, so that you can create your own UPROPERTY(EditDefaultsOnly, BlueprintReadOnly) variables used to feed pins within the AnimBP. So now, your inherited AnimBP has a good set of default variables that make sense for the that it was created from. In order to make your Puppy Pawn use a puppyâs loco blend in the AnimBP instead of the default humanâs loco blend, you will need to overwrite the values of those pin-feeding variables in code when the Pawn gets initialized with a set of UPROPERTY(EditDefaultsOnly) variables that live on the Pawn side. We did it inside the scope of our Pawnâs âPreInitializeComponentsâ override.
I recommend making this variable setting from the pawn optional, letting nullptr on the pawnâs side indicate that it is okay with the default value stored on the AnimBP side.
if (pawn->locoBlend)
{
animBP->locoBlend = pawn->locoBlend;
}
So setting those properties on the pawn side will ensure that pins get fed with Puppy Sequences/Blends and not Human Sequences/Blends, otherwise, itâll leave the animBPâs defaults alone.
hello, Kain Shin ~
iâm very interisted in your solution, could you give some more details on how to archive that? you can see my need in above post, thatâs so common but not valid in UE4âŚ
Hi wellbye, I am not sure what you mean by âarchiveâ, but Iâll post what I can. Much of what I did is in our own game that has not been announced yet, and so I am obligated to leave out details on the gameplay side.
The engine mode is this:
bool USkeletalMeshComponent::NeedToSpawnAnimScriptInstance() const
{
IAnimClassInterface* AnimClassInterface = IAnimClassInterface::GetFromClass(AnimClass);
const USkeleton* AnimSkeleton = (AnimClassInterface) ? AnimClassInterface->GetTargetSkeleton() : nullptr;
//QTN_ENGINE_MOD [Kain: November 3rd, 2016] Allow incompatible meshes to be assigned to enable the use of same AnimGraph with completely different Pawns
//if (AnimationMode == EAnimationMode::AnimationBlueprint && (AnimSkeleton != nullptr) &&
// (SkeletalMesh != nullptr) && (SkeletalMesh->->IsCompatible(AnimSkeleton)
// && AnimSkeleton->IsCompatibleMesh(SkeletalMesh)))
if (AnimationMode == EAnimationMode::AnimationBlueprint && (AnimSkeleton != nullptr) && (SkeletalMesh != nullptr))
//...QTN_ENGINE_MOD [Kain: November 3rd, 2016]
{
if ( (AnimScriptInstance == NULL) || (AnimScriptInstance->GetClass() != AnimClass) )
{
return true;
}
}
return false;
}
An example of a pin feeder is this:
Inside...
class MYGAME_API UMyAnimInstance : public UAnimInstance
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
class UBlendSpace* LocoBlend;
Inside...
class MYGAME_API AMyPawn : public ACharacter
UPROPERTY(EditDefaultsOnly)
class UBlendSpace* LocoBlend;
You will still need to do the manual hookups of properties to pins in the AnimBP asset. Any node in the AnimBP can have its anim asset exposed as an input pin instead of specified by the node via that â(As pin)â checkbox
sorry for my pool words, i was meaning âachieveâ.
thanks for your reply~ i have understood your direction,
before try it myself, may i get an answer of:
with this solution, could all anim sequenceâs notifies be processed in the same AnimBP?
Yes, notifies come purely from the anim sequence or montage. They do not come from the AnimBPâs graph, so it will be up to you to make sure that your PigDragonManâs anim sequence or montage contains the proper notify in it if it is different from the default (ManBearPig) 's anim sequence or montage fed into the pin within the AnimBPâs graph node.
So was trying this method of swapping your Target in a child AnimBP in UE5, however my character exploded. Speaking with UDN, I was given this response.
âThe intended solution for this in UE5 would be the template anim blueprints that we added. Theyâre agnostic so allow you to setup your graph and then derive from it as a child blueprint at which point you can specify the you want to use.â
It was at least possible in UE4 to create a duplicate animation blueprint with a click and only choose which animations to switch. This would create an animation blueprint with appropriate blendspaces automatically.
It seems that in UE5 this option is gone as well. The fact that this option is gone in UE5 is extremely harmful to our process. Does anyone have any information if there is another solution or a way to do this?