Skip to content

Set morphtarget names from mesh extras, to better support models exported from Blender.#70

Closed
emperorofmars wants to merge 0 commit intoprefrontalcortex:devfrom
emperorofmars:master
Closed

Set morphtarget names from mesh extras, to better support models exported from Blender.#70
emperorofmars wants to merge 0 commit intoprefrontalcortex:devfrom
emperorofmars:master

Conversation

@emperorofmars
Copy link

Blender exports morphtarget names not into mesh primitives extras, but into mesh extras.
Added code to read the mesh extras field after deserialisation and get the TargetNames.
The TargetNames are then added to each mesh privitive.

In GLTFSceneImporter.cs at line 1975 the TargetNames are then read from the mesh's first mesh primitive.

The way i've implemented it will not 'consume' the extras data, like its currently done for mesh primitives in MeshPrimitive.cs. Maybe that should be adapted as well.

@hybridherbst
Copy link

Thanks! Could you rebase on dev please?

@emperorofmars emperorofmars changed the base branch from master to dev January 27, 2023 14:20
@emperorofmars
Copy link
Author

@hybridherbst done, i retested that it still works.

@hybridherbst
Copy link

Thanks! Looks good. I merged the PR.

It would be great if you could check (and potentially make a small follow-up PR) to guard against the targetNames list being a different length than the actual target count, similar to https://github.com/mrdoob/three.js/blob/d45acc1dad2fce10c6fb496b9466de98d9042ab0/examples/jsm/loaders/GLTFLoader.js#LL2245C8-L2245C8

Thanks!

@emperorofmars
Copy link
Author

Awesome!
I'll look into it hopefully this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants