Jump to content
FagDragMusic

Avatar mesh body shape resets, breaks Appearance Sliders

Recommended Posts

Posted (edited)

I'm making my second avatar and for this one I decided to implement the bones for the appearance sliders, so that people can customize it more.
I'm not using Avastar, since I don't have the funds for it atm and I want to understand what happens "under the hood". Especially with how odd SL can be sometimes haha
and I'm making everything in Blender 2.8.

I've managed to get the collision bones to work properly, but I've been having a very weird issue with the appearance sliders since the beginning.
Let me illustrate, see the attached screenshots for reference:
When first opening the appearance editor and moving the sliders the mesh changes as expected. In this example I slide the belly size all the way up and the belly grows as it should.
However when I click 'save' and exit the editor the mesh resets to normal and when I open the appearance editor again (or use the collision visual debug) I see that the slider and the bone are still in maximum position. So the change does get saved, but somehow the mesh resets.
BUT it gets more interesting:
When I then slide the belly size back to zero, the bone moves back to that position too but... it actually transforms the mesh along with it as if the mesh was unchanged, thus causing this essentially inverted effect.
When I re-wear the mesh while the belly slider is still set to max, I get the same inversion effect. It's almost as if the mesh is re-worn every time I exit the editor.
This issue is with all the collision bones. The normal bones (mBones) seem to work fine without issues.

So the bones and sliders seem fine, the issue seems to be with the mesh but I have no clue what it could be.
The collision bones in my rig are ones copied from the SL wiki template (Skeleton.Female.blend). I did this so I could copy over all the custom parameters Blender bones need to work with SL, since the armatures were originally made in Maya and that program works with joints instead of bones. I also selected "keep bind info" in the exporter for things to work proper.
Since I copied over the bones from that template I also exported the template and tested it in SL, to check if maybe that had wrong data. No issues though with that mesh.

Anyone got a clue what the issue could be here?

yingproblem1.png

yingproblem2.png

yingproblem3.png

yingproblem4.png

Edited by FagDragMusic
missing tags

Share this post


Link to post
Share on other sites
10 hours ago, FagDragMusic said:

I'm not using Avastar...and I'm making everything in Blender 2.8.

I've managed to get the collision bones to work properly,

I have no idea how to solve your problem.

I just wanted to say that's amazing. ūü§Į

Did you use one of the existing non-Avastar fitted mesh rigs or build your own?

