Unity import script
-
- Posts: 4
- Joined: Tue Jul 27, 2010 9:48 pm
Re: Unity import script
Where is the assets folder at? Do you mean Standard Assets?
I know its probably a dumb question, its just that i tried creating an assets folder and then an Editor folder inside it but that didnt work. and i dont see any default Assets folder in my project besides Standard Assets.
I know its probably a dumb question, its just that i tried creating an assets folder and then an Editor folder inside it but that didnt work. and i dont see any default Assets folder in my project besides Standard Assets.
- AdamB
- Site Admin
- Posts: 2296
- Joined: Wed Apr 16, 2008 10:11 am
- Location: Brighton, UK
- Contact:
Re: Unity import script
No. Unity projects have a folder layout like this:ajon1993 wrote:Where is the assets folder at? Do you mean Standard Assets?
MyProject
....Assets
........Editor
............LightUp.js
........Standard Assets
............Fonts
............Particles
............etc
........Some_other_asset_you_imported
....Library
........AssetVersioning.db
........etc
Developer of LightUp http://www.light-up.co.uk
-
- Posts: 25
- Joined: Sun Oct 12, 2008 1:59 pm
Re: Unity import script
@Adam : in Unity 3, the script returns an error on following line :
Appearently, removing "preview =" from the beginning of the line solves the problem :
Code: Select all
preview = AssetDatabase.LoadAssetAtPath(assetPath.Substring(0, assetPath.LastIndexOf(".")) + "_thumbnail.tif", Texture2D);
Code: Select all
AssetDatabase.LoadAssetAtPath(assetPath.Substring(0, assetPath.LastIndexOf(".")) + "_thumbnail.tif", Texture2D);
- AdamB
- Site Admin
- Posts: 2296
- Joined: Wed Apr 16, 2008 10:11 am
- Location: Brighton, UK
- Contact:
Re: Unity import script
Thanks Yann. Yes, its actually not a Unity 3 thing really. It was just not setting the Unity Thumbnail image correctly and I guess Unity 3 is more picky.
So I've updated the LightUp.js script attached to this thread here so you'll now get the small 64x64 thumbnail image LightUp automagically creates on export showing in the Unity Inspector.
So I've updated the LightUp.js script attached to this thread here so you'll now get the small 64x64 thumbnail image LightUp automagically creates on export showing in the Unity Inspector.
Developer of LightUp http://www.light-up.co.uk
-
- Posts: 99
- Joined: Thu Nov 19, 2009 8:18 am
Re: Unity import script
I get this error message in Unity when importing a model I'm working on.
Using latest LU (2.0b) latest import script and latest Unity (3.3).
Using latest LU (2.0b) latest import script and latest Unity (3.3).
That line in the import script is:InvalidCastException: Cannot cast from source type to destination type.
LightUpMeshPostprocessor.OnAssignMaterialModel (UnityEngine.Material material, UnityEngine.Renderer renderer) (at Assets/Editor/LightUp.js:62)
Code: Select all
var tex:Texture2D = material.GetTexture("_MainTex");
- AdamB
- Site Admin
- Posts: 2296
- Joined: Wed Apr 16, 2008 10:11 am
- Location: Brighton, UK
- Contact:
Re: Unity import script
[Just spent the week here at the Game Developer Conference chatting with the splendid Unity guys.]
Looks a reasonable line, but I'll chase them up for their thoughts as to what they changed for the new version.
Adam
Looks a reasonable line, but I'll chase them up for their thoughts as to what they changed for the new version.
Adam
Developer of LightUp http://www.light-up.co.uk
-
- Posts: 99
- Joined: Thu Nov 19, 2009 8:18 am
Re: Unity import script
Would it be possible to edit the script to make it work with the Unity standard diffuse shader the way the built in lightmapper Beast does?
Why? I want to mix LU lightmapped (AO only) and realtime sunlight for animated shadows from trees.
Why? I want to mix LU lightmapped (AO only) and realtime sunlight for animated shadows from trees.
-
- Posts: 1
- Joined: Mon Mar 07, 2011 3:12 pm
Re: Unity import script
@Pixero
Those splendid Unity guys are here to help. I have just grabbed:
SketchUp: v7.1
LightUp: v2.0
Unity: c3.3.0f4
and am running on a Mac. I can successfully import the example0.skp file into Unity using the 10th Jan version of Adam's LightUp.js. The error on line 62 is a little puzzling. GetTexture returns a Texture, and the Texture2D type is derived from it, so there is nothing "wrong" about this line. I've tried Unity 3.2.0f3 and get things to work, so I don't think there is much that has changed in 3.3 that would cause this to break. Can I trouble you to try to get example0.skp into an empty Unity project? If you get a problem with this simple case, let me know and perhaps send over the project to us support at unity3d dot com. Mention Graham/Dendrophile.
Sorry I cannot give you an instant fix. Actually, I guess the model you are working on is more complicated that the simple example one. Are you able to send me over that artwork?
Thanks,
Graham
Those splendid Unity guys are here to help. I have just grabbed:
SketchUp: v7.1
LightUp: v2.0
Unity: c3.3.0f4
and am running on a Mac. I can successfully import the example0.skp file into Unity using the 10th Jan version of Adam's LightUp.js. The error on line 62 is a little puzzling. GetTexture returns a Texture, and the Texture2D type is derived from it, so there is nothing "wrong" about this line. I've tried Unity 3.2.0f3 and get things to work, so I don't think there is much that has changed in 3.3 that would cause this to break. Can I trouble you to try to get example0.skp into an empty Unity project? If you get a problem with this simple case, let me know and perhaps send over the project to us support at unity3d dot com. Mention Graham/Dendrophile.
Sorry I cannot give you an instant fix. Actually, I guess the model you are working on is more complicated that the simple example one. Are you able to send me over that artwork?
Thanks,
Graham
-
- Posts: 99
- Joined: Thu Nov 19, 2009 8:18 am
Re: Unity import script
The problem seem to be for this perticular scene so I'll keep investigating...
-
- Posts: 99
- Joined: Thu Nov 19, 2009 8:18 am
Re: Unity import script
A few objects in the scene weren't imported into Unity so I tried exploding those parts of the scene and that made it work. Textures applied and all.
Must have been some error upon import when the problem grouped geometry was not beeing found?
All is well, but I still would like it to work with Unity's standard shaders like Beast do.
Must have been some error upon import when the problem grouped geometry was not beeing found?
All is well, but I still would like it to work with Unity's standard shaders like Beast do.