Mog

  • 7 févr. 2022
  • Inscrit 13 avr. 2013
  • Hello And thanks a lot for you replay.

    Indeed it seems that using mask in spine isn't a good solution in this case and I should look into using unity masking tool for this.

    I'm posting the stats just for the record :

  • Hello

    On one of our character we are using a clipping mask to hide him inside the ground.
    I noticed a huge FPS drop when this anim is playing.

    I'm looking for advises on how we can optimize this :


    The build of this character is pretty heavy with a couples of bones and skins.

    Thanks

    • Modifié

    yes you are correct

    So

    I was preparing a small project, and re-exported the model inside it, saw that the problem wasn't present.

    So I decided to to a re-export on my main project, it didn't change anything ( I usually just erase the existing data directly ), I decided to remove all the file of this spine model and re-export everything again, and the problem went away !

    I did diff all the file just to check what went wrong, and here is the only sensible difference I saw was in SkeletonDataAsset:

    https://imgur.com/rsP09L7

    Not sure how the file ended up in that state, maybe it happened when I updated spine a while ago.

    Case is closed on my side but I'm answer just in case this info can be useful for you guys.

    Thanks

    • Modifié

    Hello

    I'm using unity 2020 with builtinRP

    I'm trying to wrap my head about a problem I have on one of my character and seem to only happen in build ( not in editor)

    Here it what it's supposed to look like :

    https://drive.google.com/file/d/1a04kf3UwH1afpco_70VHJfZZCVqsNJ4F/view?usp=sharing

    Here is what happen in build :

    https://drive.google.com/file/d/1s7A0g67l10zVQKKSD8e_bsv2h4Uee1-i/view?usp=sharing

    This character use two materials : skeleton and skeleton additive.

    Also I noticed that this character seems to have a pretty huge material list at runtime :

    https://imgur.com/cIgxlTh

    Probably because it has lots of additive bits that break the batch ?

    Thanks !

  • I see that makes sense, work like a charm, thanks !

    • Modifié
  • Hello

    I'm would like to know if it's possible to apply some offset and change the scale of the bones of a animated skeleton at runtime , here is what I do at the moment :

    I use this callback in order to apply scale / offset to selected bones

    m_Skeleton.UpdateLocal += Skeleton_UpdateLocal;

    by using the following (m_Bones is an array of ):

    position =  m_Bones[boneIndex].m_Bone.GetLocalPosition();
    m_Bones[boneIndex].m_Bone.SetLocalPosition( position + offset );
    m_Bones[boneIndex].m_Bone.ScaleX = xvalue;
    m_Bones[boneIndex].m_Bone.ScaleY = yvalue;
    

    I thought the bone value will just be reset everytime UpdateLocal is called but that doesn't seem to be the case.

    So just applying adding scale will just accumulate it.
    Same for the position it looks like the offset will just accumulate by doing this.

    Any advice on how I could achieve this ?

    Thanks a lot.

  • Hi thanks for your answer, I found my problem :

    I was doing something like this :

    m_OriginalMat = GetComponent<MeshRenderer>().material;

    now am directy referencing the material as a public properties and this script works.

    Hello

    I'm having some trouble with materal swapping on my skeletons

    I have several skeleton that have an original material and a copy of this material which is using a different shader ( the awesome skeleton-greyscale shader provider by esoteric ).

    From the research I did, this is how I should swap materials in skeleton :

    //Greyscale on
    m_Controller.Skeleton.CustomMaterialOverride.Add(m_OriginalMat, m_GrayScaleMat);
    
    //Greyscale off
    Skeleton.CustomMaterialOverride.Clear();
    

    however this doesn't have any effect on my visual and material remain the original one :

    I tried doing the following thing instead :

    //on
    Skeleton.Renderer.sharedMaterial = m_GrayScaleMat;
    
    //off
    Skeleton.Renderer.sharedMaterial = m_OriginalMat;
    

    this actually works but not on all objects strangely.

    maybe I'm missing something, could you please shed some light on me 🙂

    • Modifié

    Thanks, it helped me sorting it out 🙂

    • Modifié

    Hello

    I'm a bit confused with the usage of tint black , in spine I set a tint:black and I get the expcted result on my model :


    However in unity it doesn't seem to do anything, I tried to change the shader from skeleton to skeleton tint:back but then it just erase all the color for all the animations.

    I'm not sure if I did use it properly, tips are welcome 🙂

    Mitch a écrit

    Yes. See Skeleton Utility and Submesh Separators.

    Hi there

    I'm having some issue getting this to work :

    I selected the submesh I wanted to generate under the advanced tab then I used the skeleton utility to generate the submesh it successfully created the submesh under my spine model hierarchy, however when I attach an object to those submesh in the hierarchy it doesn't move along with them, maybe that's not the way it's supposed to work ?

    Thanks

  • Mitch a écrit

    Baking is definitely a "Last resort" if you absolutely can't use the Spine Runtimes for something. It generates very large files and is missing many features.

    Ok Thanks for your answer, so basicaly we should not use baking as it is just a way to convert Spine animation into Unity animation and ship without the spine runtime. I guess we can just use the SkeletonAnimator and generate a mecanim animation graph from there instead which seems to be the official way to use spine within Unity.

    I haven't I've used Spine since a long time ago, so sorry if that question has been ask before, I'm exploring all the new feature right now, it looks like it's really well integrated to Unity now 🙂

  • Hi Mitch

    I think artist use it from time to time to generate the mecanim file. What would be the regular way to do it while updating a spine model ?

    Thanks

    • Modifié