Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Enable kind of hacky multiple animation export #111

Closed
wants to merge 1 commit into from

Conversation

cdata
Copy link

@cdata cdata commented Nov 8, 2017

Related to discussions in #39

IMPORTANT: It is probably best not to consider this proposal merge-worthy at this time. It is not tested, but more importantly the design is not necessarily the best solution to this problem. It can have undesired results such as duplicate animations being exported with different names, for example.

This is a slight formalization of a patch proposed by @nicocornelis in
#39.

When exporting, the active action for an armature is exported as usual,
but additionally any associated NLA tracks will have their actions
exported and named in the form: "${objectName}_${actionName}".

This is a slight formalization of a patch proposed by @nicocornelis in
KhronosGroup#39.

When exporting, the active action for an armature is exported as usual,
but additionally any associated NLA tracks will have their actions
exported and named in the form: "${objectName}_${actionName}".
@donmccurdy
Copy link
Contributor

donmccurdy commented Nov 8, 2017

@cdata thanks! Will test this out later when I have a chance.

FWIW as a reference, the Kupoman exporter has solved the "undesired results" by giving options to determine which Actions are exported for which objects:

1_zk4zyz4uwrjttv_c92cq1q

^That feature has been working well for me there, although there are other aspects of this exporter that I depend on.

@cdata
Copy link
Author

cdata commented Nov 8, 2017

👍 user configurability seems like a reasonable approach to this problem. Unfortunately, I don't have the time to adapt this patch right now.

@donmccurdy
Copy link
Contributor

Hm, I think this is behaving differently than I'd expected. Starting from this source model:

TwoAnimCharacter.blend.zip

There is one mesh with three Actions, and I'm not using the NLA editor at all. On export, I get only the active Action. Ideally all three would be exported, even if not all are active. My full workflow is described here.

@Usnul
Copy link
Contributor

Usnul commented Dec 10, 2017

I wonder, why are there 2 exporters, @donmccurdy you clearly seem to endorse https://github.com/Kupoman/blendergltf
More of a point of curiosity. Also, I was looking through the code thinking "alright, I got this, just a small change, no sweat" but there's virtually no documentation in code. I appreciate that this is an open source project, but it doesn't look like it's intended to be worked on by anyone else other than the original author. Here's an example of curious logic:

    for blender_object in filtered_objects:
        node_index = get_node_index(glTF, blender_object.name)
        
        node = nodes[node_index]
        
        #
        
        if export_settings['gltf_skins']:
            blender_armature = blender_object.find_armature()
            if blender_armature is not None:
                index_offset = 0
                
                if blender_object in blender_armature.children:
                    index_offset = blender_armature.children.index(blender_object)
                else:
                    index_local_offset = 0
                    
                    for blender_check_object in filtered_objects:
                        blender_check_armature = blender_check_object.find_armature()
                        if blender_check_armature == blender_armature:
                            index_local_offset += 1
                            
                        if blender_object == blender_check_object:
                            index_local_offset -= 1
                            break
                    
                    index_offset = len(blender_armature.children) + index_local_offset
                
                node['skin'] = get_skin_index(glTF, blender_armature.name, index_offset)
  • what's a "blender_object"
  • what is "node_index"
  • what's "index_offset" and how is it different from "index_local_offset"?
  • what's "blender_check_object"?

sorry for the off-topic part. It's just, looking at the proposed change I couldn't help but feel it was written by someone with similarly puzzled perspective as myself.

@donmccurdy
Copy link
Contributor

I wonder, why are there 2 exporters, @donmccurdy you clearly seem to endorse https://github.com/Kupoman/blendergltf

Not meant as an endorsement; just that the Kupoman/blendergltf supports export of multiple animations, which is a key feature that is currently missing from KhronosGroup/glTF-Blender-Exporter. I typically use KhronosGroup/glTF-Blender-Exporter.

@Usnul
Copy link
Contributor

Usnul commented Dec 10, 2017

thanks for clarification @donmccurdy

I'll work on this part, my python is quite poor though.

[18/12/2017] update:
Currently i no longer have time to continue work on this, here's a proposal that came out of my time spent with the code:
#131

@UX3D-nopper
Copy link
Contributor

Please provide non-hacky version.

@cdata
Copy link
Author

cdata commented Jan 24, 2018

@UX3D-nopper is there an actual issue describing the feature somewhere? As far as I can tell, the use cases are scattered across a number of bug reports. I will happily pursue a non-hacky iteration if such a thing is described somewhere.

@motorsep
Copy link

Here is a video showing me exporting from Blender and importing into UE4 (so that export/import settings are known).

https://www.youtube.com/watch?v=tHbaQeopVTM

I am not sure what you mean by non-hacky version. Scene was setup in Blender 2.79 official release and represents classic workflow of an animator (one anim per Action), FBX exporter is Blender's official and FBX output hasn't been fiddled with. Everything is out of the box, so to speak.

ZIP file contains FBX and .blend files:

FBX_multi_anim_export_sample.zip

@motorsep
Copy link

Oops, sorry, I thought I was posting into my issue #150 :/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants