x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

LayeredBoneBlend via Code

Hey Community,

I've created all of my animations and have utilized them via code while working with montages. Though something I wanted to do was to have the upper half of my animation play while the lower half operates independently with another set of animations.

I've followed these set of video tutorials from epic but they focus on blueprints. So I thought i'd look into the nodes they were using and well... found myself stuck. I'm not entirely sure to be honest where to even begin on this.

https://www.youtube.com/watch?v=C16vlfe3pXc&index=20&list=PLZlv_N0_O1gZS5HylO_368myr-Kg2ZLwb https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Animation/FAnimNode_LayeredBoneBlend/index.html

So any assistance would be greatly appreciated for new methods to be explored. Below is the code I use when calling different animations.

     bool Idle_Bool = GetMesh()->AnimScriptInstance->Montage_IsPlaying(Idle_1);
     bool Running_Bool = GetMesh()->AnimScriptInstance->Montage_IsPlaying(Running_1);
 
     //Check to see if the montages are playing to make sure we don't overlap.
 
     if (Idle_Bool == false || Running_Bool == false) // Add additional checks for more montages.
     {
         if (IsIdle == true && CheckStuff == false && CheckStuff2 == false) // We are currently idle.
         {
             // Play Montage Here
             float Idle = PlayAnimMontage(Idle_1, 1.0f); // Play rate. Default is 1.0f
         }
 
         else if (IsIdle == false) // We are not idle.
         {
             if (IsRunning == true && Running_Bool == false) // We are running however.
             {
 
                 float Run = PlayAnimMontage(Running_1, 1.0f); // Play rate. Default is 1.0f // Check rate conditionally.
             }
 
             if (IsRunningBackwards == true && Running_Bool == false)
             {
                 float Run = PlayAnimMontage(Running_1, 0.5f);
             }
             //If IsWalking == true && Walking_Bool == false
         }
     }
Product Version: Not Selected
Tags:
more ▼

asked Feb 06 '15 at 01:15 PM in C++ Programming

avatar image

Mark James G
534 44 25 51

avatar image Mark James G Feb 07 '15 at 01:27 PM

Do the folks at Epic know? Or does anybody have any ideas?

avatar image Mark James G Feb 09 '15 at 09:38 AM

C'mon community! Don't let me down! As an update I included the following below but I am still wondering how to get this to work with montages! Thanks in advance!

 #include "Animation/AnimNode_LayeredBoneBlend.h"

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I didn't watch video but I'm not sure exactly what is problem. If you'd like to play upper body/lower body separate, you'll have to create anim BP and you can have two different slot node to play different montage. And from code, you'll trigger the montage using the slot node name. What exactly is your problem here? The logic of the code is to play montage, but I don't see any anim BP. Do you want to do everything in code including layered blending?

--Lina,

more ▼

answered Feb 12 '15 at 07:45 PM

avatar image

nikolobin STAFF
705 14 12 33

avatar image Rama Feb 12 '15 at 09:06 PM

What Lina said,

and I wrote a wiki on extending the Anim BP in C++

Wiki Link https://wiki.unrealengine.com/Animation_Blueprint,_Implement_Custom_C%2B%2B_Logic_Via_Tick_Updates

Rama

avatar image Mark James G Feb 12 '15 at 09:50 PM

Gotcha! This is what I was afraid of... ah well. I CONCEDE! I will use a Anim BP. :), thanks fellas.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question