Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

If you have any questions, reports, suggestions, or requests about Live2D, please send them to this forum.
※We cannot guarantee statements or answers from Live2D staff. Thank you for your understanding in advance.
 
Live2D Cubism
Cubism Products and Downloads
Cubism product manuals and tutorials
Cubism Editor Manual    Cubism Editor Tutorial    Cubism SDK Manual    Cubism SDK Tutorial
[INFORMATION](4/11/2024)
Cubism Editor 5.1 alpha2 is now available!

We have incorporated some of your comments and suggestions. Thank you for your comments and requests!
We will continue to welcome your feedback on alpha2.

Download/ Manual and Update History
Options

Reset the mask

Hello,

I have several Live2D prefabs using the same mask texture (actually all models are using the same mask texture, the default one) but I usually have active only 1-3 prefabs at the same time.
I happens that after I destroy a prefab that is using a mask, other models are missing parts (usually eyes) and is seem related to masks because the missing parts reappear after I manually change the mask texture in inspector (I put it to none that put's it back to the default one).

So, my question is, is there anyway to reset the mask content, or I'm doing something wrong when deleting a prefab instance that is leaving the texture mask in a wrong state?

Thank you!
Tagged:

Comments

  • Options
    Actually there are a couple of objects that are not deleted, just disabled, and all share the same masktexture. I suspect those disabled objects somehow affect the masking for other objects, any ideas?
  • Options
    Hello, @c0mas .

    Thank you for your contact.
    This is Live2D Support.

    Perhaps this is due to the fact that the maximum number of masks that can be held by the texture for masks has been exceeded.

    In Cubism SDK for Unity, by default, mask textures are shared by all models.
    The timing when the process to register a model to the mask texture is called is when the model is initialized, and the timing to delete the texture is when the model is destroyed.

    Therefore, even if the model is hidden, the model is still registered in the texture for masking, and depending on the model placed in the Hierarchy, the upper limit of the texture for masking may be exceeded, and the display of the mesh using clipping will be corrupted.

    To resolve this issue, change Start() to OnEnable() and OnDestroy() to OnDisable() in the CubismMaskController class.

    This modification will cause the model to be registered in the texture for the mask when it is displayed and removed when it is hidden.
    Therefore, no matter how many models are placed in the Hierarchy, only the models in the visible state will be registered in the mask texture, and the limit will not be exceeded.
  • Options
    Hi Yasu,

    Thank you for the response, I have tested and I can confirm the fix worked on my side :-)

    Best,
    /COsmin
Sign In or Register to comment.