Git Product home page Git Product logo

Comments (17)

sballew avatar sballew commented on July 28, 2024 2

I got it working. I have a fork of unity-aseprite-importer here: https://github.com/sballew/unity-aseprite-importer/blob/master/Editor/AseFileImporter.cs#L104

I have a number of fixes in my fork, including support for secondary textures. I'll look at doing a PR, however I did do a Unity 2020.2 upgrade on the fork.

The approach I took lets the user specify a layer like @secondary(_Emission). This layer then generates a Texture2D for those layer frames, and then assigns it as a secondary texture with the name _Emission. This would work for any name that the user wants to assign.

I also added some layer name shortcuts for common secondary texture names. Right now it's @emission and @normal, which map to @secondary(_Emission) and @secondary(_NormalMap).

from unity-aseprite-importer.

martinhodler avatar martinhodler commented on July 28, 2024 1

I'm working on it right now. I was able to support the sprite editor... there is some work to do that all of it's features work with the importer

from unity-aseprite-importer.

bitblip avatar bitblip commented on July 28, 2024 1

After upgrading 2020 your fork worked like a charm, exactly what I was looking for.

from unity-aseprite-importer.

haywirephoenix avatar haywirephoenix commented on July 28, 2024

I second that, can't figure this out either. For now create a material and set the shader to Sprite-lit-default. You can drag the normal map in there.

from unity-aseprite-importer.

martinhodler avatar martinhodler commented on July 28, 2024

I tried to use the SpriteEditor from Unity to be able to set borders, make changes to the spritesheet and so on but Unity is hiding this editor in their own code which makes this much harder... I will see what I can do.

from unity-aseprite-importer.

johanolofsson avatar johanolofsson commented on July 28, 2024

Hi, im basically doing the same thing for PyxelEdit. Did you ever figure this out?

from unity-aseprite-importer.

martinhodler avatar martinhodler commented on July 28, 2024

yes there is an implementation in the sprite-editor branch. It has still some issues but you can use the sprite package from unity and include the classes you need in your package. I didn't had the time to completely implement it but you should be able to do it. There is a DataProvider for the SecondaryTexture.

from unity-aseprite-importer.

johanolofsson avatar johanolofsson commented on July 28, 2024

Oh awesome, yes I made it work. Was sufficient to simply use the TextureGenerator and provide the right stuff including the secondary textures. Works really well in tilemaps now! Thx for pointing me in the right direction!

from unity-aseprite-importer.

sballew avatar sballew commented on July 28, 2024

@johanolofsson Do you have any code snippets you could share where you use TextureGenerator? Documentation on this is difficult and I have yet to get it working.

I'm trying to find a way to have unity-aseprite-importer detect a metadata layer, like @normal or @emission, and then set it as a secondary texture. No luck yet. @martinhodler Do you have any thoughts on how to approach it?

from unity-aseprite-importer.

johanolofsson avatar johanolofsson commented on July 28, 2024

from unity-aseprite-importer.

johanolofsson avatar johanolofsson commented on July 28, 2024

from unity-aseprite-importer.

sballew avatar sballew commented on July 28, 2024

@johanolofsson Thanks, conceptually it makes sense, but I'm not sure how to actually use TextureGenerator.GenerateTexture. There's no usage documentation on it. Any tips on how to use it in the context of an importer?

from unity-aseprite-importer.

johanolofsson avatar johanolofsson commented on July 28, 2024

Has anyone tried this in 2020.2? It works fine for me in 2020.1.x but in 2020.2 it stops working.

from unity-aseprite-importer.

johanolofsson avatar johanolofsson commented on July 28, 2024

Ok, so the problem seems to be that as of 2020.2 the rendering of sprites will ignore pixels which have alpha=0 in the main texture, regardless of what colors the same pixel has in secondary textures. In my case I had emissive pixels with colors but transparent in main. I fixed it by simply putting a=1 in the main texture where there is emissive. Not a perfect solution but it works. I don't really know why this behavior suddenly appears. Maybe it's some kind of optimization in the URP and if it is in some way configurable. If someone figures it out, pls let me know :)

from unity-aseprite-importer.

KevinRoussel avatar KevinRoussel commented on July 28, 2024

Hello @sballew !
I'm trying to use exactly this feature. I'm using Unity 2020.3 LTS and the fork doesn't work for me, the inspector is broken on .ase files. Do you know if it should be working on this version ?

from unity-aseprite-importer.

bitblip avatar bitblip commented on July 28, 2024

The importer has improved quite a lot. Access to the sprite editor at least now makes it possible to use the importer and access extra layers. I'd still love to see support for special layer names that are written to secondary sprite layers. Something similar to how run, walk and idle tags get special animation treatment.

from unity-aseprite-importer.

CarlisleJonah avatar CarlisleJonah commented on July 28, 2024

I made a fork with secondary texture support for my own personal use. I don't plan to provide support for it but here it is if anyone wants it. Currently working on Unity 2022.1.23f1:
https://github.com/CarlisleJonah/unity-aseprite-importer

Any layer name that begins with @ (except for @Transform which is reserved) will be imported as a secondary texture (with the @ removed).

I haven't added support for Tilesets or Bundled sprite because I don't need them, but it shouldn't be too difficult to see the changes I made to GeneratedSpriteImporter.cs and make similar changes to GeneratedTileImporter.cs and BundledSpriteImporter.cs.

from unity-aseprite-importer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.