Jump to content

Model load error?


TomTango

Recommended Posts

Hi all

This is my first time adding custom parts to KSP, A bit late to the party I know. I'm having a very frustrating problem that I just can't nail down using part tools. I've been attempting this for nearly two days now and just cant for the life of me find the cause.

I have followed the instructions here https://forum.kerbalspaceprogram.com/index.php?/topic/160487-parttools-updated/

I model in blender and export as FBX, load into unity, add my mesh, define a material, etc and export However KSP.log is showing the error :

Quote

 

LOG 16:20:42.583] Load(Model): CLSTango/Parts/Infinity/infini-truss-01
[ERR 16:20:42.605] File error:
Unable to read beyond the end of the stream.
  at System.IO.BinaryReader.ReadByte () [0x00018] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at System.IO.BinaryReader.Read7BitEncodedInt () [0x00019] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at System.IO.BinaryReader.ReadString () [0x0000f] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at PartReader.ReadTextures (System.IO.BinaryReader br, UnityEngine.GameObject o) [0x00072] in <9d71e4043e394d78a6cf9193ad011698>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x0067a] in <9d71e4043e394d78a6cf9193ad011698>:0 
  at PartReader.Read (UrlDir+UrlFile file) [0x000c1] in <9d71e4043e394d78a6cf9193ad011698>:0 

[WRN 16:20:42.605] Model load error in 'F:\SteamLibrary\steamapps\common\Kerbal Space Program\GameData\CLSTango\Parts\Infinity\infini-truss-01.mu'

 

and then subesquently further down the log

Quote

 

[ERR 16:21:34.790] PartCompiler: Cannot clone model 'CLSTango\Parts\Infinity\infini-truss-01' as model does not exist

[ERR 16:21:34.790] PartCompiler: Model was not compiled correctly

[ERR 16:21:34.790] PartCompiler: Cannot compile model

[ERR 16:21:34.790] PartCompiler: Cannot compile part

 

I am a unity developer by trade, I have been since 2014, so the error makes some sense to me but I can not seem to fix it.

I have debugged so far by reverting to using a simple cube object, plain grey diffuse texture using KSP/Diffuse shader and my file structure for the assets in GameData is "CLSTango/Parts/Infinity/" containing the assets diffuse.dds, normal.dds, infini-truss-01.mu and infinity-trusses.cfg all that seems correct to me. The error is not in cfg file as I tried pointing the model variable to a stock squad asset and it loaded fine.

I am currently assuming that this is something to do with my object hierarchy in unity, but I have tried every combination of parenting the mesh transform and the collider transform I can think of all with the same result. I have clean installed a copy of Unity 2019.2.21f1 and begun again with a fresh .blend file in case there was some corruption in there somewhere, no difference and now I'm at a bit of a loss.

Has anyone got any idea where I am going wrong here?

 

Link to comment
Share on other sites

@hraban and @zer0Kerbal

Thanks for the pointers, I already had 2.21f1 among my half dozen unity installs for work and had not noticed the required versioning as 2.2f1, I've added 2.2 to the list and i'm not seeing any more problems.

Just in case any one else comes across this post, I'll add that I had also used "\" in the MODEL path rather than "/" and this was causing the second (or at lest one of the causes of) the second error. Stupid oversight error I know, but it wasn't obvious to me.

Link to comment
Share on other sites

  • 1 month later...

I'm getting this exact same error:
 

Quote

[LOG 00:22:05.218] Load(Model): Test/test
[ERR 00:22:05.220] File error:
Unable to read beyond the end of the stream.
  at System.IO.BinaryReader.ReadByte () [0x00018] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at System.IO.BinaryReader.Read7BitEncodedInt () [0x00019] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at System.IO.BinaryReader.ReadString () [0x0000f] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at PartReader.ReadTextures (System.IO.BinaryReader br, UnityEngine.GameObject o) [0x00072] in <55ba45dc3a43403382024deac8dcd0be>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x0067a] in <55ba45dc3a43403382024deac8dcd0be>:0 
  at PartReader.Read (UrlDir+UrlFile file) [0x000c1] in <55ba45dc3a43403382024deac8dcd0be>:0 

[WRN 00:22:05.220] Model load error in 'D:\Steam\steamapps\common\Kerbal Space Program\GameData\Test\test.mu'

But I'm using the correct version of Unity. What else could cause it?

Link to comment
Share on other sites

Don't use .dds textures. Assign your textures in .png in Unity to the Material, once you're done setting up export everything as usual. Once you've exported, you can change the exported textures back to .dds or leave them, your decision. Texture name needs to remain the same though.

Recently had this issue myself and it took me hours to figure out that the textures were the issue, maybe that helps.

Link to comment
Share on other sites

  • 3 years later...

Hello everyone, I am aware that this is 3 years later, but this is the only forum with some info regarding my problem.

Recently, I started trying to mod IVA's from internals from mods (airplaneplus, bdarmory etc), but my problem is whenever I try to load JSIMainCompUnit or any switch or dial using PartTools 2017.3 ver 1.0.56 for that matter, Unity 2019.4.18f1 gives me console messages of the following:

Cannot clone model 'ASET/ASET_Props/Control/Push_Button_Modular/models/pb_SplitVertical_Cap' as model does not exist

 

is there any way to fix this?

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...