Git Product home page Git Product logo

unity.animation.samples's Introduction

Unity.Animation.Samples

This repository contains projects that showcase the new DOTS animation package (com.unity.animation).

Disclaimer

This version is highly experimental. We want you to know it's there, we invite you to peek at it and consider what it might mean for you and the future of Unity. What we don't want you to do is to rely on it as if it's something ready for professional production.

  • Will work on 2020.1.2f1 and up.
  • HDRP/URP GPU skinning only.
  • Not (yet!) for production use.
  • Early picture of what the DOTS animation system, might not be representative of the final version.
  • You will need to be tech savvy to use this version. Not yet ready for everyone.
  • Core system only, many animation tools are missing.
  • Expect things to change.

This repository uses Git LFS to track resources' files (models, textures, etc.). You will need to install Git LFS and clone the repository to get the files. If you download a ZIP, the files will not be included and the projects will not work.

unity.animation.samples's People

Contributors

audegi avatar mecanimdev avatar oldio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unity.animation.samples's Issues

Null ref

Downloaded samples, added project to unity hub, opened it up in 2019.4.1f1 LTS, opened a scene, got this error. This does happen in all scenes.

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Rendering.HighDefinition.StaticLightingSky.UpdateCurrentStaticLightingSky () (at Library/PackageCache/[email protected]/Runtime/Sky/StaticLightingSky.cs:127)
UnityEngine.Rendering.HighDefinition.StaticLightingSky.OnEnable () (at Library/PackageCache/[email protected]/Runtime/Sky/StaticLightingSky.cs:184)

I went digging into StaticLightingSky.cs and found this on line 126/127

var defaultVolume = HDRenderPipeline.GetOrCreateDefaultVolume();
defaultVolume.sharedProfile.TryGet(skyType, out SkySettings defaultSky);

It seems defaultVolume.sharedProfile is null.

Custom Node Examples

Hi,

Would it be possible to add an example for creating custom nodes to use in the graph. I'm an animation programmer and creator of 'Motion Matching for Unity'.

It would be nice to have an example to show how to do this so we can implement complex animation behaviour nodes like internalisation, motion matching, stride warping etc. etc.

Basic layer example

Working through how to setup a simple override layer and this seems like it would be a good addition to the samples, pretty common use case I think. It looks like LayerMixerNode is the right tool at first glance, working on that assumption now as I get something working.

Linux Vulkan HDRP

Suggest removing OpenGLCore setting for Linux HDRP project and only use Vulkan. OpenGLCore is not supported on Linux HDRP only vulkan works for HDRP.

Upgraded Packages to new animation package but animation does not work.(BlendTree2D Simple Direction)

Hi,

My Setup
Universal Rendering Pipeline (I am not using bone rendering component so it might not be the issue maybe.)
Animation Package Version 0.6.0-preview.2
all the required dependencies are installed.
Reference example Scenes->Examples -> BlendTree2D Simple Direction
Model -> Rig - Humanoid
Animations - > Rig - Humanoid (avatar configured from above model)

Changes I made

where TAnimationGraphTag : struct, IGraphTag    (changed into)  ->  where TAnimationSystemTag : struct, IAnimationSystemTag
where TAnimationGraph  : ComponentSystemBase, IGraphSystem<TAnimationGraphTag>    (changed into)   ->    where TAnimationGraph : ComponentSystemBase, IAnimationSystem<TAnimationSystemTag>

public class BlendTree2DGraphSystem : SampleSystemBase<BlendTree2DSetup, BlendTree2DData, PreAnimationGraphTag, PreAnimationGraphSystem>    (changed into)   ->   public class BlendTree2DGraphSystem : SampleSystemBase<BlendTree2DSetup, BlendTree2DData, PreAnimationGraphSystem.Tag, PreAnimationGraphSystem>
PostUpdateCommands.AddComponent(entity, graphSystem.Tag);        (changed into)   ->  PostUpdateCommands.AddComponent(entity, graphSystem.TagComponent);


output
I am able to see rendered model with no errors with static T pose (As per provided count settings).
I am able to debug inputs I passed and BlendTree2DData is also showing proper data through entity debugger.
I dont know its relevent or not I was able to see DisableRootTransformReadWriteTag in one entity list.

Thank you in advance.

Bug in the cache system of animation Curve

Hi,
In the preview.9 0.3.0

In AnimationCurveEvaluate.cs :

static void FindSurroundingKeyframes(float time, ref BlobArray<float> timeCurve, ref AnimationCurve.AnimationCurveCache cache, 
            out float leftTime, out float rightTime)
        {
            var lhsTime = timeCurve[cache.LhsIndex];
            var rhsTime = timeCurve[cache.RhsIndex];

            // Check if we are in the cached interval.
            if (cache.LhsIndex!= cache.RhsIndex && time >= lhsTime && time <= rhsTime)
            {
                leftTime = lhsTime;
                rightTime = lhsTime;  -> Must be rhsTime
                return;
            }
.....

Thanks

S. Pothieux

Runtime Conversion (Non-subscene workflow)

All examples appear to rely on the animations being used in a subscene, since they rely on functions like toDenseClip which is inside a #if UNITY_EDITOR preprocessor statement.

This doesn't work nicely or easily with dynamically created environments. Example, i have a game where I dynamically create a set of enemies depending on some difficulty level. These enemies are instantiated from prefabs during runtime. I can easily attach any component and even particlesystems (via AddHybridComponent), yet I don't see how this would work with animations.

It would be tremendously helpful to have an example that shows how to do this non-subscene conversion flow. ๐Ÿ™

CC @oldio, @mecanimdev :)

