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"

[HOWTO] Animation C++

I want to know better an animation in UE4.

What I wonder, if you load an animation in the EU4 from C++ (VS2015) and i write the appropriate code. So I reason and I say that is loaded into RAM (stack, heap, what else...) with all related data of the animation. Then the animation loaded in RAM where there will be an object that contains all the data. I assume that there will be a class of that object. The thing that I have not realized yet. Which is the class???

Because i want to edit that animation data.

What i saw until now, it's there is a skeleton and a mesh. Then create an association between them and at last rigging.

I think there is a parent class over the skeleton class and the mesh class to do the association. But i repeat i don't know the class.

Can Anyone help me? thank you

Product Version: UE 4.10
Tags:
more ▼

asked Jul 13 '16 at 04:25 PM in C++ Programming

avatar image

frawe
3 1 2 3

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

1 answer: sort voted first

The class is called UAnimSequence.

For example, in UAnimSequence you can call GetBoneTransform which will extract the bone transform for a certain time for a certain track. You can choose to extract the raw data, or the processed one. The track is simply the bone in question (so the root bone is index 0, beyond that check your skeleton).

In AnimSequence.cpp you can look at ExtractBoneTransform (there are two of these, look at the longer one) - you can see how it gets the raw values directly.

more ▼

answered Jul 14 '16 at 12:04 AM

avatar image

rantrod
1.5k 49 47 216

avatar image frawe Jul 14 '16 at 10:19 AM

ok i saw, thank you so much for this support.

I saw the struct it contains raw data. One question can i rewrite by hand this raw data at run-time in real time!?

 /**
  * Raw keyframe data for one track.  Each array will contain either NumFrames elements or 1 element.
  * One element is used as a simple compression scheme where if all keys are the same, they'll be
  * reduced to 1 key that is constant over the entire sequence.
  */
 USTRUCT()
 struct ENGINE_API FRawAnimSequenceTrack
 {
     GENERATED_USTRUCT_BODY()
 
     /** Position keys. */
     UPROPERTY()
     TArray<FVector> PosKeys;
 
     /** Rotation keys. */
     UPROPERTY()
     TArray<FQuat> RotKeys;
 
     /** Scale keys. */
     UPROPERTY()
     TArray<FVector> ScaleKeys;
 
     // Serializer.
     friend FArchive& operator<<( FArchive& Ar, FRawAnimSequenceTrack& T )
     {
         T.PosKeys.BulkSerialize(Ar);
         T.RotKeys.BulkSerialize(Ar);
 
         if (Ar.UE4Ver() >= VER_UE4_ANIM_SUPPORT_NONUNIFORM_SCALE_ANIMATION)
         {
             T.ScaleKeys.BulkSerialize(Ar);
         }
 
         return Ar;
     }
 };

avatar image rantrod Jul 14 '16 at 11:30 PM

I've never tried it but it looks like you can. The main structure involved, RawAnimationData, is public and the structures inside it are also public. Can't see why not.

avatar image frawe Jul 18 '16 at 08:37 AM

ok now im triyng it.

(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