facebookincubator / FBX2glTF

A command-line tool for the conversion of 3D model assets on the FBX file format to the glTF file format.
Other
2.1k stars 332 forks source link

Blend shape keys to accessor names #122

Closed ox closed 6 years ago

ox commented 6 years ago

This diff stores BlendShape key names in FbxBlendShapesAccess and RawBlendChannel, and names the accessor that is created for the input/output of that morph target in glTF.

closes #120

ox commented 6 years ago

@zellski does this PR look ok? I got put the printf behind a verbose flag. I think it's useful to make sure that the blendshapes are being found on the fbx model.

zellski commented 6 years ago

Hey @ox! I will give it a whirl this weekend, and probably merge it then. I'm afraid I committed some pretty dramatic file-moving changes, though. Would you be willing to rebase this PR so it merges cleanly? Sorry!

ox commented 6 years ago

Yea I’ll take a look at the rebase on Tuesday


From: Pär Winzell notifications@github.com Sent: Friday, September 14, 2018 12:47:38 PM To: facebookincubator/FBX2glTF Cc: Artem Titoulenko; Mention Subject: Re: [facebookincubator/FBX2glTF] Blend shape keys to accessor names (#122)

Hey @oxhttps://github.com/ox! I will give it a whirl this weekend, and probably merge it then. I'm afraid I committed some pretty dramatic file-moving changes, though. Would you be willing to rebase this PR so it merges cleanly? Sorry!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/facebookincubator/FBX2glTF/pull/122#issuecomment-421417983, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAGUediNT6OZ03jscw6ncAnMqs4h08L3ks5ua92qgaJpZM4Wjn8r.

ox commented 6 years ago

@zellski I rebased the PR against master (there was quite a bit of refactoring, huh). Does it look fine now?

ox commented 6 years ago

@zellski can you take a look at this again?

ox commented 6 years ago

@zellski awesome! Thank you! When can I expect this to be available over npm?

zellski commented 6 years ago

I really need to get a release out. I have to finish this refactor first though, and do some testing to make sure I didn't break anything. I'll try to hurry. :-)

ehs035 commented 5 years ago

Any updates on this? I'm loosing my blend shape key names after export to glTF. It works fine if I use the glTF-Blender-Exporter plugin.

zellski commented 5 years ago

@ehs035 This was merged, so if you compile from master it should be in there. I'm still working my way to a 0.9.6 release, but I ended up changing a ton of things on the way.

zellski commented 5 years ago

You might also try some of the more recent bleeding-edge builds: https://dev.azure.com/parwinzell/FBX2glTF/_build?definitionId=1

ehs035 commented 5 years ago

Thanks Pär. I hope this is the same issue as: https://github.com/facebookincubator/FBX2glTF/issues/177 I will let you know if this solves my problem. Again thanks for your fast response.

ehs035 commented 5 years ago

@ehs035 This was merged, so if you compile from master it should be in there. I'm still working my way to a 0.9.6 release, but I ended up changing a ton of things on the way.

@zellski Master branch didn't work. I will try the latest branch after azure is back online.

ehs035 commented 5 years ago

@zellski I tried all the repos and it still doesn't work. I generated a gltf to take a look at the source:

{ "componentType": 5126, "type": "VEC3", "count": 12024, "bufferView": 226, "byteOffset": 0, "min": [ -0.00830205157399178, -0.00209554191678762, -0.00139282224699855 ], "max": [ 0.00832692626863718, 0.00691405776888132, 0.00883682258427143 ], name": "Mouth_Smile" },

The morph target has a name but when I load this with GLTF loader from THREEJS the name is not there.

image

Doesn't the GLTF loader uses the extras property to set the names? image

Here is a sample created with the blender exporter and it works: "meshes": [ { "extras": { "targetNames": [ "Tongue_Out", "Tongue_Curl-U", "Tongue_Narrow", "Tongue_Lower", "Tongue_Raise", "Tongue_Curl-D", "Tongue_up" ] }, "name": "CC_Base_Tongue", "primitives": [ ] } And here is the sample from the fbx2gltf converter: "meshes": [ { "name": "CC_Base_Tongue", "primitives": [ ]

}

zellski commented 5 years ago

@ehs035 Oh, I see. As you likely know, 'extras' aren't part of any glTF spec. You can just toss stuff in there, and if you're lucky someone will be able to read it. I see now that support was added for this rather informal feature in the three.js GLTFLoader in https://github.com/mrdoob/three.js/pull/13367, based on discussion in https://github.com/KhronosGroup/glTF/issues/1036 where Blender kicked things off.

So:

I'll take a look at adding it ASAP. Just beware that this is neither core glTF nor a formal extension and it will likely not work in almost any other glTF loader.

ehs035 commented 5 years ago

@ehs035 Oh, I see. As you likely know, 'extras' aren't part of any glTF spec. You can just toss stuff in there, and if you're lucky someone will be able to read it. I see now that support was added for this rather informal feature in the three.js GLTFLoader in mrdoob/three.js#13367, based on discussion in KhronosGroup/glTF#1036 where Blender kicked things off.

So:

  • There is no current support for this in FBX2glTF.
  • However, it should be quite easy to add, and Blender is always worth following.

I'll take a look at adding it ASAP. Just beware that this is neither core glTF nor a formal extension and it will likely not work in almost any other glTF loader.

@zellski Thanks again for your fast response. Let me know if I can help with testing it. I totally agree that extras is not the right place to put it. But the only solution for me until there is another generic way to expose these names. There is discussion about this going on since 2017 https://github.com/KhronosGroup/glTF/issues/1036