Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when material does not have "_MainTex" property #12

Open
Liviuss76 opened this issue Feb 29, 2016 · 0 comments
Open

Exception when material does not have "_MainTex" property #12

Liviuss76 opened this issue Feb 29, 2016 · 0 comments

Comments

@Liviuss76
Copy link

As stated, when material does not have "_MainTex" property, script will spam in console errors.
Solution is to change:
Line 360
from
if (tDetails.material.mainTexture!=null) GUILayout.Box(tDetails.material.mainTexture, GUILayout.Width(ThumbnailWidth), GUILayout.Height(ThumbnailHeight));
to
if (tDetails.material.HasProperty("_MainTex") && tDetails.material.mainTexture!=null) GUILayout.Box(tDetails.material.mainTexture, GUILayout.Width(ThumbnailWidth), GUILayout.Height(ThumbnailHeight));

Line 564
from
if (tMaterial.mainTexture != null && !dependencies.Contains(tMaterial.mainTexture))
to
if (tMaterial.HasProperty("_MainTex") && tMaterial.mainTexture != null && !dependencies.Contains(tMaterial.mainTexture))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant