BlenderTools icon indicating copy to clipboard operation
BlenderTools copied to clipboard

Send to Unreal -Add to Leve Sequence

Open 1405100494 opened this issue 2 years ago • 6 comments

In the description paste in and edit the following:

  • Addon: i.e Send to Unreal
  • Workflow: i.e. The function of synchronizing instances has been implemented, on which animations are added to the level sequence.
  • Description: i.e. I just tried the new synchronization instance function, may I ask if I can add an animation sequence? At present, the animation of object transformation cannot be exported, if the related card sequence can be solved. It's also easier to render bone animations, and many users want to be able to import unreal render animations easily. Thanks for your harrwork!

1405100494 avatar Apr 28 '23 03:04 1405100494

Yes PRs are welcome here is info on how to contribute https://epicgames.github.io/BlenderTools/contributing/development.html

If I am understanding correctly, you are wanting to add support for instancing AnimSequences in the active level in the instance_assets extension https://github.com/EpicGames/BlenderTools/blob/main/send2ue/resources/extensions/instance_assets.py

I think this would be great, I just want to understand the details of this implementation.

  1. The actor name: For the purpose of unreal AnimSequeces, actions can be linked to armature objects. Blender objects will have a unique name, and the actors will need a unique name. Do we set the actors to the armature object name? Or do we instance the actor with the name of the action and subsequent actor instances of that same action are just post fixed with a number? (i.e. action1, action2, etc)

  2. The Transforms The current implementation uses the first frame to get the transforms for the object (assuming they are keyed). However, thinking about instancing actions, makes me think we should change this to object transforms(ignoring keys). This would have to be the armature object transforms instead I guess.

Just some thoughts, what do you think?

james-baber avatar Apr 28 '23 15:04 james-baber

Thank for your reply. 1.Actor name

  • I think it's more appropriate to use the skeleton object name. Nonlinear Animation in blender uses skeleton animation in almost the same way as in Unreal level sequence, and the added actions synced to Unreal level sequence remain consistent. So adding a new animation to the same skeleton later just adds an NLA action. Although many people only use one long action, the export is pushed to the NLA bar, which does not conflict with this process. NLA can also be used to organize and manage animations, but I think this is only appropriate when exporting assets. This can be used to insert the corresponding NLA animation when synchronizing the level instance, and export those actions as a single animation when pushing assets. Or add a switch option to let the user do it manually. 2.The transforms
  • If you use NLA, blender can also use non-skeleton meshes, but the syncing action in Unreal only works with skeleton meshes, but when you convert to skeleton meshes, object properties and Unreal are different. Have you used a Template Sequence? Using this solves the problem of synchronizing NLA without converting to a skeleton mesh. This will need to bake the frame in key range. But is it possible to add an option not to bake all the keyframes? If you only use 'Constant', 'Linear' and 'Bezier', and Unreal also uses the corresponding interpolation simultaneously, the animation should be the same without baking them.

1405100494 avatar Apr 29 '23 03:04 1405100494

Ok cool, yea Id agree. I think the armature object name and transforms would be the best to use for the instanced AnimSequence actor name and transforms.

I think nailing this down in one PR would be a good step. Then tackle Template Sequence support, in another PR.

It might take some testing to ensure it is right(or within a certain margin of accuracy). Since we'd be transferring sparse keys, curve handles and matching the interpolation types(which might have slightly different algorithms between blender and unreal, I dont know.)

Also some validations on the actions pre export, to check interpolation types. Like "You are using interpolation type "A" and unreal only supports "B" and "C" please change your interpolation type.

Anyways, let me know if you need anything else to get started

james-baber avatar May 01 '23 18:05 james-baber

Thanks, this is all I can think of so far for moving animation from blender to Unreal. Before that I used the datasimth plugin in blender, which was developed by an unofficial person and has not been maintained for two years. It has a few problems but it still works, I can't fix it because I don't know the coding. I'm not sure why the official datasmtih plugin was not developed for blender, which would have made it easier to export non-skeleton meshes and insert instances and animations into level sequences. For skeleton objects, this process also requires exporting fbx animations to UE separately. If send to ue can support insertion into level sequences, this problem can be solved. We can try these ideas first.

1405100494 avatar May 03 '23 01:05 1405100494

Yea LevelSequences are another thing that we will have to really think through. This addon has been focused on creating unreal asset types. And this new extension allows for level/environment building.

If we open it up to supporting LevelSequences, then there will be cameras, tracks etc. (alot more to support/maintain) And USD might give us more support there. The usd python bindings now ship with blender 3.5 and unreal USD support is getting better with each release. USD could be very conducive to LevelSequences. We would have to do some more evaluating

james-baber avatar May 03 '23 14:05 james-baber

USD should be the most perfect DCC scheme for animation, maybe it is more convenient to make a simple extension of this. I mean, like Send to UE, USD can be directly sent to UE, skipping the previous tedious import and export functions.

1405100494 avatar May 04 '23 01:05 1405100494