Shader for built in rendering

I'm sure someone else besides us would like to make this work in built in. It's simple enough. This is a shader that works:

https://gist.github.com/gamemachine/2fe6e1f919f6fa6cf5b20eb942ddc0da

You will have to use Graphics.DrawMeshInstanced yourself though, Hybrid Renderer uses the new BatchRenderGroup which isn't passing instanced data to builtin correctly.

BoneIndexOffset has the offset you need for the instanced shader prop. If you just disable the SkinnedMeshRenderer component that prevents the hybrid renderer from picking it up. Fairly straight forward.

Does UnityAnimationURPExamples support Android builds?

I tried to build using android platform build package, but the character was not visible on the device.
It worked fine in the window platform build.

I used Unity2020 2.0b / URP 10.2.1 / Hybrid Renderer 0.10.0-preview.21

MyFirstAnimationClip example isn't visible in build

Hi,

I've opened a fresh copy of the MyFirstAnimationClip example in Unity 2019.3.0f6 and it runs as expected in the editor. However, when I build (Windows x86_64), I don't see anything in the scene. I've tried building the scene on its own, and also tried opening up the subscene and building the two together. The result is the same. What can I do to get the model visible in the build?

Thanks for reading.

EDIT: Never mind; just found out about building via BuildSettings objects.

All Other Entitie`s Animations Will Stop When Change An Entitie`s Node

Hi,

I was created a system for playing and changing animation during play with "ClipPlayerNode", "ChannelWeightMixerNode" and "WeightBuilderNode" and "Rig" created with "RigComponent(RigConvertionSystem)"
all things work good when instantiate all rig and nodes all together in one frame
only last instantiated entity will animated if i instantiate them in separete frame

where did i go wrong?

Need support for Humanoid Animation

hello, thanks for the great sample. I have checked it out and created my own animation sample by following the sample source code. but bones will not be driven by animation clip when I use humanoid animation source. I have tested my script source code with "default male"(generic animation) animation resources in origin sample, and it works well... So it seems that humanoid animation is not supported currently in dots animation...Any plan for humanoid animation support? thanks

[AnimationGraph] The BlobAssetReference is not valid. Likely it has already been unloaded or released.

Hello,

I am trying to use com.unity.animation for a simple case since animator is too expensive for high amount of actors; randomly getting "The BlobAssetReference is not valid. Likely it has already been unloaded or released." for the animation clip asset. Can you think of a reason that can be resolved quickly?

Related Unity Forum Thread: https://forum.unity.com/threads/animationgraph-the-blobassetreference-is-not-valid-likely-it-has-already-been-unloaded-or-released.1115974/

Timing issues with built in rendering

I get that this won't support built in but thought I'd post it anyways. Latest version of 2019.3.

I did a quick implementation with a vert/surface shader using the same core shader logic. Skinning appears to work fine, but in the stress test scenes individual skinned meshes get out of sync with each other. And it gets progressively worse the more characters there are. Mostly just curious if there is something obvious that would cause that in built in as it has me stumped. We plan on moving to HDRP but not until 2020 but I'd like to get a head start on the animation as it's a huge chunk of work.

Is there any hack to render animations in an android build?

I am trying to create animations for a unity project, intended for an android build. Majorly all the code works inside a #if UNITY_Editor preprocessor statement, hence no rendering for an android build. Is there any workaround to overcome this issue?

Use animations from mixamo

Hello!

I am trying to play my own animation with the new animation system (com.unity.animation 0.8.0-preview.4).
For testing I use the Animation Sample Project (https://github.com/Unity-Technologies/Unity.Animation.Samples), which works without problems and I have my own animation from https://www.mixamo.com/#/.
If I replace the original animation with one from mixamo the character will not be animated anymore.

Unfortunately, I get neither warnings nor errors which leaves me completely in the dark about what the problem might be.
Thanks for the help!

ps: If I use the Rig_TerraformerLOD0 character with the "mixamo animation" with the old animation system (with animator and controller) both works perfectly together.

ECS/conversion flow

It really seems like there is a lot of unnecessary indirection/additional complexity going on in the setup flow that stems from trying to use entities/components for everything. I would hold out Unity.Physics as perhaps a better model. Integrate with ECS where the value add is clear.

Another real issue is that animation is also something you might want to incorporate in complex sequenced logic within a job. Surfacing everything as entities/components complicates that greatly. Again I think Unity.Physics is a good example of an approach that strikes the right balance. Like just working directly with the graph in jobs. The downside is it then becomes a shared dependency you have to manage. But for physics it's been a price well worth paying and I think animation logic is going to be a very similar paradigm.

Overall I'm really liking the whole thing. Looking forward to what's coming.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.