Skip to content

Conversation

@nozomanai
Copy link
Contributor

  • Excluding the need to create a new object every time a node is executed
  • The montage works without ending after the node is interrupted
  • Code optimization

I think this is the best version currently available

nozomanai and others added 8 commits August 25, 2024 12:02
…ver become false

- remove redundant member variables
- refactoring UBTT_PlayAnimMontage
BTC_RandomSelector->RemoveUnusedChances button
- fix Montage interrupted
- Code optimization
Comment on lines +16 to +26
enum ETaskNodeEndPolicy
{
GENERATED_BODY()
/**
* after the node ends, still need to perform montage node, using this policy can make the anime more coherent
*/
OnMontageBlendingOut,

public:

/**
* try to Play montage and create callback.
* If played successfully, return callback. otherwise return null
* end when the montage is completely finished, applicable to situations where only one montage is executed
*/
static UMyPlayMontageCallbackProxy* TryCreateProxyObjectForPlayMontage(
USkeletalMeshComponent* InSkeletalMeshComponent,
UAnimMontage* MontageToPlay,
float PlayRate = 1.f,
float StartingPosition = 0.f,
FName StartingSection = NAME_None)
{
UMyPlayMontageCallbackProxy* Proxy = NewObject<UMyPlayMontageCallbackProxy>();

if(Proxy->PlayMontage(InSkeletalMeshComponent, MontageToPlay, PlayRate, StartingPosition, StartingSection))
{
Proxy->SetFlags(RF_StrongRefOnFrame);
return Proxy;
}

Proxy->MarkAsGarbage();
return nullptr;
}
OnMontageEnded
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩷

@Ciberusps
Copy link
Owner

Ciberusps commented Aug 29, 2024

Sry cant check for now, will check on saturday (10% chance - tomorrow 🙃)

@Ciberusps
Copy link
Owner

Ciberusps commented Sep 1, 2024

Testing on Plugins/UnrealHelperLibrary/Content/Gyms/Gym_PlayAnimMontage_StressTest.umap
Don't know why but only last character continue to play montages others stops after one montage
Reproduces with both OnMontageEnded/OnMontageBlendingOut
image

UPD bCreateNodeInstance = true; fixes it and all works fine. tbh I think its ok to have instancing

@Ciberusps Ciberusps self-requested a review September 1, 2024 18:26
Ciberusps
Ciberusps previously approved these changes Sep 1, 2024
@Ciberusps Ciberusps self-requested a review September 1, 2024 18:26
@Ciberusps Ciberusps dismissed their stale review September 1, 2024 18:27

forget to enable instancing

@Ciberusps Ciberusps self-requested a review September 2, 2024 09:37
@Ciberusps Ciberusps merged commit b325655 into Ciberusps:main Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants