A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in '2D Experimental Preview' started by Aygtets, Dec 2, 2018.
What are the options for PSD import in 2017.4?
We currently only support PSDImporter for 2018.3 onwards.
Nonetheless, with ScriptedImporter already available in 2017.4, it is possible to implement your own PSDImporter given our package as base
I use the latest Unity 2019.1.2f1 Windows and when I try to update PSD from Package Manager I get this error:
Cannot perform upm operation: Unable to add package [email@example.com]:
One or more dependencies could not be added to the local file system:
com.unity.burst: EPERM: operation not permitted, unlink 'F:\TarotReadings_test\Library\PackageCache\firstname.lastname@example.org\.Runtime\Burst.Backend.dll' [NotFound]
installing Burst fixed this.
I have a problem. I use Krita for creating sprites and after importing the PSD file to unity it opens properly only in sprite editor. I cannot check the Rig Character box as it is not visible anywhere in the inspector. My sprite is slicing properly, and everything looks like it should work, but it doesn't ;(
The Unity ver that I use is 2018.3.14.f1.
I've followed the Brackeys tutorial step by step and tried to use another tutorials. Reinstall, reimport, recreating sprite and using PNG doesn't work. I just cannot use the PSB extension in Krita. Should I change the graphics editor to another? It would be sad as this one is the most comfortable to me.
@Gronek Have you tried renaming it to .PSB even if Krita won't actually save a PSB? The formats are almost identical so that should usually work.
daaaaamn it helped :O Thanks a lot! I've seen this tip earlier but just thought it's weird. Sorry And thanks! That really helped!
i hoped that you will write some library for c++ background. And that be working fast (on gpu, whitout GetPixel()). But now we have wrapper over Paint.NET, which is an so slow if we have 500+ layers in file.
In fact, this importer same as here: https://github.com/SubjectNerd-Unity/Psd2UnityImporter
Or am I wrong?
Will the PSD Importer in the future support named layers in the document?
Here is a drawing created in the Adobe Illustrator, where in the layers with the assigned names there are grouped non-named "parts" related to this element.
These names of layers are perfectly understood by Photoshop after exporting from AI to PSD-format.
But the PSD Importer completely ignores both the names of the layers themselves and the grouping of elements inside the layers - everything will be broken down into separate vector paths and groups, and the names will be lost
P.S. Sorry for google-translate!
Hello! The PSD Importer supports importing layers with their names and groupings intact, but it may have issue with the vector and path elements from Adobe Illustrator.
Just a few questions:
1. Currently, only the .PSB format is supported with the PSD Importer. You said you converted the .AI file to a .psd file. Have you tried to save it and import it as a .psb file?
2. Could you attach the original .AI file you created for us to check?
Export from the illustrator in my version is possible only in PSD,
options for the export in the screenshot. Then I just renamed the file extension to .psb.
I also imported saved from AI psd-file into Photoshop (which saw all the named layers), and then saved it in PSB format.
But after importing into a Unity, I don’t see any difference between the two assets.
Original AI file in attached zip
With best regards,
Hi, in this screenshot, you did not set the PSDImporter to keep Layer Grouping. Click the checkbox next to 'Use Layer Grouping' in the PSD Importer settings, and then click Apply. Then drag your character into the Scene again. You should see it with its layers in the correct grouping.
Could you let me know if that helps?
How did I miss such an obvious reason for this "problem"...
-Once again - excuse me ...
P.S. I revised my early sources - I put this checkbox!
but then I did not have named layers, so there were still groups and paths, so I remembered this...
But now... Oooh... Sorry...
Everything is ok now
Ha ha, no worries. Glad that everything is working fine now
I'm trying to us this library, and I've noticed that I am unable to build for iOS once I import the package. Thinking it might be an issue with my project, I created a brand new clean one, installed the package and even before importing a PSB I try to build to iOS and it presents me with 6 errors, was wondering if anyone else was experiencing this? Looks like the burst lib is whats throwing them.
In true developer fashion, the minute I asked for help I resolved the issue. If anyone else has this problem, first make sure your XCode Command Line tools are set to point at the latest version (XCode > Preferences > Location) then you need to update the Burst library in Unity to match the same preview version that the PSD Importer is using - preview3 1.1.0 in my case.
besides psd, would be great having xcf import as well
I apologize for repeating my message in another thread of the forum, but there is still no answer.
And maybe I just asked a question in the wrong place...
Could you please tell if it is possible now, and if so, - how can you "update" the graphics already imported by the PSDImporter to its newer version?
Since I have never found any mention of how to do this often required process, I tried to simply change the PSB-file to a new version outside of Unity - in the Windows explorer...
But despite the fact that the Rig with the bones, the binding and the weights is preserved, the result was not successful...
In my opinion, the structure of the layers and their names have not changed in the imported file, the dimensions of the picture also did not change (I watched it),
but the PSD Importer, even in the form of an atlas shows a completely different picture.
And of course, on the scene, the fully working prefab of the character was completely broken
A similar substitution for the old PSB file did not help...
-it seems that even the slightest change in the structure of the layers in the psb file, and even the addition of a new group of drawn objects inside previously imported named objects - causes catastrophic changes during import.
Is it possible to change this in future versions?
I understand that the method I used to update the graphics is slightly "hacker"
but how can I do it in a regular way?
P.S. Sorry for Google-translate
@EvOne which package version are you using?
Only this is available to me:
Are there already newer versions?
-If this is so - I can not even find out about it - the package manager does not show future versions
Unity 2019.3.0a8 and newer -I can not install because of a bug with a crash when running under Win7
so I had to stop at a7
and 2019.2.0b7 is stable (for me) working beta. Newer versions 19.2 - I have not yet installed.
In my experience, you can make changes to a PSB and not totally ruin your rig, but there are a couple quirks right now.
The one I keep bumping into is when you do a simple change that doesn’t effect the geometry at all, like changing a layer’s color. This should be fine, but I find that it temporarily breaks instances of the PSB that are inside prefabs: the bones all become invisible and stop working. The “fix” for me has been to simply open the effected prefab and close it again. (By the way, I reported this bug with clear repro steps but it came back as unable to repro?)
Another issue I’ve found is when changing a layer in a way that makes it a different size than it used to be - the existing bounding box around that sprite in the atlas has to be manually changed, and the geometry for that layer has to be regenerated in the skinning editor and any weights redone as well.
This is extremely useful piece of advice! It indeed worked for me for the PSDs saved in Affinity Designer!
Can someone knowledgeable of Unity PSD importer internals comment on the reliability of this hack going forward? If it works now on some PSD renamed to PSB is it likely to break in future versions on the Unity/Importer? Are there particular caveats and format differences to watch for (like maybe we are safe if we only use rasterized layers)? What is the motivation behind supporting less common PSB format in the first place? Thanks in advance!
PSB is a Photoshop file format similar to PSD file except it supports larger file size.
The reason we are using the PSB format is because of Unity Importer's constraint where only 1 file extension can be imported by 1 importer and the PSD extension is currently taken by the TextureImporter.
Moving forward, works are in place to allow PSD extension to be imported by other importers (including ScriptedImporters). The current PSDImporter will also continue to support both PSB and PSD file extension.
I recently tried updating my app from 2019.1.10 to 2019.2.4f1 and all my PSB prefabs broke. All the project become unusable. I have over 80 PSBs and I got these warning messages:
Identifier uniqueness violation: 'Name:new_style33 (Missing Prefab), Type:Prefab'. Multiple Objects with the same name/type are generated by this Importer. There is no guarantee that subsequent imports of this asset will properly re-link to these targets.
I dont have multiple objects with the same name.
Deleting the Library folder to re-import does the same outcome.
Your asap help is appreciated.
Can you send a sample project before upgrading for me to take a look?
You can PM me with a link where I can download and look at the repro case
Done. I took out the Library folder because its huge! Do you need it?
Please explain what was meant in the section: "Character Rig" of the documentation for the Importer:
"If the Sprite contains bone and skin data, the Sprite Skin component is added as well."
-I can not understand in what case the imported sprite can contain information about bones and skin...
Аnd what in this case generally means "skin"?
Hi. Is there any way to change the way of packing sprites in atlas? Random reshuffle maybe? Right now it generates HUGE transparent areas and that's bad for mobiles.
This means when the Sprite that is generated contains bone and weight skinning data. In this particular case, the bone and weight skinning data comes will come from using the Skinning Module in Sprite Editor Window.
'Skin data' refers to how the Sprite mesh is weighted on a bone
Do you mean the atlas image that is generated from the PSDImporter?
Forgive me with my "language barrier" sometimes there are problems.
-In most cases, I understand everything (almost everything, ok ) written in English, but sometimes,
right now - I read, re-read, but it doesn’t become clearer...
The "logical chain" simply does not add up at all, maybe the language barrier has nothing to do with it,
and I just ask a little wrong question
Judging by what you wrote:
"This means when the Sprite that is generated contains bone and weight skinning data."
- I see (corrected for "my Russian English") that it seems that the situation is meant when this information was already generated by Skinning Module and then we may decide - include Character Rig based on this information into asset or not include?
Once again, I'm sorry, I'm just confused ...
Probably the additional question I needed to ask sounds something like this:
In which case the generated sprite can contain this information - Is it using information from the file in PSD format itself (layers == meshes)
or is it all only after the Skinning Module from Sprite Editor?
All this does not interfere with the work with the Package! -Everything in it works great!
I just want to clarify, with a seemingly simple checkbox in the settings...
Skin date - Ah! Ok, so I’m right that this is service information not related to the “skins” in the gamers meaning of this word
P.S. Sorry for Google translate... (In Russian -> English direction - I can only translate in this way )
To simplify the case, it is the Skinning Module.
I understand your confusion in this matter and we will try to make the documentation clearer as we go along. Thanks!
Not as this moment unfortunately. However, you can pack the Sprites that are generated from the PSDImporter into another Atlas by using our SpriteAtlas and that should give you a better packing fit.
Are there plans to make 2D Animation also compatible with the Affinity Stack, like an .afdesign importer?
Not at the moment I am afraid If the demand for such an importer is high enough, we will take that into consideration in our next product planning. Thanks for letting us know!
Hi, Is there a way you support secondary textures (norml maps) with the psd importer package? Is there currently a workaround for this? I've been trying to use the skeletal animation with 2D lights and can't make it happen. Thank you!
It should be possible using the same workflow as a PNG. Though for this to work, your normal map texture for the PSD(PSB) needs to have the same layer and size so that when it mosaic the file, it will give you the same layout
My PSB file shows this structure inside UNITY in the project view:
BUT IS NOT ALIGNED TO WHAT IS PHOTOSHOP! ( where is instead LEG,ARM,TORSO)
if I open it in photoshop it shows a different order.
It seems the order is respected in Unity only in Sprite sorting Layers but NOT in the object's structure.
How can I force UNITY to have the object structure like the PSB file in photoshop?
I KEEP changing the layers order in photoshop but The object structure doesn't change at all !
Yes, that's the case for now. We will make a fix for this soon
we were using the 2D PSD Importer package 1.0.0-preview.3 on Unity 2018.4.17f1 and updated to 1.0.0-preview.4 at some point. It seems this has caused all of our PSBs' SpriteRenderers to have lost the correct path to their sprites. In our version control we can see that the metadata's 'fileIDToRecycleName' has been changed We found this changelog, which says that prefab instances will be broken when upgrading to 1.0.0-preview.4 from earlier versions (which we suspect is happening to our project). I also posted about this on Unity Answers here.
We would like to update our Unity project and packages to newer versions, but we are afraid that this will break prefab instances again. Any advice on what to do?
Have you gone through Advanced -> Show Preview Packages in the Package Manager. Looks like that bit was missed in the video.
This is due to a bug where the referencing name was wrong. To fix this, you will need to tinker around with the meta files.
If upgrading to the latest breaks prefab reference for you, you can share the project with me and I can help you fix up the meta files.
Hi there, we've been evaluating the PSD importer, if we have Pivot set to Center it works great for individual sprites but when toggling on “Use Layer Grouping” is there anyway to make the Group Parent pivot Center based on it’s children as opposed to just setting the Group Parents pivot to be center of the whole PSD? it's kind of making groups unusable for us. Thanks =)
Sounds logical. Let us take a look
I google the issue below, that I had while importing my .psb file from photoshop and this seemed to be the only remotely relatable thread.
So if you encounter the problem below. Convert your image from 32bit/16bit color to 8bit color.
I hope that helps someone
IndexOutOfRangeException: Index was outside the bounds of the array.
PhotoshopFile.Compression.ZipPredict32Image.Unpredict (System.Byte ptrData, System.Byte ptrOutput) (at Library/PackageCacheemail@example.com/Editor/PSDPlugin/PsdFile/Compression/ZipPredict32Image.cs:175)
PhotoshopFile.Compression.ZipPredict32Image.Read (System.Byte buffer) (at Library/PackageCachefirstname.lastname@example.org/Editor/PSDPlugin/PsdFile/Compression/ZipPredict32Image.cs:51)
PhotoshopFile.Channel.DecodeImageData () (at Library/PackageCacheemail@example.com/Editor/PSDPlugin/PsdFile/Layers/Channel.cs:243)
PhotoshopFile.PsdFile.DecompressImages () (at Library/PackageCachefirstname.lastname@example.org/Editor/PSDPlugin/PsdFile/PsdFile.cs:574)
PhotoshopFile.PsdFile.Load (System.IO.Stream stream, PhotoshopFile.LoadContext loadContext, PhotoshopFile.ELoadFlag loadFlag) (at Library/PackageCacheemail@example.com/Editor/PSDPlugin/PsdFile/PsdFile.cs:110)
PhotoshopFile.PsdFile..ctor (System.IO.Stream stream, PhotoshopFile.LoadContext loadContext, PhotoshopFile.ELoadFlag loadFlag) (at Library/PackageCachefirstname.lastname@example.org/Editor/PSDPlugin/PsdFile/PsdFile.cs:84)
PaintDotNet.Data.PhotoshopFileType.PsdLoad.Load (System.IO.Stream input) (at Library/PackageCacheemail@example.com/Editor/PSDPlugin/PhotoShopFileType/PsdLoad.cs:38)
UnityEditor.Experimental.U2D.PSD.PSDImporter.OnImportAsset (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at Library/PackageCachefirstname.lastname@example.org/Editor/PSDImporter.cs:178)
UnityEditor.Experimental.AssetImporters.ScriptedImporter.GenerateAssetData (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at C:/buildslave/unity/build/Modules/AssetPipelineEditor/Public/ScriptedImporter.cs:20)
UnityEngine.GUIUtilityrocessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
Which version of PSDImporter did you encounter this issue?
New Version! Wow!
Fix PSD import issues with PSD file without unique layer id
maybe I'm lucky with files exported from Illustrator
But... Is everything ok with version numbering and release dates?
I just upgraded my project from 2019.2 to 2019.3 and since then a .psb file that could previously be imported now delivers an exception and cannot be imported (with the same PSD Importer version 2.1.4).
Anyone any idea why this happens in 2019.3 and how to fix this?
Edit: There was an inactive layer in the document, I removed it and now the import works. Question is why does this work in 2018.2 and not in 2019.3.
Can you send us the file to look at?