aceex7

  • 3 ago 2021
  • Si è iscritto 2 lug 2017

    you're right! that was the issue
    I ran a script that replaces all of the old spine files with the new ones removing by mistake the SkeletonDataAssets with them, I did it in a test environment so no harm was done,
    consider clarifying in step 6 to not remove the material, atlas, and skeletonDataAsset files when replacing the old files with the new ones

    Thanks for the help! 🙂

    Thank you Harald for the quick response,

    I actually did end up using "Reimport" but it didn't fix up the missing references in the skeletons in my scene
    Is that an expected behavior? is there a way to avoid breaking references to all of the skeletons across my app and resolve it automatically? if not, do you have any recommendations on how to tackle this problem without manually fixing each and every one of the skeletons in my project?

    thanks for the help!

    Hi,

    I went according to the recommended upgrade steps for upgrading from 3.8 to 4.0
    but after importing to the latest spine 4.0 the 4.0 files did not automatically create the atlas, skeletonData and Material files
    and since I have hundreds of spine files I don't want to go manually and fix every single one of them,
    Am I missing a step?

    • Modificato
  • Hi!

    so when my avatar is in the pool area I turn on the attachment of the mask like so

    skel.Skeleton.SetAttachment(slot, slot);

    the issue happens when I change the appearance of the avatar (with different clothes) and therefore repacking the skeleton
    which in turn calls the SetSlotAttachmentsToSetupPose Method
    when that happens I get null on the mask's slot attachmentName

    string attachmentName = slot.data.attachmentName;

    so I've found a workaround by adding the lines 6-7 to the SetSlotAttachmentsToSetupPose method as follows

    public static void SetSlotAttachmentsToSetupPose (this Skeleton skeleton) {
             var slotsItems = skeleton.slots.Items;
             for (int i = 0; i < skeleton.slots.Count; i++) {
                Slot slot = slotsItems[i];
                string attachmentName = slot.data.attachmentName;
              if(attachmentName == null)
                   attachmentName = slot.Attachment?.Name;
    
            slot.Attachment = string.IsNullOrEmpty(attachmentName) ? null : skeleton.GetAttachment(i, attachmentName);
         }
      }

    I can't tell if that's a bug or expected behavior and that I'm missing something?

    Any help and clarifications will be appreciated

    If i don't bake the atlas every time the user switches his equipped items i'll have a big amount of draw calls,
    and since the player can choose from various items there's no sensible way of grouping items together into an atlas as well

    now, about the parallelization, the likelihood of 10 players switching items at once is very low, I predict that 3 players will need to execute the repacking at the same time in the worst case scenario, so maybe parallelization wouldn't be a bad option after all?

    Thank you for the quick response @Harald, i'll be waiting for that.

    @badlogic, my app allows users to customize their avatar with thousands of items with 3 directions for each item, so creating a big atlas with all of these items is out of the question, and if what you're saying is true i might have to think of a different solution to this problem

    Hi, I've Created an avatar system using spine with 15+ slots with many items you can equippe your avatar with,
    it's a multiplayer game with a lot of users which log in and change their equipment every few seconds which causes the avatar to perform a repack of their newly equipped items, every repack with that amount of slots and items freezes the main thread and makes the game really laggy, is there a way to do the repacking part on another thread? maybe using the new job system or something similar? :think:

    • Modificato

    yes i removed that call because in my original question i stated that it goes back to the default white color instead of the yellow color (in the example above)


    Update: I ended up changing the SetSlotsToSetupPose() method so it would fit my needs
    Thanks for the help!

    I am using what you suggested already, is there anything else i'm missing?
    this is my code for repacking

    if (repack)
    {
        repackedSkin = new Skin("repacked skin");
        if (skeleton.Data.FindSkin("repacked skin") != null)
            repackedSkin.Append(skeleton.Data.FindSkin("repacked skin"));
    
    repackedSkin.Append(skeleton.Data.defaultSkin);
    if (customSkin != null)
        repackedSkin.Append(customSkin);
    
    repackedSkin = repackedSkin.GetRepackedSkin("repacked skin", sourceMaterial, out runtimeMaterial,out runtimeAtlas);
    
    skeletonGraphic.OverrideTexture = runtimeAtlas;
    skeleton.SetSkin(repackedSkin);
    }
    else
    {
        skeleton.SetSkin(customSkin);
    }
    
    skeletonGraphic.Update(0);
    
    
    

    you were right Pharan, it had nothing to do with the repack, it had to do with the Skeleton.SetSlotsToSetupPose(), i'm setting a color to certain slots of the character, now that i removed that call for Skeleton.SetSlotsToSetupPose() it works on my SkeletonAnimation, however i have a new issue with my SkeletonGraphic, it looks distorted, see attached

    i have the latest version of 3.6 and the AttachmentTools.cs is similar to the link you've sent me and the problem still exists

    3.6, the latest version, and thank you i'll try that out and keep you updated

    I've created an avatar system using spine and whenever a user decides to add an item to the avatar (shirt, pants, glasses, etc..) it goes through a repack to reduce draw calls but as a side effect the avatar return back to its original color.
    The skin color is originally white so i could change it to whatever color i need via SetColor method, so the problem is that the color resets to white everytime there's a repack (which is very often), after the repack process i usually run a coroutine for a half a second and then paint the true color again which is not ideal since i don't know how long it takes for the repack to finish.
    so my question is, is there an event i can listen to that tells me when the repack has ended or when the material has changed? if not is there another elegant solution to the problem?
    thanks in advance 🙂

    • Modificato