Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Rezzolution · Dec 04, 2013 at 11:15 PM · animationanimationcliprecording

Record Animation at Runtime?

Hey guys! Hoping for some help with something...

I'm trying to figure out if it's at all possible for me to press play, and then record all of my main characters' movements during runtime as a new animation clip for playback later? I feel like this is something that should be able to be done, but I honestly just don't even know where to start...

Thanks in advance!

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eudaimonium · Sep 13, 2015 at 04:38 PM 0
Share

That shouldn't be too difficult to implement at runtime.

$$anonymous$$ake a special script that keeps a list of IDs or names of animations or such. Then, at your player controller script, each time a control is pressed that initializes a new animation, add new animation ID to the list of saved IDs. Then, simply assign a key to clear, and play back the saved animations.

That's as far as I figured what you're trying to achieve. If you need to make a new Animation clip asset for use in Editor itself, I see no reason why you can't chain wanted animation clips via $$anonymous$$echanim states. Simply don't put any transition condition, and enable Exit time for each state. That way they'll play end to end in a sequence.

avatar image Mijn · Sep 14, 2015 at 10:03 AM 0
Share

@Rezzolution any update on this? trying to achieve kind of the same (kinect controlling avatar through the zigfu zdk, all my movements should be recorded in runtime for playback to my avatar later) but i can't seem to find any solutions.

4 Replies

· Add your reply
  • Sort: 
avatar image
9

Answer by newyellow · Mar 18, 2016 at 10:00 AM

Though it might be late now, I've done some script on this topic. https://github.com/newyellow/Unity-Runtime-Animation-Recorder

With this project, you can do just like you said: press play button and record all animation, and save to an .anim file, and you can even export it to .ma files for Maya.

Hope this helped!

Comment
Add comment · Show 11 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image RobbertUnity · Jan 11, 2017 at 06:25 PM 0
Share

Hello Newyellow,

Tried using the script, but when I do step 2: - Press "Set Save Path" button in the inspector, choose pick a folder and enter file name.

I am not able to click on save, it is non responsive. Can you help me fix this?

Thanks in advance!

avatar image newyellow RobbertUnity · Jan 12, 2017 at 04:48 AM 0
Share

Have you tried the demo scene and follow the video instruction?

If you do and it still happened, I'm not sure why. And since this save thing is not a custom script, it's Unity Editor's function, I can hardly help with it.

$$anonymous$$aybe check your Unity version? It has been test with Unity 5.4.x, all 5.x version should work fine.

And by the way, if you encountered any issue, you can report in the Github project page.

avatar image MeanGuy · Jan 11, 2017 at 08:53 PM 0
Share

Newyellow,

I've just come across your script as well and look forward to trying it further. Have you come across any other similar products on the Asset Store similar to yours? I'm not on the program$$anonymous$$g side of Unity and it appears much of this type of things is out of my reach unless someone, like yourself, offers it up. Are there any limitations on what this can record?

Thanks!

avatar image newyellow MeanGuy · Jan 12, 2017 at 04:55 AM 0
Share

It seems nothing similar in asset store, at least I didn't find any before I write this script. The record to .anim function is Unity's build in. Unity use it to build the Animation Recording thing, but they didn't offer runtime recording.

The limitation is, the recording function is not like 3D softwares like maya or 3D max. In maya or 3D max you can record things like Vertex animation, but this Unity Runtime Recording function can only record Transform's value changes, which are position, rotation and scale.

avatar image andreasng_pd · Feb 14, 2018 at 12:51 PM 0
Share

hey ny

I put the script on a character, expecting it to record the transforms of the children of the character(as in all the bones). But the FBX exports a file with file-size that tells me there is content in the file, but there is nothing to see.

The $$anonymous$$A export exports the thing all right, there is animation on ONE attribute on one of the many many nodes. It is not on a bone but rather a grp, and it just rotates left,right,left,right.

avatar image newyellow andreasng_pd · Feb 15, 2018 at 07:53 AM 0
Share

The $$anonymous$$A Exporter should work well. But you should notice the node's names. If there are two nodes with same name, that might cause errors.

avatar image andreasng_pd newyellow · Feb 15, 2018 at 09:51 AM 0
Share

hmm I had animation on all bones from the get go, so that definitely wasn't a good thing. Starting with a fresh character yields no better results though. $$anonymous$$y hierarchy looks like this

 **char.ma**
 char (grp)
 L___ skeleton (grp)
 .       L___ joint1 (joint)
 .       L___ joint2 (joint)
 .       L___ joint3 (joint)
 .       L___ etc
 L___ mesh (grp)
 .       L___ mesh1 (mesh)
 .       L___ mesh2 (mesh)
 .       L___ etc.