What bones are you weighting your mesh to? (There's a tiny chance this is relevant. Tiny.)

Share this post


Link to post
Share on other sites

It was quite the doozy yeah XD
It's my own rig, but it conforms to the SL specification as far as I'm aware (hierarchy and bone names, plus custom properties).
Only existing bones are weighted, which are the base SL skeleton + Bento tail bones + collision bones for the breasts, belly, butt and lower back.

I did some testing this morning in a separate file so I could mess things up without restraint. I did these things:
1. take the template (Skeleton.Female.blend) rig, scale down and apply scale (my avatar is 4 ft), transfer the armature to my model as well as transfer the weights from the template mesh to mine. This seems to fix the issue.
2.  do the same thing as 1 except the transfer of weights, thus keeping my own weights. This creates the issue again.
3.  do the same thing as 1 except this time auto-generate weights from the template rig instead of transferring them from the template model. This creates the issue again.
4.  Got an hunch that it may be a scaling issue, despite me applying scale in Blender. So as a test I didn't scale the template armature down, instead scaled my model to fit the armature before linking it to the armature, applied scale and lo and behold no issue. Though the model is oddly deformed by the collision bones at default settings, the weird resetting issue isn't there.
5.  But when I go back to my original file, scale that rig up to match the template's size, applied scale, the issue is there again.

It definitely looks like a scaling issue, but I'm left wondering where exactly things go wrong and how I can fix my rig. I don't exactly feel like re-doing everything again (test 1)...
I find it very odd that there's a difference between tests 1 & 2, it almost seems like something is wrong with my weight data? I feel like I'm missing something possibly obvious.
I'd also like to figure this out to prevent such an issue from causing my hair being pulled out again. I like my hair :)

Share this post


Link to post
Share on other sites

I'm impressed you got the collision bones to work. If you used the Skeleton.Female.blend rig, you're getting the custom bone properties for the collision bones, which are necessary, if you're not using Avastar. Even with Avastar and its custom bone properties, the 2.8x versions are still in beta and can have unexpected results.  But your 1. scenario has worked for me too, mostly, though not if I resized the rig, which I'm gonna try.  I added the HANDLE bones that are missing and cribbed the custom settings from avatar_skeleton.xml (found in viewer > Character). 

Share this post


Link to post
Share on other sites
45 minutes ago, Ada Radius said:

I'm impressed you got the collision bones to work. If you used the Skeleton.Female.blend rig, you're getting the custom bone properties for the collision bones, which are necessary, if you're not using Avastar. Even with Avastar and its custom bone properties, the 2.8x versions are still in beta and can have unexpected results.  But your 1. scenario has worked for me too, mostly, though not if I resized the rig, which I'm gonna try.  I added the HANDLE bones that are missing and cribbed the custom settings from avatar_skeleton.xml (found in viewer > Character). 

Yep, that's indeed how I did it. The custom bone properties and selecting "keep bind info" were the key.

I've tried test 1 some more and these were my steps:
- paste in the Skeleton.Female.blend armature + model
- resize the armature + model, apply scale to both
- parent the armature to my model using ctrl-P -> armature deform
- transfer weights from the template model to my model
this seems to work fine in appearance editor.
However:
if instead of parenting the armature (ctrl-P) i change the armature modifier in my model to use the template armature and otherwise do all other steps the same, the problems with the appearance editor are back.

Share this post


Link to post
Share on other sites

Did you also apply the pose as rest pose? I see references to applying scale, but the rest pose is what makes the bind info. You do that in pose mode, ctrl A apply pose as rest pose

  • Like 1

Share this post


Link to post
Share on other sites
19 minutes ago, OptimoMaximo said:

Did you also apply the pose as rest pose? I see references to applying scale, but the rest pose is what makes the bind info. You do that in pose mode, ctrl A apply pose as rest pose

I have tried that before, doesn't seem to make a difference. Any thoughts on when this needs to be applied?

Share this post


Link to post
Share on other sites

Every time you change the shape either via editing bones positions or scale, which is an inherited position change once the scale is being applied. However, scale matrices are very finicky and the bones positions might not really reflect the scale change. 

  • Like 1

Share this post


Link to post
Share on other sites

The other thing that pops up to my mind is the possible wrong orientation of the collision bones. Many of them are actually tilted even though their rotation is zero. It's a setting native to Maya, called "joint orient" , which Blender implements its own way as "bone roll". 

  • Like 1

Share this post


Link to post
Share on other sites
19 hours ago, OptimoMaximo said:

The other thing that pops up to my mind is the possible wrong orientation of the collision bones. Many of them are actually tilted even though their rotation is zero. It's a setting native to Maya, called "joint orient" , which Blender implements its own way as "bone roll". 

I do see various values in "bone roll" yeah, I haven't touched them otherwise though.

Strangely enough I can't seem to repeat test 1 anymore. Anyone else have some results with that? I'm kinda lost atm.

Share this post


Link to post
Share on other sites
Posted (edited)

Just a guess here, but if the bone roll inadvertently has the bone orientation  flipped in comparison to the original joint orientation, its local forward direction might be reversed and therefore the inworld sliders could behave in an inverted fashion. 

Unfortunately i don't use Blender as I am a hard core Maya user now, just the thought of downloading blender gives me an extended skin rash ūü§£

Edited by OptimoMaximo
  • Haha 1

Share this post


Link to post
Share on other sites
Posted (edited)

I found this series of blog posts just now: https://adaradius.com/2020/01/16/blender2-81-dae-export-part1/
I highly suggest reading all three if you are having issues with your Blender rig, like I have. I've skimmed through them and it looks like it delves into the nitty-gritty of the issues involved and manages to solve (some of) them too. I'm definitely going to experiment further with the things suggested in this tread as well as these blog post. Like I said in my first post: I want to know what's going on. Hopefully I can figure out what exactly breaks the appearance editor/bones when scaling. And hopefully this thread will help others whom are struggling as well :)

As for the avatar: thanks to a friends kindness I was able to buy Avastar much earlier, so for this avatar I'm going to use that now. I have quite a few people eagerly awaiting it to be finished, so I don't want to spend too much time debugging SL's weirdness. Plus it looks like Avastar will speed up workflow tremendously so I'm eager to use it.

EDIT: I now have the exact same issue with Avastar, despite following the "tiny/giant avatar" tutorial on the machinimatrix website. Yay... Do appearance sliders simply not work regardless when an armature is resized? I've tried both Blender 2.8 and 2.7 with the appropriate Avastar versions.

Edited by FagDragMusic
new info
  • Thanks 1

Share this post


Link to post
Share on other sites

Okay, I did more tests and desperate tries (haha) and I think I have a solid theory on what exactly happens:
- So the appearance sliders modify the position and scale of the collision bones by a certain amount. Lets say from 0-100%
  This is very easy to observe in Avastar/Blender, since there's no guff in the way (the cBones debug in the SL viewers could be better IMHO)
- This modification value (0-100%) doesn't scale with the armature, because the armature is always required to be scaled at 1,1,1 (hence scale needs to be applied in Blender)
- So when an armature is scaled down to 50%, which is what I require for my avatar, the appearance sliders still modify the scaled down bones as if they were not scaled.
  I observe this in SL as the appearance sliders seem to have a much more extreme effect. After all the mesh is much smaller thus the changes are more drastic.
- Now it does seem the scale works fine, as I do see changes to the mesh even after the weird reset issue happening. However the positions reset when the armature is animated.
  This happens when you exit the appearance editor and the avatar goes out of the pose.

Possible solutions (hopefully I can add more later):
- I understood SL has a system in which it "tags" a collision bone if its position is too far away from the standard position, thus disabling the translation done by sliders.
  If this can be done reliably in a manual manner I could just rely on bone scaling, even if the effects will be a little different.
- Modify the amount of translation (and scaling) the appearance sliders actually do. I wonder if this is defined in the custom properties since I do see translation and scale values defined there?
  Maybe someone knowledgeable about those could pitch in about that.

Share this post


Link to post
Share on other sites
1 hour ago, FagDragMusic said:

Possible solutions (hopefully I can add more later):
- I understood SL has a system in which it "tags" a collision bone if its position is too far away from the standard position, thus disabling the translation done by sliders.
  If this can be done reliably in a manual manner I could just rely on bone scaling, even if the effects will be a little different.
- Modify the amount of translation (and scaling) the appearance sliders actually do. I wonder if this is defined in the custom properties since I do see translation and scale values defined there?
  Maybe someone knowledgeable about those could pitch in about that.

In my experience, it is just best to edit the bones locations into the desired place rather than relying on scale. And of course, upload making sure to tick on the joint position checkbox in the upload window.

  • Like 1

Share this post


Link to post
Share on other sites
11 minutes ago, OptimoMaximo said:

In my experience, it is just best to edit the bones locations into the desired place rather than relying on scale. And of course, upload making sure to tick on the joint position checkbox in the upload window.

Yeah, I've been thinking of editing the joints to "scale" the armature, to see if that somehow changes values to make SL behave, I've read the whole Blender -> Maya matrix difference is.... problematic and has been for a long time now it seems. The joint position box I always tick for avatars with modified armatures such as this one.

Share this post


Link to post
Share on other sites
Posted (edited)
19 hours ago, FagDragMusic said:

Yeah, I've been thinking of editing the joints to "scale" the armature, to see if that somehow changes values to make SL behave, I've read the whole Blender -> Maya matrix difference is.... problematic and has been for a long time now it seems. The joint position box I always tick for avatars with modified armatures such as this one.

Problematic to say the least, yes. The two softwares whole internal architecture is so different, that making a reliable translator/interpreter is very difficult. Avastar does its job really well but there are edge cases that it blatantly can't handle it the right way, for a reason or another. But if blender is heading toward a solid adoption in the industry as it seems, one day things will have to line up. This issue smells of bind pose problems related to scale/position matrices. 

Edited by OptimoMaximo
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

A little update: I haven't been able to fix the issue yet. I've experimented with all the things mentioned in this thread so far but no dice.
I guess I'll just resort to other tricks rather than using the appearance sliders :I
Feel free to suggest something if you have an idea.

My last test was (in a new file) adding an Avastar skeleton (object->add), going into the joint edit mode/workflow and editing the bones to fit my mesh, then save the edits and bind the mesh to the armature. Now, as expected, the appearance sliders in Avastar show up red because the joint positions have been changed and thus the moving of collision bones is disabled... Or at least it should be but not in SL itself, nope :I

Everywhere I read that SL will disable the appearance sliders affecting collision joint position, thus now only affecting scale. But it's not happening in my case?
Perhaps I'm missing something?

Edited by FagDragMusic
Tried a new thing and had another question

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...