+6
Fixed

Editor won't open in latest version of Unity 2017.1.0p1

ehardin 7 year бұрын updated by Zack Black 6 year бұрын 10

Installed SF v1.37

Image 838

Answer

Answer
Fixed

It looks like your installation is broken. This has already been fixed in 1.37. Make sure you run a clean install:

http://acegikmo.com/shaderforge/faq/?Q=erroronnewversion#erroronnewversion

I fix the button error. In ShaderForgeInspector script, reflection is used to get Unity internal method "ButtonMouseDown". This method does not exist anymore in Unity 2017. It has been replaced by the public method EditorGUI.DropdownButton.

So to fix the error button, 

  1. remove the line 124 :
    editorGUIMouseButtonDown = typeof( EditorGUI ).GetMethod( "ButtonMouseDown", privStatic, null, new Type[]{typeof(Rect),typeof(GUIContent),typeof(FocusType),typeof(GUIStyle)}, null );
  2. remove line 334 :
    bool mDown = (bool)editorGUIMouseButtonDown.Invoke( null, new object[] { position, GUIContent.none, FocusType.Passive, GUIStyle.none } );
  3. replace line 335 :
    if( mDown /*EditorGUI.ButtonMouseDown(position, GUIContent.none, FocusType.Passive, GUIStyle.none)*/)
    by :
    if( EditorGUI.DropdownButton(position, GUIContent.none, FocusType.Passive, GUIStyle.none))

Unfortunately this will only remove the button error, as some errors will appear when trying to show the ShaderForge editor window. But this is in a dll and we don't have access to this code. So we really the ShaderForge developer to fix.


Answer
Fixed

It looks like your installation is broken. This has already been fixed in 1.37. Make sure you run a clean install:

http://acegikmo.com/shaderforge/faq/?Q=erroronnewversion#erroronnewversion

Hey Joachim. I noticed a few peeps have been getting the window pop up error in unity2017. Has anyone sent the error read outs your way? 

I went through and reset the UI and reinstalled. Still happens. 


Here's what i got:

 

NullReferenceException: Object reference not set to an instance of an object
ShaderForge.SF_PreviewWindow.SetupPreview ()
ShaderForge.SF_PreviewWindow..ctor (ShaderForge.SF_Editor editor)
ShaderForge.SF_Editor.InitializeInstance (UnityEngine.Shader initShader)
ShaderForge.SF_Editor.Init (UnityEngine.Shader initShader)
ShaderForge.SF_Editor.InitEmpty ()



NullReferenceException: Object reference not set to an instance of an object
ShaderForge.SF_Editor.Update ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:272)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:265)
UnityEditor.HostView.SendUpdate () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:341)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:109)




NullReferenceException: Object reference not set to an instance of an object
ShaderForge.SF_Editor.OnDestroy ()
UnityEditor.EditorWindow:Close()
ShaderForge.SF_Editor:Update()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()




This is what i got when I download shaderforge from the asset store. I tried with a new project, so no other shaderforge version installed and still have the same errors. I can also tell the version is not up to date because when I try to import shaderforge in a new Unity 2017 project, Unity prompts a popup saying that the plugin contains scripts that use obsolete APIs.


I also removed the cache from the server cache just in case.


My version of Unity is 2017.1.0f3.


Also you marked this thread as resolved, but I guess you should wait for user's answer first. No offense, I'm sorry but this is not resolved for us and the only action I can do is getting this plugin from the Asset Store.

I'm unable to reproduce this running the very same Unity version (2017.1.0f3), with SF (1.37) downloaded from the asset store. It seems like something is likely going awry with some Unity asset cache or something.


Updating has always been oddly unreliable, and the one reliable thing I've seen that works to do a clean install as in the procedure I linked above. If that doesn't work, I really don't know if there's anything I can do about it.

If you still get that error, all I know is that Unity didn't get you a clean 1.37 install, you've got an older version.

We have the unity support at the studio so i'll ask them what can be wrong.

+1

I have attempted the clean install back when we upgraded to unity 2017.  We are currently on 2017.1.0p1 and not having any luck.

Unity 2017.1.0p4 and Unity 2017.1.0p5 - Did a clean install twice. SF v1.38

NullReferenceException: Object reference not set to an instance of an object
ShaderForge.SF_PreviewWindow.SetupPreview ()
ShaderForge.SF_PreviewWindow..ctor (ShaderForge.SF_Editor editor)
ShaderForge.SF_Editor.InitializeInstance (UnityEngine.Shader initShader)
ShaderForge.SF_Editor.Init (UnityEngine.Shader initShader)



ShaderForge.SF_Editor.InitEmpty ()

NullReferenceException: Object reference not set to an instance of an object
ShaderForge.SF_Editor.Update ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:272)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:265)
UnityEditor.HostView.SendUpdate () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:341)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:109)


NullReferenceException: Object reference not set to an instance of an object
ShaderForge.SF_Editor.OnDestroy ()
UnityEditor.EditorWindow:Close()
ShaderForge.SF_Editor:Update()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()


Anyone find a solution to this? I have the same problem with any build of 2017. No manner of clean installation or procedure has worked.

I want to clarify for anyone searching for the solution to this problem in Unity 2017. The Asset Store is finding an old version in the cache folder instead of downloading the latest (currently v1.38) On a Mac, you need to navigate to Users\XXX\Library\Unity\Asset Store-5.x and delete the folder "Joachim Holmr". You can then download Shader Forge from the Asset Store normally and it will install and open. Many thanks to Keenan Woodall for finally solving this.