Jump to content

[Solved] Error with .mu file


Recommended Posts

Hello. I have made a .mu for my mod but I can't get the part to load as I don't know the MODEL name. I have tried the name of the .mu with and without capitals but it doesn't work. How do you find out? There is a link to the file below. Thanks,

Benji13.

https://www.dropbox.com/s/qrkr16a1vv4ntc3/structuralDisk.mu?dl=1

Edited by Benji13
Link to comment
Share on other sites

The MODEL{} node requires also the correct path to the model. If this is wrong then KSP will never compile the part config correctly and the part will not appear.

Assuming that the model resides under "StructuralDisks/Parts" and the model has the name "structuralDisk" then the MODEL node would be:

MODEL
{
    model = StructuralDisks/Parts/structuralDisk
}

If this fails then the problem stems from the model itself (it's structure might not be correct). Post a log so that we can check what the problem is.

Link to comment
Share on other sites

 

9 minutes ago, Benji13 said:

@Phineas Freak I've moved all the textures and models to a new folder (StructuralDisks/Assets) to clean up a bit. I'll try again later/tomorrow and if that doesn't work I'll just remake the model. It's pretty simple anyway. So the name of the model is just the structuralDisk.mu bit? 

The best way is to call the model model and the same in your cfg.

Link to comment
Share on other sites

5 hours ago, Benji13 said:

So the name of the model is just the structuralDisk.mu bit? 

Yep, you enter the name of the model file itself! Good to see someone actually taking their time and naming their models appropriately.

Since you have changed the folder structure, be sure to double check the path to the model.

Link to comment
Share on other sites

Okay it seems that there is a problem with the .mu. Here is the part of the log when the model loads:

Spoiler

[LOG 19:18:50.230] Load(Model): StructuralDisks/Assets/concavedisk
[ERR 19:18:50.239] File error:
Failed to read past end of stream.
  at System.IO.BinaryReader.FillBuffer (Int32 numBytes) [0x00000] in <filename unknown>:0 
  at System.IO.BinaryReader.ReadInt32 () [0x00000] in <filename unknown>:0 
  at PartReader.ReadMesh (System.IO.BinaryReader br) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.Read (.UrlFile file) [0x00000] in <filename unknown>:0 

[WRN 19:18:50.249] Model load error in 'C:\Users\Benji\Documents\KSP 1.2.1 - Dev\GameData\StructuralDisks\Assets\concavedisk.mu'
[LOG 19:18:50.254] Load(Model): StructuralDisks/Assets/structuralDisk
[ERR 19:18:50.258] File error:
Failed to read past end of stream.
  at System.IO.BinaryReader.FillBuffer (Int32 numBytes) [0x00000] in <filename unknown>:0 
  at System.IO.BinaryReader.ReadInt32 () [0x00000] in <filename unknown>:0 
  at PartReader.ReadMesh (System.IO.BinaryReader br) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.Read (.UrlFile file) [0x00000] in <filename unknown>:0 

[WRN 19:18:50.267] Model load error in 'C:\Users\Benji\Documents\KSP 1.2.1 - Dev\GameData\StructuralDisks\Assets\structuralDisk.mu'

 

There are two .mu files in the Assets folder. One (structuralDisk.mu) is the main model which is assigned to the Structural Disk part. The cancaveDisk.mu file is not assigned to a part but I was planning on adding it via FSmeshswitch later. It seems there is a problem with both files, even though they were both made the exact same way as an earlier (working) model. The only difference is that both of these (non-working) models have a lot more vertices than the old one. This means that unity split them in to numerous meshes/objects/whatever-evil-unity-uses. Could that be causing this problem? This is my step-by-step process for making the parts:

Spoiler
  1. Make part in Blender. So far all my models have only been made up of one primitive.
  2. Export Blender shape as .dae.
  3. Start new Unity project and import KSP PartTools and a folder with .dae and basic texture.
  4. Create empty GameObject in Unity and add component -> KSP -> PartTools. Select GameData folder and output directory. Name model.
  5. Drag .dae on to GameObject. Unity says is has too many vertices (for the concaveDisk) and slits the sphere (it's half a sphere) in to two meshes. This does not happen for the structuralDisk model. 
  6. Add collision mesh to the 'cylinder'. I use 'Mesh Collider' with 'convex' ticked.
  7. Select 'Bumped Specular' shader for the 'cylinder' and add texture. Everything looks good so I export as .mu. 

Here is an image of the Unity hierarchy:

L4ux44d.png

I am not really sure what is wrong. As I said, I've done the same thing as I did before. Could be the fact I'm on 1.2.1 now too. I didn't think that changed anything with the parts though. Any ideas? @Phineas Freak? Thanks,

Benji13.

Link to comment
Share on other sites

49 minutes ago, Benji13 said:

Ok. I'll have to keep experimenting till I get something right. 

Don't stop! This mod is good the mu files need there own part file 

In ksp,game data were the squad file is make a file call it whatever you want in that make some more files call them the same name as the parts you want to make in them a mu file called model and a cfg file and a texture the layout should look like this 

Ksp

Game data 

Your file 

Part's files ie cool part,lol tank 

In cool Part's file

Model.mu cool part.cfg cool part tex.dss

In lol tanks file 

Model.mu lol.cfg lol texture.dss

And that's the way to get that mod working you have to put a read me in the mod. If you put more than one mu and cfg in a file it will not work you can have more than one texture in a part file good luck as I have experience with this as I have made a mod with multiple parts in it.

 

Link to comment
Share on other sites

34 minutes ago, Gamax19 said:

Don't stop! This mod is good the mu files need there own part file 

In ksp,game data were the squad file is make a file call it whatever you want in that make some more files call them the same name as the parts you want to make in them a mu file called model and a cfg file and a texture the layout should look like this 

Ksp

Game data 

Your file 

Part's files ie cool part,lol tank 

In cool Part's file

Model.mu cool part.cfg cool part tex.dss

In lol tanks file 

Model.mu lol.cfg lol texture.dss

And that's the way to get that mod working you have to put a read me in the mod. If you put more than one mu and cfg in a file it will not work you can have more than one texture in a part file good luck as I have experience with this as I have made a mod with multiple parts in it.

 

I'm glad you like my mod! The model and texture files can be anywhere in your mod folder as long as you have their whole path in the part config. Many mods do this, the USI mods come to mind. 

Link to comment
Share on other sites

19 minutes ago, Gamax19 said:

Strang:huh:

Did you use blender for your model and texture? I have been using paint.net as well to get better details on my texture do you use the most up to date part tools?

 

Yea the partools are the latest version. I use GIMP for my textures but most of them are pretty basic. 

Link to comment
Share on other sites

5 hours ago, Benji13 said:

Okay it seems that there is a problem with the .mu. Here is the part of the log when the model loads:

  Hide contents


[LOG 19:18:50.230] Load(Model): StructuralDisks/Assets/concavedisk
[ERR 19:18:50.239] File error:
Failed to read past end of stream.
  at System.IO.BinaryReader.FillBuffer (Int32 numBytes) [0x00000] in <filename unknown>:0 
  at System.IO.BinaryReader.ReadInt32 () [0x00000] in <filename unknown>:0 
  at PartReader.ReadMesh (System.IO.BinaryReader br) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.Read (.UrlFile file) [0x00000] in <filename unknown>:0 

[WRN 19:18:50.249] Model load error in 'C:\Users\Benji\Documents\KSP 1.2.1 - Dev\GameData\StructuralDisks\Assets\concavedisk.mu'
[LOG 19:18:50.254] Load(Model): StructuralDisks/Assets/structuralDisk
[ERR 19:18:50.258] File error:
Failed to read past end of stream.
  at System.IO.BinaryReader.FillBuffer (Int32 numBytes) [0x00000] in <filename unknown>:0 
  at System.IO.BinaryReader.ReadInt32 () [0x00000] in <filename unknown>:0 
  at PartReader.ReadMesh (System.IO.BinaryReader br) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.Read (.UrlFile file) [0x00000] in <filename unknown>:0 

[WRN 19:18:50.267] Model load error in 'C:\Users\Benji\Documents\KSP 1.2.1 - Dev\GameData\StructuralDisks\Assets\structuralDisk.mu'

 

There are two .mu files in the Assets folder. One (structuralDisk.mu) is the main model which is assigned to the Structural Disk part. The cancaveDisk.mu file is not assigned to a part but I was planning on adding it via FSmeshswitch later. It seems there is a problem with both files, even though they were both made the exact same way as an earlier (working) model. The only difference is that both of these (non-working) models have a lot more vertices than the old one. This means that unity split them in to numerous meshes/objects/whatever-evil-unity-uses. Could that be causing this problem? This is my step-by-step process for making the parts:

  Hide contents
  1. Make part in Blender. So far all my models have only been made up of one primitive.
  2. Export Blender shape as .dae.
  3. Start new Unity project and import KSP PartTools and a folder with .dae and basic texture.
  4. Create empty GameObject in Unity and add component -> KSP -> PartTools. Select GameData folder and output directory. Name model.
  5. Drag .dae on to GameObject. Unity says is has too many vertices (for the concaveDisk) and slits the sphere (it's half a sphere) in to two meshes. This does not happen for the structuralDisk model. 
  6. Add collision mesh to the 'cylinder'. I use 'Mesh Collider' with 'convex' ticked.
  7. Select 'Bumped Specular' shader for the 'cylinder' and add texture. Everything looks good so I export as .mu. 

Here is an image of the Unity hierarchy:

L4ux44d.png

I am not really sure what is wrong. As I said, I've done the same thing as I did before. Could be the fact I'm on 1.2.1 now too. I didn't think that changed anything with the parts though. Any ideas? @Phineas Freak? Thanks,

Benji13.

You don't have to make a empty GameObject if you do that  on a engine you will have to do alittle more work in unity can you post your dae file and textures ?

Link to comment
Share on other sites

5 minutes ago, MeCripp said:

You don't have to make a empty GameObject if you do that  on a engine you will have to do alittle more work in unity can you post your dae file and textures ?

Sure. It will have to wait until tomor- wait no, it's very early now. It will have to wait until later. 

Link to comment
Share on other sites

5 hours ago, Benji13 said:

Okay it seems that there is a problem with the .mu. Here is the part of the log when the model loads:

  Hide contents


[LOG 19:18:50.230] Load(Model): StructuralDisks/Assets/concavedisk
[ERR 19:18:50.239] File error:
Failed to read past end of stream.
  at System.IO.BinaryReader.FillBuffer (Int32 numBytes) [0x00000] in <filename unknown>:0 
  at System.IO.BinaryReader.ReadInt32 () [0x00000] in <filename unknown>:0 
  at PartReader.ReadMesh (System.IO.BinaryReader br) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.Read (.UrlFile file) [0x00000] in <filename unknown>:0 

[WRN 19:18:50.249] Model load error in 'C:\Users\Benji\Documents\KSP 1.2.1 - Dev\GameData\StructuralDisks\Assets\concavedisk.mu'
[LOG 19:18:50.254] Load(Model): StructuralDisks/Assets/structuralDisk
[ERR 19:18:50.258] File error:
Failed to read past end of stream.
  at System.IO.BinaryReader.FillBuffer (Int32 numBytes) [0x00000] in <filename unknown>:0 
  at System.IO.BinaryReader.ReadInt32 () [0x00000] in <filename unknown>:0 
  at PartReader.ReadMesh (System.IO.BinaryReader br) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0 
  at PartReader.Read (.UrlFile file) [0x00000] in <filename unknown>:0 

[WRN 19:18:50.267] Model load error in 'C:\Users\Benji\Documents\KSP 1.2.1 - Dev\GameData\StructuralDisks\Assets\structuralDisk.mu'

 

There are two .mu files in the Assets folder. One (structuralDisk.mu) is the main model which is assigned to the Structural Disk part. The cancaveDisk.mu file is not assigned to a part but I was planning on adding it via FSmeshswitch later. It seems there is a problem with both files, even though they were both made the exact same way as an earlier (working) model. The only difference is that both of these (non-working) models have a lot more vertices than the old one. This means that unity split them in to numerous meshes/objects/whatever-evil-unity-uses. Could that be causing this problem? This is my step-by-step process for making the parts:

  Hide contents
  1. Make part in Blender. So far all my models have only been made up of one primitive.
  2. Export Blender shape as .dae.
  3. Start new Unity project and import KSP PartTools and a folder with .dae and basic texture.
  4. Create empty GameObject in Unity and add component -> KSP -> PartTools. Select GameData folder and output directory. Name model.
  5. Drag .dae on to GameObject. Unity says is has too many vertices (for the concaveDisk) and slits the sphere (it's half a sphere) in to two meshes. This does not happen for the structuralDisk model. 
  6. Add collision mesh to the 'cylinder'. I use 'Mesh Collider' with 'convex' ticked.
  7. Select 'Bumped Specular' shader for the 'cylinder' and add texture. Everything looks good so I export as .mu. 

Here is an image of the Unity hierarchy:

L4ux44d.png

I am not really sure what is wrong. As I said, I've done the same thing as I did before. Could be the fact I'm on 1.2.1 now too. I didn't think that changed anything with the parts though. Any ideas? @Phineas Freak? Thanks,

Benji13.

ow now this may work delete the camera and the lamp.

fnFw5Aw.png

the tex must be set to this.

55CXxKs.png

Edited by Gamax19
Link to comment
Share on other sites

Ok, I just redid the whole Unity part of production with no lamp, no camera, PNG texture and Diffuse Shader. Loaded it up and...

It works! Thanks everyone that helped. Although I probably have to completely redo the whole thing from scratch to be able to implement FSmeshswitch for a concave disk (and maybe triangles. Any thoughts?). Thanks again,

Benji13. 

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