[About macOS Sequoia] (Updated October 22, 2024)
Live2D Cubism Editor 5.1.02 now supports macOS Sequoia.
Other Live2D Cubism products currently released are not guaranteed to work on macOS Sequoia.
Please refrain from upgrading macOS, as it may not operate properly.
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!
0 ·
Comments
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.
Thank you for the response, I have tested and I can confirm the fix worked on my side :-)
Best,
/COsmin