the same in the hierarchy in unity.

However the only thing that gets animation is the group called skeleton, which to makes no sense. And the animation is like this: alt text

Also the chest is just rotated 115 degrees, no keys on it, nothing. Just a one time rotation.

Show more comments
avatar image andreasng_pd · Feb 14, 2018 at 12:55 PM 0
Share

the fBX exporter gives me this:

ArgumentOutOfRangeException: Argument is out of range. Parameter name: index System.Collections.Generic.List`1[FbxDataNode].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633) FbxDataNode.FetchNodes (System.String inputData, Int32 level) (at Assets/Recorder/Unity Runtime Recorder/Scripts/FbxExporter/FbxDataNode.cs:71) FbxDataNode.FetchNodes (System.String inputData, Int32 level) (at Assets/Recorder/Unity Runtime Recorder/Scripts/FbxExporter/FbxDataNode.cs:51) FbxDataNode.FetchNodes (System.String inputData, Int32 level) (at Assets/Recorder/Unity Runtime Recorder/Scripts/FbxExporter/FbxDataNode.cs:51) FbxExporter+c__Iterator0.$$anonymous$$oveNext () (at Assets/Recorder/Unity Runtime Recorder/Scripts/FbxExporter/FbxExporter.cs:215) UnityEngine.SetupCoroutine.Invoke$$anonymous$$oveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/develop/UnitySource/Runtime/Export/Coroutines.cs:17)

avatar image newyellow andreasng_pd · Feb 15, 2018 at 07:56 AM 0
Share

The FBX exporter still has many things to work on. I just found another bug happens when your FBX original file already has animations, even just 1 or 2 frames. So make sure your FBX file contains exactly no animations. (When you put the file in Unity, the animation tab in the import setting is empty)

avatar image plindsey · Mar 08, 2018 at 11:33 PM 0
Share

Thankyou so much for creating this package it has helped me immensely in recording $$anonymous$$inect movement. You should definately put it on the store for like $2 or something.

$$anonymous$$ay I suggest a FPS modifier for saving to anim

         if (nowTime > (frameIndex) * (1 / (float)FPS)) {
             for (int i = 0; i < objRecorders.Length; i++) {
                 objRecorders [i].AddFrame (nowTime);
             }

             if (recordBlendShape) {
                 for (int i = 0; i < blendShapeRecorders.Count; i++) {
                     blendShapeRecorders [i].AddFrame (nowTime);
                 }
             }
             frameIndex++;
         }

Can make editing a lot easier

Thanks again for your contribution to the community

avatar image
1

Answer by victorverg · Feb 23, 2018 at 03:05 PM

I'm wondering if there's any way to record Blendshapes as well? I'm looking for a way to record the iPhone X's face tracking data from the ARKit demo in runtime.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by charlesjohney3 · Feb 15, 2018 at 10:37 AM

Hi.

I'd get a kick out of the chance to utilize the "Record Animation" highlight in the Game Engine where developments by a question at runtime are recorded to the protest's liveliness, yet for only one protest and not for the whole scene. Is it conceivable? http://www.flamingovideo.com/explainer-videos/

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by andreasng_pd · Feb 15, 2018 at 01:50 PM

Ok!

For anyone finding their way in here, these are the things you have to think about.

__1: Objects in maya should not be "frozen" in their relative spots, So an arm, for example, should be moved to 0,0,0 then frozen, then you can move the arm back up to where it should be. Don't know if that matters.

__1.2: I refrained from having a hierachy in the cut out character. So hand is not child of elbow which isn't child of upperArm etc etc. The ma file is just the cut out pieces, no containing group, no nothing.

__2: I gave up on an actual character. Instead I made a "cut out" character where the things I want to record has been cut out of the actual character. Then with playmaker (unity tool) I "get pos, get rot, set pos, set rot", on every single one of the limbs every frame, so they follow the joints of the character 1:1. Lo-fi, but it works. :)

__3: the recorded .ma file will make Unity crash, so don't let it start to import it. I move it out of the project immediately after recording. you have to set the export path to outside unity project.

__4: Use the .ma exporter. FBX does not help you set it up. Ma exporter has nice buttons and features. Remember to activate debug, so you can see when the thing actually records!

__5: The recorder takes a snap shot of the positions every frame, so when the game starts to slow down it seems like animation will go faster in the recorded footage. Because there is longer between steps in-game, but still only one time step between the recorded frames.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

26 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make pre-recorded character movements, then have them playout during a scene? 0 Answers

Children Object rotation/position get reset after Initializing Animation Recording 0 Answers

Unity2D - Playing animation with separte body parts/Setting Anchor point to sprites for each frame 0 Answers

Animation not looping 1 Answer

How to Serialize an AnimationState 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges