Jump to content

Part Tools texture cast error


Recommended Posts

Hello,

I'm in need of some help with this Parrt tools error upon saving the model + textures:

File error: Cannot cast from source type to destination type.
  at KSPPartTools.BitmapWriter.Write2D (UnityEngine.Texture texture, System.String newPath, TextureType texType) [0x00000] in <filename unknown>:0 
  at KSPPartTools.PartWriter.WriteTexture (UnityEngine.Texture texture, System.String path, System.String filePath, KSPPartTools.TextureDummy tex, System.String filename) [0x00000] in <filename unknown>:0 
  at KSPPartTools.PartWriter.WriteTextures (System.IO.BinaryWriter bw) [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 

UnityEngine.Debug:LogError(Object)
KSPPartTools.PartWriter:Write(String, String, Transform, TextureFormat)
KSPPartTools.PartToolsInspector:DrawWriterGUI()
KSPPartTools.PartToolsInspector:OnInspectorGUI()
PartToolsEditor:OnInspectorGUI() (at Assets/PartTools/Editor/PartToolsEditor.cs:18)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

The models are Orbiter 2010 meshes whcih I'm trying to import into KSP. They're  .fbx imported from Blender along with the embedded txtures which are .dds. 

I could surmise that the problem could be related to that <filename unknown>  string but I have no idea how to deal with this.

 

I hope this is enough information and not too vague a description. Can anyone suggest anything?

Thank you very much indeed.

 

Dolin

Link to comment
Share on other sites

8 hours ago, Dolin said:

Hello,

I'm in need of some help with this Parrt tools error upon saving the model + textures:

File error: Cannot cast from source type to destination type.
  at KSPPartTools.BitmapWriter.Write2D (UnityEngine.Texture texture, System.String newPath, TextureType texType) [0x00000] in <filename unknown>:0 
  at KSPPartTools.PartWriter.WriteTexture (UnityEngine.Texture texture, System.String path, System.String filePath, KSPPartTools.TextureDummy tex, System.String filename) [0x00000] in <filename unknown>:0 
  at KSPPartTools.PartWriter.WriteTextures (System.IO.BinaryWriter bw) [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 

UnityEngine.Debug:LogError(Object)
KSPPartTools.PartWriter:Write(String, String, Transform, TextureFormat)
KSPPartTools.PartToolsInspector:DrawWriterGUI()
KSPPartTools.PartToolsInspector:OnInspectorGUI()
PartToolsEditor:OnInspectorGUI() (at Assets/PartTools/Editor/PartToolsEditor.cs:18)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

The models are Orbiter 2010 meshes whcih I'm trying to import into KSP. They're  .fbx imported from Blender along with the embedded txtures which are .dds. 

I could surmise that the problem could be related to that <filename unknown>  string but I have no idea how to deal with this.

I hope this is enough information and not too vague a description. Can anyone suggest anything?

Thank you very much indeed.

Dolin

I don't believe the part tools works with .dds source files, for whatever reason. I'd just make png copies for export and then delete+replace them with the original dds files in the Gamedata.

Link to comment
Share on other sites

Thank you for your quick reply,

 

Following your comment I was inspired to convert every texture to .png and see if the orbiter mesh plugin in Blender was able to map the UVs regardless of the format.

Luckily it seems like it was, and working with .png only enabled me to use part tools succesfully. Thank you.

 

Dolin

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.

 Share

×
×
  • Create New...