Comments (17)
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.
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.
After upgrading 2020 your fork worked like a charm, exactly what I was looking for.
from unity-aseprite-importer.
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.
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.
Hi, im basically doing the same thing for PyxelEdit. Did you ever figure this out?
from unity-aseprite-importer.
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.
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.
@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.
from unity-aseprite-importer.
from unity-aseprite-importer.
@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.
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.
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.
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.
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.
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)
- License question HOT 1
- Forked project (Makes it editable) HOT 8
- Missing namespaces in 1.03 version HOT 3
- Ase file incorrect size detected HOT 2
- Problem when changing frame order in Aseprite file HOT 3
- adding package fails HOT 4
- Support for OpenUPM HOT 8
- Meta files are not compatible between versions
- Cannot set borders in sprite from aseprite
- Images on UI requires to check Use Sprite Mesh
- Custom Outline option not working in Bundle version
- Custom Physics Shape not present in Sprite Editor [Bundled]
- Transparency Color sprite property not respected in Indexed color mode
- unity-aseprite-importer generates tons of garbage in RAM
- Export layers as separate sprite sheets.
- tests
- maybe GetParentLayer() has problem
- Blend Logic has problem
- FPS drops to 4 in 3d URP Project
- how to fix these two issues?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unity-aseprite-importer.