Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
138 stars 2 forks source link

Automatically adjust available blendshape list when skinned mesh renderer mesh changes #872

Closed gentlecolts closed 10 months ago

gentlecolts commented 10 months ago

Is your feature request related to a problem? Please describe.

When changing skinned mesh renderer mesh, blend shape list doesn't update. This makes updating meshes for, for example, avatars, more complex then necessary. Attempting to hit "add blendshape" to update the list is fickle and buggy and, honestly, I'm not sure what the value of having the ability to manually add blend shapes is, when Resonite lacks the functionality to edit them anyways.

Describe the solution you'd like

When the mesh field of skinned mesh renderer changes, update its blendshapes list as well. Ideally, try to update references/drives for shapes that share the same name between meshes if indexes change

Describe alternatives you've considered

the rig transfer tool exists, and seems to do this when it actually works, but is kind of janky in its own right, and i don't always want/need to update the entire set of meshes, just maybe one or two

Additional Context

zangooseoo

JackTheFoxOtter commented 10 months ago

If you want to replace your existing mesh with a newer version, use the RigMeshTransferTool. It has some caveats (#332), but if your source has the same meshes as the target (with only updated data and new blendshapes only inserted at the bottom of the list), it should work.

This doesn't mean your issue is irrelevant, I agree that it should auto-update in the component itself, but this should be a good solution until that fix is implemented.

Edit: Missed that note at the bottom, sorry! My proposed Merge mode should fix your issue with only wanting to update one mesh on an avatar with the tool.

Banane9 commented 10 months ago

If you want to replace your existing mesh with a newer version, use the RigMeshTransferTool.

Tried it once, terrible experience - and as usual, zero documentation or information on it. I'm also not sure what it does, that manually setting the new mesh (and using the add blendshapes button) doesn't do - transfer blendshape drives by name?

JackTheFoxOtter commented 10 months ago

Tried it once, terrible experience - and as usual, zero documentation or information on it.

It has a bunch of issues, but it's almost there. It's just designed for a very specific configuration of source / target objects, it's missing tweaks to be more general.

I'm also not sure what it does, that manually setting the new mesh (and using the add blendshapes button) doesn't do - transfer blendshape drives by name?

Check #332, we did a deep dive into it.

Banane9 commented 10 months ago

Check #332, we did a deep dive into it.

I did read that, but it tells me what it doesn't do (right), not what it does do compared to manually replacing the mesh reference or setting the bone references on a new mesh. It's also not reasonable for users to read a random issue on Github to learn about what a tool ingame does.

JackTheFoxOtter commented 10 months ago

I did read that, but it tells me what it doesn't do (right), not what it does do compared to manually replacing the mesh reference or setting the bone references on a new mesh.

It does that, basically. If you have an avatar with one or more SkinnedMeshRenderers, you can update the avatar using the tool. It copies the mesh over and updates blendshapes while keeping existing drives / references intact.

It's also not reasonable for users to read a random issue on Github to learn about what a tool ingame does.

Then why are you asking / complaining about it here? Once we have #1 users will be able to look up what it does on the wiki.

Banane9 commented 10 months ago

updates blendshapes while keeping existing drives / references intact

I feel like that would be nice to have directly when changing the mesh assigned to a SkinnedMeshRenderer 🤔

Then why are you asking / complaining about it here?

Because we don't have #1 yet and it was relevant to this issue. And it's frustrating when there's tools that would seem helpful to what you want to do, but there's zero information available beyond finding someone who already knows.

JackTheFoxOtter commented 10 months ago

I feel like that would be nice to have directly when changing the mesh assigned to a SkinnedMeshRenderer 🤔

Yes, and that's why this issue exists.

gentlecolts commented 10 months ago

I don't think the current conversation is particularly productive, and would ask that we keep on the main topic.

I think the rig transfer tool is useful but extremely difficult to work with and unreliable, which I why I already gave it explicit callout in the original post. enhancement to the usability/effectiveness of that tool is certainly worthwhile and may benefit from its own tickets, but that doesn't change the point of this post.

As is, I see no reason for the shape key list to not automatically update when the mesh is changed

with that all said, i see no reason why, regardless of alternative options, the blendshape list should not automatically update when the mesh changes. If i did the same thing in blender, change the mesh data block the object points to, the list updates accordingly there, it is expected behavior in industry standard applications

Frooxius commented 10 months ago

What version did you report this on? This functionality was implemented relatively recently, see here:

https://github.com/Yellow-Dog-Man/Resonite-Issues/assets/8838625/4f46e2fe-4edb-4f0b-89bd-603c795ea513

Are you seeing different behavior from this?


For remapping the drives and bones and stuff like that - this is out of scope of simply changing the reference, as that requires more context to operate on. It's what the RigTransferTool is designed for, which will handle all the necessary remapping.

If you're having issues with that tool - please report them, with sample meshes/rigs. I often see people complaining about the tool, but without reports and data on what's going wrong with it, we can't fix it and make it better.

gentlecolts commented 10 months ago

I tried just now and it does indeed fail. I will add that this is a case where the old mesh did not have blendshapes and the new mesh does (blender sometimes fails to export shapes to fbx when certain modifiers are on the mesh)

after placing the new mesh on the old one's slot, I observe two things:

gentlecolts commented 10 months ago

In fact as i keep clicking add, it appears that it's introducing those shapes both to the front and end of the list it seems to insert the duplicate new entries into the middle of the list. Also some shapes end up named strangley, like "name.name", for example, i have a "mwah" shape, but it's displaying as "mwah.mwah" image image

Frooxius commented 10 months ago

Oh I see. I think I know what it is, the list doesn't get new elements added when the mesh changes, so they do not show up. I'll have a look into this when I can, thanks!

gentlecolts commented 10 months ago

list doesn't get new elements added when the mesh changes

That seems to be the case actually. I null'd the mesh and re-applied it and the list seems to have been updated appropriately, removing the doubles (although not expanded). Doesn't change my confusion regarding random shapes getting double named (like "mwah" becoming "mwah.mwah", and what seems to still be incorrect order vs what it is in blender. I re-imported the fbx into blender and blendshape names and order appears to be correct

gentlecolts commented 10 months ago

Also while we're at it, is there a ticket for having a button for removing the N/A blendshapes?

Frooxius commented 10 months ago

The "Add" button isn't really meant to be used like that, it's just an artifact of the UI being based on lists. I might just hide it if it's not too much effort.

The list should update automatically, so there's no need for any buttons.

Frooxius commented 10 months ago

Fix this on 2023.12.13.87! Thanks!