Atlas Editor


This package is just simple atlas editor.
You can create new, modify existing atlases. The output of this tool will be new Texture2D with all source images and metadata object with new image uv coordinates.
Also this utility can do alpha trimming - cut empty stipres(alpha=0) on an image border
To create new atlas Just drag’n’drop images from inspector, align and save.

Asset Store
Project home
Documentation
git
last version

package released under BSD license.
asset store art by gekatarina

p.s. And yes, you can use it for making atlases for 3d objects also (2d planes on all of screenshots is a 3d objects as well (with 4 vertexes and 2 triangles) )

I’m far from a fan of atlases and all their associated complications (at least for most sprite managers out there), but I have to admit this is very cool and handy, Nicloay. Congratulations :slight_smile:

thanks MaDDoX

package has approved at asset store.

I somewhat agree. Although Unity does have draw-call issues that come into effect when you want lots of smaller objects, e.g. sprites/tiles etc, which makes it a problem for 2D mainly (but also 3D sometimes), the user shouldn’t really have to mess with assembling or building the sprite sheet nor making it work ie using it to create objects. Unfortunately no tool has nailed this yet. Still it looks as good as any existing solution for dealing with this.

It looks great.

Is it open source?

yes, it’s open source, as specified in first post it available here http://git.nicloay.com/atlaseditor ,
Released under BSD license, which means that you can even use it in your own asset plugin more details here BSD licenses - Wikipedia

Ca you make it compatible with unity 3.5? Can’t download with that one, perhaps you can upload the asset with this unity version to the store and it will work on 3.5.

Hi Lars, before i’ll do that could you try to import this plugin from source.

  • Go to git home page here http://git.nicloay.com/atlaseditor
  • In the right column you will find widget and zip link to latest source
    1136556--42959--$Screen Shot 2013-01-15 at 7.40.22 AM.png
  • extrac this archive
  • create new project
  • copy part of extracted files to your project assets folder (this code for MacOS terminal, in windows you can do that through windows navigator, drag and drop Assets/UFTAtlasEditor from archive to your project assets folder)
cp -R $EXTRACTED_ARCHIVE/Assets/UFTAtlasEditor $YOUR_UNITY_PROJECT_HOME/Assets/

after this steps you will se “UFT Atlas Editor” in “Window” menu.
If you will get any errors in unity console, post it here and I will try to help.

Works great on unity 3.5, although I failed to open demos. (I get error when I import graffiti.asset file…)

However, when I made an atlas from the scratch, it worked perfect.

Thanks for such a great job!

Jinman Chang Thanks for sharing info about 3.5,

Probably demo scenes from source in 3.5 doesn’t work because metadata is scriptable objects built on 4 version so probably it’s not compatible with 3.5

Any chance to make it 3.5 compatible? :slight_smile:

I am da bawss , You can take this package from sources, as i described in this message. Just one issue that demo scene doesn’t work.

and AtlasMigrationTool (starting from version 1.1) is not compatible with 3.* version as well. because it use ShaderUtil class.

I’ve just updated package on my git repository

You can download it here atlasEditor.v1.1_alfa.unitypackage

changeList:

  • AtlasMigration tool
  • atlas texture background color in unity4 changed to transparent

With atlasMigration you can update atlas, save it with different name and then update all objects on scene.
This utility will find properties in your object, and if it has type UFTAtlasMetadata or UFTAtlasEntryMetadata and their pointed to old atlas it will change links to new one (by source texture path), and also update materials.

here is how it looks like

Hello,

Maybe have you forgotten to include ShaderUtils.cs?

Oh, I see is a unity class, I don’t know why it fail.

ShaderUtil is an unity3d class, as WhyDoIdoIt mentioned in this topic it has been opened only in 4.1 version of unity, before this version this class was available only through reflection.

Please let me know if problem is not in a unity version and describe the steps, how to reproduce this error, I’ll try to help you.

Thanks for your answer. Yes, it’s a version problem, I am using 4.01 version.

dear all:
Is the Altas textures can called by ONGUI() ?
if it can be,please tell me how to do this.

And, is the type of normal bump can editor to altas textures?

sorry, my English is not good.
thx very mouch.
:stuck_out_tongue:

hi great tool, i asked for something like NGUI but for atlases last year. great to see someone have a go at it as my coding abilities aren’t the best.

anyway a couple things i noticed when playing with it on the mac version.

the auto tile option seems to be a bit buggy and sometimes places images on top of each other or to far away but not really an issue.

one thing i would love to see in this is a zoom tool for the atlas as like i said the auto tile isnt working very well for me so could be nice to zoom out to see larger images.

next thing to do is make it work with tillable textures haha, no complaints though awsome addition to unity

Hi, thanks for your work !

Is your asset able to give uv values of specific sub textures ? I would like to set it to specific face (I know mesh.uv indexes) of a big mesh.

K

yaosheng22 Yes, it’s possible, but i’m not sure why do you want to do that, anyway you will receive 2 drawcalls for 2 calls of GUI.DrawTextureWithTexCoords methods.

here is c# code which i used (attach this script to any object on your scene and assign atlasMetadata to atlasMeta property)

using UnityEngine;
using System.Collections;
public class GUIShowSprite : MonoBehaviour {
	public UFTAtlasMetadata atlasMeta;
	
	public float timeoutInSec = 1.0f;
	public int offset = 50;
	UFTAtlasEntryMetadata spriteMeta1;
	UFTAtlasEntryMetadata spriteMeta2;
	Rect positionRect1;
	Rect positionRect2;
	float counter;
	
	void Start(){
		initNewSprites();
	}
	
	void FixedUpdate(){
		counter+=Time.deltaTime;
		if (counter>timeoutInSec)
			initNewSprites();
	}


	void initNewSprites()
	{
		counter = 0;		
		initRandomSpriteAndPosition(ref spriteMeta1,ref positionRect1);
		initRandomSpriteAndPosition(ref spriteMeta2,ref positionRect2, false);
	}
	
	void initRandomSpriteAndPosition(ref UFTAtlasEntryMetadata spriteMeta, ref Rect positionRect, bool alignToplef=true){
		int id=Random.Range(0,atlasMeta.entries.Length-1);
		spriteMeta = atlasMeta.entries[id];
		if (alignToplef){
			positionRect = new Rect(offset,
									offset,
									spriteMeta.pixelRect.width,
									spriteMeta.pixelRect.height);
		}  else {
			positionRect = new Rect(Screen.width  - spriteMeta.pixelRect.width - offset,
									Screen.height - spriteMeta.pixelRect.height - offset,
									spriteMeta.pixelRect.width,
									spriteMeta.pixelRect.height);
		}
	}
	
	
	// Update is called once per frame
	void OnGUI () {
		GUI.DrawTextureWithTexCoords(positionRect1,atlasMeta.texture,spriteMeta1.uvRect);
		GUI.DrawTextureWithTexCoords(positionRect2,atlasMeta.texture,spriteMeta2.uvRect);
		
	}
}