Issue with animating bone in AnimationSequence Editor

Hello,

I’m having some issue troubleshooting this and I’m looking for help finding what could cause this.

I’m using the “attach” bone of the skeleton to animate an “Hitbox” via the AnimationSequence Editor.

When doing this on any animation from GASP it’s working as intended.

But when I try to do this on one of our own animation made in Maya and exported to Unreal as an FBX it do this:

[Image Removed]

I’m unsure about where to look next for potential issues. If you have any idea it will greatly help !

Thanks

Hi there,

Could I get some details on the specifics here and possibly the FBX you are using?

You exported to and animated the mannequin in Maya, reimported that animation, and want to adjust the attachment bone’s animation further?

And just to double-check, for the gif you posted above, that is in the animation viewer, not sequencer. Is there a primary reason to adjusting the bone there?

Apologies for the delay.

Using the code example, character source, and animation, I still couldn’t reproduce your issue. Is this something that you can build a little test project around in vanilla unreal to see if you can recreate it? Is there any other code you have added around bone adjustment in your hitbox setup?

In terms of your other question, you can’t access the current animation time directly. But you can get the current anim notify’s that are available and check if they are playing.

`void UMyAnimNotifyState::DrawInEditor(FPrimitiveDrawInterface* PDI, USkeletalMeshComponent* MeshComp, const UAnimSequenceBase* Animation,
const FAnimNotifyEvent& NotifyEvent) const
{
const float NotifyStartTime = NotifyEvent.GetTriggerTime();
const float NotifyEndTime = NotifyEvent.GetEndTriggerTime();
TArray NotifyEventReferences = MeshComp->GetAnimInstance()->NotifyQueue.AnimNotifies; //Get the current notify event references playing.
for (FAnimNotifyEventReference NotifyEventReference : NotifyEventReferences)
{
if (NotifyEvent == *NotifyEventReference.GetNotify()) // Test that the notify definition and the reference are the same.
{
if (NotifyEventReference.GetCurrentAnimationTime() < NotifyEndTime && NotifyEventReference.GetCurrentAnimationTime() > NotifyStartTime) //Test the accumulated time
{
FTransform Transform = MeshComp->GetSocketTransform(“HitBox1”);
FVector BoxExtent(5.0f, 5.0f, 5.0f);
FBox Box = FBox::BuildAABB( FVector :: Zero(), BoxExtent) ;
DrawWireBox(PDI, Transform. ToMatrixWithScale(), Box, FColor::Green, SDPG_World);
}
}
}

Super::DrawInEditor(PDI, MeshComp, Animation, NotifyEvent);
}`Here’s some modified code to show the example.

Hey there,

So thank you for all of the files they were really helpful to pinpointing the issue.

I’ve logged a bug that you can follow here: https://issues.unrealengine.com/issue/UE-276855

For the past few days, I’ve been looking for a fix, and will continue to do so. If you’d like to take a look yourself, you’ll want to start at FSkeletonSelectionEditMode::InputDelta and follow the code through to FAnimPreviewInstanceProxy::ApplyBoneControllers. Right now, the interplay between moving the widget to the updated location of the bone and the additive scalar data is creating the issue. Unfortunately, though, I don’t have a solution yet, which I was trying to do before I offered a suggested workaround.

The workaround I would suggest at the moment, is not to have additive scalar curves transform the bone, but instead add new named curves to animate the extent of the box. Then your hitbox code can look at those curves and animate those extents. The unfortunate bit here is that it means you are animating 2 set of curve data when you may only need one. The benefit is that scalar data may not work as well in the engine right now as just plain curve data, and if you end up blending during hitbox adjustments, this could serve you better overall.

That’s no problem,

The new TRS gizmos were just released in 5.5 and they are being built for animation in engine purposes, but are intended to be something we invest in for the future. I’ll look into why that might be solving your issue, because there might be other issues lurking there.

In terms of setting up a new gizmo, it’s not an easy process. You would need to setup a new edit mode and register it with persona. You can see how we do this with the SkeletonSelectionEditMode in PersonaModul.cpp

FEditorModeRegistry::Get().RegisterMode<FSkeletonSelectionEditMode>(FPersonaEditModes::SkeletonSelection, LOCTEXT("SkeletonSelectionEditMode", "Skeleton Selection"), FSlateIcon(), false);Then you would need to follow a lot of what we do with the SkeletonSelectionEditMode, overriding similar functions and then hooking it into whatever you decide to handle “selection”.

Hey,

Sorry for the delay I was off.

We took the skinned mesh from UE and rigged it for maya using mgear and made the animation from scratch in Maya.

The skinned mesh in the preview is an export from our Maya version but it’s using the same skeleton.

I attached the fbx from the animation, do you need to fbx of the skinned mesh as well ?

We want to edit it here becauseI’m trying to recreate a tool that we made for Unity where everything was centralized. So you could edit animation markers (Notifies) and animate the hitbox in the same place (among other things). The sequencer didn’t felt like the right place to do that

No problem.

Thanks for the file. I was able to load it onto the UEFN Mannequin without any issues. That said, I couldn’t reproduce the problem with just the animation, which is where I initially thought the issue might be, so there may be some more back-and-forth here. My thought is there might be something unique about the newly skinned mesh or the approach you’re using to attach the hitboxes.

  • Having the skinned mesh as well could help.
  • Could I get an overview or file explaining how you set up your hit boxes?

When you’re editing your attach bone, just to verify you are:

  • Selecting the attach bone
  • Hitting the key button
  • Animating on an additive curve

[Image Removed]

For now my hitbox setup is a bit “dirty” but I have a NotifyRange “Hit” that has a drawer that looks for a socket “HitBox1” which is attached to the bone “attach”

(That being said I sidetrack a bit, but I wanted to change the color of the gizmo if the preview is in the range of the NotifyState. If you have an idea on how to achieve this)

[Image Removed]Then in runtime I spawn an hitbox blueprint and attach it to this socket

Yes when animating I’m doing what you said (but using the “S” key as a shortcut to add a key)

I attached the fbx of the skinned mesh

Thanks

I attached a small project on which I repro 100% (but it took some moving/rotating the box around and keying before getting to this state)

[Image Removed]

Hey,

Thanks, the workaround does seem to fix the issue

However it’s not very user friendly and I was wondering about switching everything to custom curves and having a custom Gizmo Handle to edit it. Without animating the “attach” bone directly. To avoid potential “user issues” and improve QoL :sweat_smile:

But I’m still quite new to UE and unsure about what’s possible/how to do it properly. By looking around I found this “UInteractiveGizmoManager::Create3AxisTransformGizmo” but couldn’t figure how to use it in my context :sweat_smile:

If you have some time to spare I would be very glad if you could give me some entry points on this

Sorry for the double post, but someone from the team tested to enable the plugin “New TRS Gizmos” (and enable it in the editor preference)

[Image Removed]

And for some reason we no longer reproduce the issue with this Gizmo

It was too good to be true, it seems that with non uniform scale when trying to move only on one local axis it wont follow the proper direction indicated by the gizmo

[Image Removed]

I guess I’ll need to find the time to look into setting up a new gizmo as you said