Animation-Instancing icon indicating copy to clipboard operation
Animation-Instancing copied to clipboard

Runtime generation

Open gamemachine opened this issue 7 years ago • 4 comments

To support things like character customization and clothing you need to break out all the stuff that is editor only mode. I started working on this not too far away from having something workable.

I split out the generation into two steps and created a template abstraction.

So you start with a template, which is your model and skinned mesh(s), along with a list of animation clips you populate manually. In a real workflow you won't be creating animation controllers. So the editor mode generator creates a temporary one for you and generates the AnimationBakeInfo's, which it saves with the template.

Step two continues but it doesn't have anything that requires UnityEditor. So you can swap meshes in your template and generate a new instance at runtime.

Most all of that leaves the existing code untouched for the most part. AnimationBakeInfo needed to be put into it's own file and made public. Loading instance data needs another option to load from a ScriptableObject container I use that holds templates and instances. But mostly it's just an addition.

I'll create a pull request once it's ready. And let me know if you have any thoughts on any of the above.

gamemachine avatar Jul 31 '18 21:07 gamemachine

Are you combining the skinned meshes into a single one per character right now?

strich avatar Aug 01 '18 13:08 strich

That's part of what I was working on here was to combine, since the existing system will only actually use one SMR (aside from the attachment stuff which I haven't tested). But this work got put on hold for now until I work out if the skinning approach itself will work for us. Specifically reconstructing normals.

gamemachine avatar Aug 01 '18 19:08 gamemachine

Sounds great. I am only worried about the performance of runtime. But it's worth to try. I except your pull request.

CloudJin avatar Aug 17 '18 03:08 CloudJin

Any news on this ?

Athomield avatar Oct 20 '18 07:10 Athomield