Add support for gltf morph names.#1100
Conversation
|
What's holding up the revert of the format changes? |
|
@stephengold I am home from work right now, but right now I am getting caught up on chores from being gone. |
|
@stephengold Note that this PR is in no way complete anyway. The final version probably won't even have any changes to Geometry.java at all. This was a "request for comment" and so my understanding was that it was only a partial start. Probably would have been better done as a fork until ready to be a PR but whatever. |
|
Yes, there are several things that will change here. I just wanted to know where to make the changes and if they were acceptable to make. The logic behind the named shape keys will be moved to the Mesh class, and I need to update this branch with the finished changes to the gltf plugin, and the formatting changes reverted. |
|
@stephengold @pspeed42 Thanks, EDIT: Please see my comment on the hub: https://hub.jmonkeyengine.org/t/feedback-requested-pr-for-shapekey-name-support/41892/17 |
|
I looked this over, and I don't see any major issues, just minor ones with English grammar and formatting. @pspeed42, do you plan to review this PR? |
|
I would like to review it... as soon as I figure out what it's for. :) I've never used morph names before so I have a learning curve. |
| * Morphs without names will be null | ||
| * @return an array | ||
| */ | ||
| public String[] getMorphTargetNames() { |
There was a problem hiding this comment.
Not sure why getMorphTargetNames() is needed?
We can already access morph names using getMorphTargets().
|
What about replacing this block inside with this one and this inside with this one? |
|
@Ali-RS I do not think it would be a good idea to add a
|
|
@Ali-RS so after thinking it over I did go with your recommendation. I think in the future as we get more support for shape key names, it would be good to move away from storing morph shapes as an array and move to an hashmap, but for now, as the implementation stands, and probably will stand for some time, it is the best approach to just keep is as an array and make it as easy as possible to use in that form. I think all the final changes are done, thoughts? |
|
@Ali-RS thanks for the catch on those. (I was working on it late last night 😪 ) |
|
Sorry to be picky, but do not you think method I would prefer to remove it, I might be wrong anyway ;) |
|
Yeah, seems unnecessary to me. I'm not sure I understand why Geometry needs to know about morph names since it's a mesh thing. |
|
@Ali-RS @pspeed42 EDIT: What probably should happen is we deprecate EDIT 2: Well, it looks that |
|
Yes, the morph states are the states of the morphs... which is geometry-specific. That's why the array returned is empty... it's for putting values into. At least that's my understanding. |
|
OK, |
|
Changes look good to me, I guess it's ready to be merged, let's leave it open for a few more days in case someone else wants to review it. |
|
I'm kind of clueless. Can someone describe how this would be used in practice? If it's already been explained then just pointing me to it would be fine. Thanks. |
|
@pspeed42 An example would also be if someone added a new morph to a model, they would have to repeat the process of figuring out which morph is which in JME, but now they can just access them all by their names. I hope that clears it up for you |
|
To add on what tlf30 said, my understanding is, in JME morph state/weight can be modified in two ways. I think the aim of this PR is to facilitate manual modification of morph weights. |
|
Thanks, guys. |
OK, so I am putting a RFC (Request For Comments) here to get some feedback.
glTF-Blender-IO just added support for shapekey names (names on mesh morphs) to the import/export in blender. (Info found here: KhronosGroup/glTF-Blender-IO#362)
Seeing as mesh morphs are becoming a more popular feature, I think it would be nice if we had a way to facilitate them. I have made some changes and added glTF support for mesh morph names. This is a rough work in progress, but I wanted some feedback on the core jme changes here to see what everyone thinks.
PS: Sorry in advance about the Geometry formatting changes, those will be reverted before the final revision of the PR.