Psd import is a tool that allows you to import layers and groups defined in psd files into Unity. The result is a hierarchy of gameObjects (Sprites or Ui Images) that corresponds to the original defined in photoshop, each layer with its corresponding opacity value and its blending mode.
Links:
Please post any feedback or ask for support here.
Import isn’t working, I’ve tried multiple times and I’m always getting the same error message.
Is there anything that I can do to fix the problem? Stack trace attached below:
ArgumentException: Getting control 0’s position in a group with only 0 controls when doing repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at <819de1aa368e45faa4f78e26c97c62b0>:0)
UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[ ] options, System.Type layoutType) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
UnityEngine.GUILayout.BeginVertical (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[ ] options) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
UnityEngine.GUILayout.BeginVertical (UnityEngine.GUILayoutOption[ ] options) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
PluginMaster.PsdImportWindow.OnGUI () (at Assets/PluginMaster/PsTools/PsdImport/Editor/Scripts/PsdImportWindow.cs:219)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters) (at :0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEditor.DockArea.OldOnGUI () (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Boolean straightY, System.Single pixelsPerPoint, System.Exception& immediateException) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.UIElements.PanelClearFlags clearFlags) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
greg_unity763:
Import isn’t working, I’ve tried multiple times and I’m always getting the same error message.
Is there anything that I can do to fix the problem? Stack trace attached below:
ArgumentException: Getting control 0’s position in a group with only 0 controls when doing repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at <819de1aa368e45faa4f78e26c97c62b0>:0)
UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[ ] options, System.Type layoutType) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
UnityEngine.GUILayout.BeginVertical (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[ ] options) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
UnityEngine.GUILayout.BeginVertical (UnityEngine.GUILayoutOption[ ] options) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
PluginMaster.PsdImportWindow.OnGUI () (at Assets/PluginMaster/PsTools/PsdImport/Editor/Scripts/PsdImportWindow.cs:219)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters) (at :0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEditor.DockArea.OldOnGUI () (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Boolean straightY, System.Single pixelsPerPoint, System.Exception& immediateException) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.UIElements.PanelClearFlags clearFlags) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
Hello, sorry for the inconvenience, I’m working to fix it. Does the error occur when loading the file into the import window or when trying to import into unity hierarchy?
Hi,
thank you for the prompt reply. It occurs when loading the file into the import window.
And does it happen for any file or just for a specific file? Have you tried importing other files?
I’ve tried for multiple different files, some of them actually worked, I would say that there is 50% of chances that it won’t work. I also had a file where it failed on the first two attempts, but it imported on the third. The file you have the stack trace for never worked.
greg_unity763:
I’ve tried for multiple different files, some of them actually worked, I would say that there is 50% of chances that it won’t work. I also had a file where it failed on the first two attempts, but it imported on the third. The file you have the stack trace for never worked.
Ok, could you please send me a dummy file that doesn’t work to test it here? my email is plugingmaster418@gmail.com
Hi,
I’ve sent the file using wetransfer.
s
Sorry I misspelled my email: the correct one is pluginmaster418@gmail.com
In the meantime, try this: open the file PsdImportWindow.cs and at line 142 where it says “private const int MAX_TRIES = 5;” change from 5 to 10 or more.
Are you sure that the e-mail address is correct? The email couldn’t be delivered…
I will re-send it to the right address + check the change
After making the change from 5 to 10 the import has worked. It was really slow and laggy + there was an error at the end, but it worked :
NullReferenceException: Object reference not set to an instance of an object
PluginMaster.PsLayerCreator.CreateGameObjets () (at Assets/PluginMaster/PsTools/PsdImport/Editor/Scripts/PsLayerCreator/PsLayerCreator.cs:184)
PluginMaster.PsdImportWindow.OnGUI () (at Assets/PluginMaster/PsTools/PsdImport/Editor/Scripts/PsdImportWindow.cs:498)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters) (at :0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEditor.DockArea.OldOnGUI () (at <2cbbf8f8c622459ca9fa64194b7b6e6e>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
Thanks for helping me improve the tool. I am working to correct the errors and upload a new version as soon as possible.
Thank you for your support. I think that we should test it with larger files, in general, this was not even the biggest PSD that we have. I’m afraid that it will fail again once we will try to upload PSD twice the size and complexity. It would be so massive enhancement to the workflow to have the importer work smoothly.
It seems that it still doesn’t work. I’m importing again the same file, but it’s failing now again. It seems that problem is intermittent so I will try multiple times.
It’s not working, I’ve tried maybe 20 times, same file, no changes made since yesterday.
I already uploaded a new version (1.2) but I’m waiting for approval. I will let you know when it’s available.
Version 1.2 is now available. Please check it out and let me know if you have any problem with it. This version has support for large PSD files. However, you should keep in mind that the larger the file, the longer it will take to load.
hdxpmc
October 2, 2020, 4:46am
19
Hello,
Does psd import support runtime import ?
Hello,
What do you mean? import while in play mode?
It only supports import in edit mode.
Could you please elaborate on exactly what you want to do?