Jump to content

Unity doesn't export textures


Cooly568

Recommended Posts

So this is a problem that I've had with my Unity for a while now.

I've been able to export buildings for Kerbtown and parts for the game for a while now, but now parttools for unity doesn't export my textures for the part.

The model has a collision mesh, textures and materials are set up properly, and Gamedata directories are proper too.

I think this started back when I downloaded a newer version of Unity to get files for the un-offical 64-bit KSP thing.

I updated Unity, and in my trying to fix it, I've cleaned every Unity file off my computer and re-installed fresh, still doesn't work.

I'm using the most recent version of Unity, and KSP Parttools 0.23.

In looking through Unity's log, I also found this.

File error: Object reference not set to an instance of an object  at KSPPartTools.PartWriter.WriteMesh (System.IO.BinaryWriter bw, UnityEngine.Mesh mesh) [0x00000] in <filename unknown>:0 
at KSPPartTools.PartWriter.WriteCollider (System.IO.BinaryWriter bw, UnityEngine.Transform t) [0x00000] in <filename unknown>:0
at KSPPartTools.PartWriter.WriteChild (System.IO.BinaryWriter bw, UnityEngine.Transform t) [0x00000] in <filename unknown>:0
at KSPPartTools.PartWriter.WriteChild (System.IO.BinaryWriter bw, UnityEngine.Transform t) [0x00000] in <filename unknown>:0
at KSPPartTools.PartWriter.Write (System.String modelName, System.String filePath, UnityEngine.Transform target, TextureFormat textureFormat) [0x00000] in <filename unknown>:0

This was the error Unity threw when I exported the part.

Link to comment
Share on other sites

textures and materials are set up properly, and Gamedata directories are proper too.

Are you really sure ?

As you didn't give any details, we have to trust you on this and many time people believe what they do is right when they're wrong !

(remember the old call to customer support with non connected power plug for a computer problem !)

In looking through Unity's log, I also found this.

File error: Object reference not set to an instance of an object  at KSPPartTools.PartWriter.WriteMesh (System.IO.BinaryWriter bw, UnityEngine.Mesh mesh) [0x00000] in <filename unknown>:0 
at KSPPartTools.PartWriter.WriteCollider (System.IO.BinaryWriter bw, UnityEngine.Transform t) [0x00000] in <filename unknown>:0
at KSPPartTools.PartWriter.WriteChild (System.IO.BinaryWriter bw, UnityEngine.Transform t) [0x00000] in <filename unknown>:0
at KSPPartTools.PartWriter.WriteChild (System.IO.BinaryWriter bw, UnityEngine.Transform t) [0x00000] in <filename unknown>:0
at KSPPartTools.PartWriter.Write (System.String modelName, System.String filePath, UnityEngine.Transform target, TextureFormat textureFormat) [0x00000] in <filename unknown>:0

This was the error Unity threw when I exported the part.

Weird. Anyway, unity didn't export texture as best as it could do, so better to put even a single color pixel tex with the right name, let unity do its cooking, then replace the dummy tex with a proper one (Targa file for example have been reported to be less/not compressed, PNG are know to don't work very well too, but it's from old posts).

(I've also encountered some issues with unity, inside KSP, using some targa files, not sure of what the problem is, perhaps compression scheme, 24/32 bits, or origin setting)

And using the very latest unity editor is not the right thing to do with KSP (for dealing with emissive anim => 4.2.2, else the 4.3.3 should be ok).

Link to comment
Share on other sites

" at KSPPartTools.PartWriter.WriteCollider (System.IO.BinaryWriter bw, UnityEngine.Transform t) [0x00000] in <filename unknown>:0"

From that line in the log I'm thinking that you've added convex collider to a transform that has no mesh associated with it, that will produce exactly the problem you are having, check your hierarchy carefully to make sure everything that has a collider has a mesh to go with it. Did this a lot in my early days of using unity, took me ages to work out what was going on, many modelling apps can sneak extra transforms in without you even noticing.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...