Jump to content

esDotDev

Members
  • Content Count

    45
  • Joined

  • Last visited

  • Days Won

    2

Reputation Activity

  1. Like
    esDotDev got a reaction from RunnerPack in SpriterDotNet.Unity   
    Also, one other small but pretty annoying issue, is that whenever the prefab is regenerated, the positioning and scaling info is reset anywhere in the project the prefab is references. 
    I have an archer Game Object, with a nested Spriter Animation, positioned where I'd like him to be within his parent:
    Archer
     --> ArcherSpriter (x = -1.78, y=3.16, scaleX: .85, scaleY: .85)
    Everytime the SCML is reimported, the ArcherSpriter instance resets positioning to 0,0 and scale to 1,1. Any way those could be retained?
    I also added a bit of functionality to UnitySpriterAnimator, in order to allow me to swap sprites at any time, in any animation:
    Dictionary<string, Sprite> swappedSprites = new Dictionary<string, Sprite>(); public void UnswapSprite(string name) { if (swappedSprites.ContainsKey(name)) { swappedSprites.Remove(name); } } public void SwapSprite(string name, Sprite sprite) { swappedSprites[name] = sprite; } Sprite GetSprite(Sprite sprite) { if (swappedSprites.ContainsKey(sprite.name)) { return swappedSprites[sprite.name]; } return sprite; } protected override void ApplySpriteTransform(Sprite sprite, SpriterObject info) { .... renderer.sprite = GetSprite(sprite); .... } This allows me to do fun stuff, like make my character blink randomly, regardless of their animation state.
    spriterAnimator.SwapSprite("eyesOpen", eyesClosedSprite);//Close eyes //Wait 100ms spriterAnimator.UnswapSprite("eyesOpen");//Open Eyes Or, swap his hands randomly, to make it appear as if he's stumming a guitar, regardless of the current animation he's in. (our character can strum guitar while running, standing still, getting hit, etc, and we didn't want to have to bake that in to the animations themselves) 
    //Inside a Coroutine while(true){ spriterAnimator.SwapSprite("chordHand_0", GetRandomChordSprite()); spriterAnimator.SwapSprite("strumHand_0", GetRandomStrumSprite()); yield return WaitForSeconds(tempo); } Doing it this way lets us change the tempo of the strumming to match the music, rather than having it tied to the animation speed.

    This also allows you an easy way to do character maps, without having to define them in Spriter.
  2. Like
    esDotDev got a reaction from JohnnyType in Fighting with "object_" names   
    We're trying to port our animations over to Unity, and I think we're running into some bugs as a result of old version of Spriter.
     
    The problem is only present in some of our very earliest animations. Under the Z-Index column, all the pieces are named "object_00x" to "object_2xx", and each animation has unqiue names. So, our main character has over 200 of these objects defined in his SCML file. For example:
          
    etc...
     
    This breaks the Sprite2Unity importer and Sprite Swapping functionality, as it creates a new child for every single unique name in the z-index column.
     
    If I try and rename the animations, and make them look like this:

     
    Spriter won't allow me to do it. I can fix one animation, but when fixing subsequent anims, Sprite auto renames "head" to "head_000", or "torso" to "torso_000". Next animation, will force me to name it "Head_002", and etc. It simply won't allow me to fix these names within the Editor.
     
    Is there any way you can think of to fix these old SCML files? I can't hand edit it, it's close to 11,000 lines... 
  3. Like
    esDotDev got a reaction from sportrmhcnh in Fighting with "object_" names   
    We're trying to port our animations over to Unity, and I think we're running into some bugs as a result of old version of Spriter.
     
    The problem is only present in some of our very earliest animations. Under the Z-Index column, all the pieces are named "object_00x" to "object_2xx", and each animation has unqiue names. So, our main character has over 200 of these objects defined in his SCML file. For example:
          
    etc...
     
    This breaks the Sprite2Unity importer and Sprite Swapping functionality, as it creates a new child for every single unique name in the z-index column.
     
    If I try and rename the animations, and make them look like this:

     
    Spriter won't allow me to do it. I can fix one animation, but when fixing subsequent anims, Sprite auto renames "head" to "head_000", or "torso" to "torso_000". Next animation, will force me to name it "Head_002", and etc. It simply won't allow me to fix these names within the Editor.
     
    Is there any way you can think of to fix these old SCML files? I can't hand edit it, it's close to 11,000 lines... 
  4. Like
    esDotDev got a reaction from DarrenOl in Fighting with "object_" names   
    We're trying to port our animations over to Unity, and I think we're running into some bugs as a result of old version of Spriter.
     
    The problem is only present in some of our very earliest animations. Under the Z-Index column, all the pieces are named "object_00x" to "object_2xx", and each animation has unqiue names. So, our main character has over 200 of these objects defined in his SCML file. For example:
          
    etc...
     
    This breaks the Sprite2Unity importer and Sprite Swapping functionality, as it creates a new child for every single unique name in the z-index column.
     
    If I try and rename the animations, and make them look like this:

     
    Spriter won't allow me to do it. I can fix one animation, but when fixing subsequent anims, Sprite auto renames "head" to "head_000", or "torso" to "torso_000". Next animation, will force me to name it "Head_002", and etc. It simply won't allow me to fix these names within the Editor.
     
    Is there any way you can think of to fix these old SCML files? I can't hand edit it, it's close to 11,000 lines... 
×
×
  • Create New...