• RuntimesUnity
  • Change a mesh attachment texture do not update the shape of the attachment

Good afternoon, I'm working on a project that uses SPINE on a web page and also in a Unity project.

Within the web project, when I finish customizing a character, I take each texture of each attachment and send it to Unity converted to BASE64. On the Unity side, I have a Spine with the same bones and names, and then I decode these textures. With the textures already transformed into sprites, I use the GetRemmapedClone() method for each part of the skeleton and replace the texture.

However, I'm facing issues when I do this for a MeshAttachment. The texture is replaced, but the image ends up appearing cropped (as it preserves the format of the previous texture). Is there a way to update the mesh attachment so that its format respects the loaded texture?

If that's not possible, do you have any suggestions on how I can replicate a series of attachments that were chosen on the web page within Unity? (I need to make the Unity project work generically for any version of our web page that uses different attachments. Essentially, we have thematic sites, and I want to avoid updating the Unity project if a new style is released for the site – a new style meaning the removal and addition of attachments in the SPINE of the web page.)

Thank you for your attention

  • Harald đã trả lời bài viết này.
    Related Discussions
    ...

    PedroRossa The texture is replaced, but the image ends up appearing cropped (as it preserves the format of the previous texture).
    [...]
    Is there a way to update the mesh attachment so that its format respects the loaded texture?

    I'm afraid your description is too vague to be able to determine the problem. What exactly do you mean by "preserves the format of the previous texture", and what by "so that its format respects the loaded texture"?

    Which method parameters did you use to replace your attachment?

    What is the image size of the original attachment image, what size is the replacement texture? Could you please share some screenshots that show your skeleton before and after replacing the attachment which is looking wrong? It would be best to show the scene view in shaded wireframe mode, so that the mesh is visible. Could you perhaps share your attachment images here on the forum, or even better send us a minimal Unity project that shows your issue? You can send it to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context.

    Please note that the attachment sizes of your original Spine project matter before whitespace stripping might reduce the size by cropping the transparent border.