Custom IPackerPolicy cannot make use of SpritePackingRotation.Any

5.2 has introduced a massively needed improvement to the Sprite Packer which is allowing rotation of sprites when packing them.

It works great with the provided “TightRotateEnableSpritePackerPolicy” but Unity is still forcing a max size of 2048x2048 for some crazy reason, so we are forced to use a custom policy that bumps this up to 4092x4092…

The problem is that passing a value of SpritePackingRotation.Any into PackerJob.AssignToAtlas gets ignored any treated as though you used SpritePackingRotation.None

This means that sprite packing rotation is completely unusable for a large portion of people that need it.

Posted this pretty late last night. Bumping for visibility.

Figured it out.

entry.settings.enableRotation = true; is required for packing rotation to be used. (where “settings” it an instance of AtlasSettings). Eventually this gets passed in to PackerJob.AddAtlas using LINQ sorcery (if you use the Unity template)

PackerJob.AssignToAtlas() has a fourth parameter that can take SpritePackingRotation.Any, but should be ignored (at least for now) since it does nothing. Rotation will be done even if you pass SpritePackingRotation.None

Can you please explain how you used a custom policy?

This page here in unity

shows that Sprite packer can have custom policies

When I try to create the DefaultTexturePackerPolicy from the page I get

Assets/SpritePacker/DefaultTexturePackerPolicySample.cs(8,14): error CS0535: DefaultPackerPolicySample’ does not implement interface member UnityEditor.Sprites.IPackerPolicy.AllowSequentialPacking.get’

Is there an alternative way to do it?

I need to increase it from 2048×20148 to 4096×4096

Thank you