- Home /
Body Mask feature broken in 4.1.2?
Hi.
I am having a weird problem with Body Masks in the model/animation import settings. I open the 'Body Mask' arrow, it shows the mask, and everything is selected. I try to deselect ex. the head, but it won't let me apply the settings.
Is there a workaround? Perhaps I can set the Body Mask through script?
EDIT:
I have included a screenshot below, to help the understanding of the issue.

Answer by ottolb · Apr 16, 2013 at 08:32 PM
Yeah, I had the same issue. I solve doing this:
1 - Create a Avatar Mask. Assets->Create->Avatar Mask
2 - Setup as you like.
3 - Open that .mask file as text.
4 - Find a line like: m_Mask: 0100000000000000010000000100000001000000000000000
5 - Copy that bunch of 0 and 1
6 - Open the FBX meta file as text find the 'bodyMask:' and replace it.
7 - Save and that's it.
I cannot open the .mask file as text correctly. I don't see the numbers, etc.. $$anonymous$$ay I ask which text editor you used?
I used mac default text editor, you can't just drag 'n drop into it. You need to open manually.
Sounds interesting, but inside the .mask.meta file, this is all I see:
fileFormatVersion: 2 guid: 006bd53670a9e4dd8ba42f7c75a4a493 NativeFormatImporter: userData:
The .mask file is fully unreadable.
Thank you - I just had to force meta files to text, quit Unity, do as you said and re-open. Thanks!
I use windows 7 and I can't open the .mask file properly. I can't see the numbers. :(
$$anonymous$$ay I ask how did u manage to open the file?
I hope Unity fix this serious bug in the next version.
Answer by BrutalMax · Jun 08, 2013 at 07:26 AM
it seems that bodymasks are broken making mecanim layers useless.
Sorry but you are wrong: I'm using bodymasks and layers intensively in my game. However, you must use bodymasks PER LAYERS, not per animations. If you want some animations to only affect the upper body, you have to create a bodymask in your assets specifying wich parts will be affected and then assign this bodymask to a new layer in the animator editor and put your animations in it. $$anonymous$$ixing whole body animations with body masked animations IN THE SA$$anonymous$$E layer however is broken. You will have to use layers and a bit o creativity for avoiding this issue.
dude no matter what i tried; the bodymasks feature (in the animator's layers of course) doesn't work. it's like they're being ignored. i did the character modeling, skining and animations myself using 3dsmax.
by default, when you run your game all layer weight values will be zero. You need to set it to 1 in order to activate it (0.5 would make it mix with the underneath layers by 50%, 1.0 would be 100%) If you want to fade in and fade out that layer, you will have to handle it manually by increasing and decreasing the layer weight property. Every animator layer has it's own weight, so if you want all of them to be active at the same time, you will have to set every layer,s weight property to 1 for them to be active. I think about it as an audio mixer, with every layer being an audio source: you will have to fade-in and fade-out every layer to make them into the mix.
but how? the weight scrollbar is disabled. how can i enable it? do i have to use code for that? and if so; can you add an example?
i've added this code to the character object:
void Start () {
Animator animator = GetComponent();
Debug.LogError(animator.GetLayerName(1));
animator.SetLayerWeight(1,1);
Debug.LogError(animator.GetLayerWeight(1));
}
but unity just kept ignoring the mask, letting the animation in the second layer completely override the first.
It's very frustrating because I'm trying to solve this problem for months now!
Answer by atomicjoe · May 24, 2013 at 11:57 PM
Sadly, even forcing unity to use a body mask per animation using the method above, it's still broken if you try to use those animations in a mecanim layer. In my case I wanted to have some upper body animations only in a layer without a body mask. Using this method, unity will just make a mess of the masked parts of the character during animation. It seems bodymasks per animation isn't supported anymore. Unity 4.1.3
edited: bodymasks are broken only in a PER ANIMATION BASE. If you eant to use bodymasks, create a new one in your assets (right click, new bodymask) , create a new layer in the animator (mecanim) view, assign this bodymask you just creatd TO THE WHOLE LAYER and then put your animatons in this layer.
it doesn't work.. bodymasks (on the layers level) remains broken.
I'm using Unity 4.1.3 and body masks on layers and all working fine ..
Answer by Ardivaba · Jun 10, 2013 at 05:49 AM
Uhm, why don't you just disable and enable some other options there and then apply modified body mask? Works perfectly for me, you just need to enable the Apply button by changing other settings, body mask settings will stick after you press apply.
I already checked this, but has rechecked it right now and bodymask is just reseted to the default as soon as I change anything. Wich version of unity are you running? (slightly lower versions didn't have this bug) Unity 4.1.3f3 here
Your answer
Follow this Question
Related Questions
Mecanim - Body Mask specific bones ( Body Mask for the spine not the hips ) 1 Answer
Bizarre non-responsive button/Mecanim issues 1 Answer
Mecanim animation layers with a body mask kills the base animation? 1 Answer
TPS using Mecanim 0 Answers
How to maintain FIFO in Animator controller when you set multiple parameter in one frame ? 0 Answers