Jump to content

Somewhere to put any knowledge learned about using the .mu plugin.


Recommended Posts

8 hours ago, ColdJ said:

The config file and the drag cubes can be adjusted to compensate. COP can be moved. Look at the stock Squad command pods for examples. They are adjusted so that the bottom of the pod stays facing down when falling to the ground. I don't know how to calculate drag cubes directly but you can either look in the "PartDatabase.cfg" file (found in the main Kerbal Space Program folder) for the drag cube of a part that is shaped as you want, and then copy and paste it's drag cube into your part config, or create a shape in the 3d model program that is what you need, give it a simple config and let it get loaded up, then go and find it's drag cube in the PartDatabase.cfg file and copy it into your models config. Also you can add the module for lift, e.g

    MODULE
    {
        name = ModuleLiftingSurface
        useInternalDragModel = False
        deflectionLiftCoeff = 0.6
        dragAtMaxAoA = 0.1
        dragAtMinAoA = 0.03
    }

So that your part has wing like properties.

Using these methods I have comfortably flying Star Wars models that would act like flying bricks without them.

Remember that the properties you want don't have to match the external look of your model.

Good Luck.

Sorry, I wasn't clear. It flies fine in stock (heavily using the tricks you described). It's the real design I'm not convinced about, and FAR (and especially Realism Overhaul) seems to agree with me.

7 hours ago, Stone Blue said:

This whole thing could be avoided, if actual *source* files (.blend/.obj/.fbx) were originally available for all these old mods we are trying to update/fix.
Thats why its a good idea to do repos (ala Github or similar), and host these files, or even the Unity project(s)...
Not many modders have, or even to this day, do that, unfortunately :(

FYI @Waifu Art Thou Romeo @darthgently

Yeah, no question this is an extremely hacky way to update these mods. Thank you for the explanation. I think that might be another nail in the coffin of the one I've been working on. In reparenting all the parts in the models, I don't see a way around constant exports/imports to make sure everything ends up in the right places

Link to comment
Share on other sites

1 hour ago, ColdJ said:

By the way, how exactly do you manipulate them? What needs doing to make them not Ngons?

Ngons are faces with more than 4 vertices. Hmmm.. they might export... i usually get a warning, and fix them. Having extra verts on a face, may mess with face/edge/vert normals, shaders, or other weirdness... I dont know. I was just alwaays taught from the start, at least for Unity/KSP:  " Ngons, BAD!..." :P

to fix them, you either eliminate the extra verts, but usually cant, because they are usually there, because *other* geometry intersects/connects ther. The way to fix, is to delete the Ngon face, and make new faces... there may be other options, but i just sdelte the face, and redo it as a couple faces, or tris... vOv

So, I guess faces need to have *exactly*, either 3 verts (a tris), or 4 verts (a quad)

EDIT: wait, now that I think of it, Unity converts *everything* to tris.... so having Ngons & polygons, which cant evenly be converted, leaves extra verts, which Unity may not kknow what to do with...? Idk... vOv

Edited by Stone Blue
Link to comment
Share on other sites

15 hours ago, Stone Blue said:

Ngons are faces with more than 4 vertices.

Finally a decent explanation on what Ngons are. I had seen some confusing info on how to theoretically get rid of them but not clear on what they were.

Now that I know what to look for I went in to places where I knew I should definitely have them and found they were taken care of. It seems the same thing that converts everything to Tris on import/export (whichever it is) fixes the NGons by putting extra edges in to compensate. Some were very small and subtle but they were there. So even though it warns you, it fixes them itself.

Link to comment
Share on other sites

13 minutes ago, ColdJ said:

Now that I know what to look for I went in to places where I knew I should definitely have them and found they were taken care of. It seems the same thing that converts everything to Tris on import/export (whichever it is) fixes the NGons by putting extra edges in to compensate. Some were very small and subtle but they were there. So even though it warns you, it fixes them itself.

Hmmm... The question is, if it adds unexpected edges, which would also means unexpected *faces*, I have to wonder how that affects things like the UV map, and seams.
Like, would it change how the faces/textures look in-game, and give you odd shading &/or unwanted visual artifacts?

Since that seems unknown to me, it would seem to me, it would be better to be safe, and just manually have them fixed yourself, before export, so you *know* how everything *should* look..?? vOv

Link to comment
Share on other sites

2 minutes ago, Stone Blue said:

Since that seems unknown to me, it would seem to me, it would be better to be safe, and just manually have them fixed yourself, before export, so you *know* how everything *should* look..?? vOv

Nope. it puts them in the right places on the UV map and doesn't cause dramas, probably uses the info from the face it is adjusting. That is why I never noticed till I knew what to look for, it does it so seemlessly that I hadn't noticed.

Link to comment
Share on other sites

2 hours ago, Stone Blue said:

SO I ased a well-know KSP modder, and its seems Unity automatically fixing ngons, while not a big problem, and probably not doing it all the time, *could* potentially show tessalation issues in-game... vOv

It has successfully worked on probably 100 plus models so far. It isn't tiling to cover gaps, it is breaking up a face with edges to remove the Ngons, the same thing I would do manually. If I get any issues I will happily share what has happened. Best you try it on some simple model yourself and see what results you get. I came to these things through trial and error, without knowing the rules, sometimes that uncovers things that the formal instructions might overlook. It is like the Edge loop tool, sometimes it works, sometimes it doesn't, but you can also use an aborted Bisect to give you vertices along a line you want. Not it's intended purpose but gets the result needed.

Link to comment
Share on other sites

On 2/28/2022 at 6:45 PM, ColdJ said:

Shader set up for a mirror texture.

Start with standard KSP background colours. Easiest thing is to import  a stock foil tank and use it's material to build off. Set your main texture to a light grey pic and your specmap to a slightly darker grey pic. The bump map is the standard light lavender, probably not even needed but I couldn't be bothered removing it. And then set it up with the following. Remember you have to give it a new name over in MU Shader, which is within Materials, if you want your changes to stick.

GKqkDNF.jpg

You know this won’t work in KSP right? 

Link to comment
Share on other sites

2 minutes ago, cineboxandrew said:

You know this won’t work in KSP right? 

Then how do you explain this?

tFkxVfb.png

I only put it up after testing that it worked. @cineboxandrew

While we are here, How do you stop the all over decal skin you made from covering windows?

0evE1ZW.pngqn8ALBk.pngXzdzrbb.png

Link to comment
Share on other sites

13 minutes ago, cineboxandrew said:

That’s not the shader you made. That’s what you get when you use the standard shader in KSP. Shader information is not included in mu files, it has to be loaded through asset bundles

You've lost me. That is the shader I used. I build in a fork of blender using the .mu plugin. The shaders are part of the materials that the models use.

I made that shader using info gained from the Squad foil tanks and a refective texture used by Cold War Aerospace. If that is not what is in the .mu file then how did making it and having it part of the material set up cause it to be reflective in game. How come I can transfer the material set up to other models and have them be reflective in game?

Is this some kind confusion? I didn't say I invented a shader, I said it is a shader set up in the shader section of the materials in the 3d program that KSP displays in game as being reflective. I have showed you the pics of it in game working. The set up is a screen shot from the shading section.

You are telling me it can't work when I am showing you proof it did. I don't understand your point of view on this?

Link to comment
Share on other sites

1 minute ago, ColdJ said:

You've lost me. That is the shader I used. I build in a fork of blender using the .mu plugin. The shaders are part of the materials that the models use.

I made that shader using info gained from the Squad foil tanks and a refective texture used by Cold War Aerospace. If that is not what is in the .mu file then how did making it and having it part of the material set up cause it to be reflective in game. How come I can transfer the material set up to other models and have them be reflective in game?

Is this some kind confusion? I didn't say I invented a shader, I said it is a shader set up in the shader section of the materials in the 3d program that KSP displays in game as being reflective. I have showed you the pics of it in game working. The set up is a screen shot from the shading section.

You are telling me it can't work when I am showing you proof it did. I don't understand your point of view on this?

The mu files do not contain shaders. They only contain the name of the shader. What you are seeing is a result of an invalid shader, which defaults to a mirror effect. You cannot design Unity shaders in blender, it is not possible. 

Link to comment
Share on other sites

3 minutes ago, cineboxandrew said:

The mu files do not contain shaders. They only contain the name of the shader. What you are seeing is a result of an invalid shader, which defaults to a mirror effect. You cannot design Unity shaders in blender, it is not possible. 

I don't know about "Design" but you do know the .mu plugin comes with KSP shader set ups installed right?

Just today I created a new material set up using the KSP Translucent Shader set up that comes with it and it shows up as see through in game.

Are you using the plugin or are you using Unity and part tools?

 

Link to comment
Share on other sites

You keep avoiding answering my questions and I have seen adjustments done in blender change shininess, opacity and more in game. The original set up by Cold War Aerospace caused the reflection to actually be a distorted lens of what was behind the model rather than a proper reflection, when I adjusted it it became a proper reflection.

I believe that your information may be out of date.

What I have been doing has been working so I will go with that.

All anybody has to do to see if it works is try it out in the program using the set up I have outlined for BforArtists 2 V2.70 or blender 2.93 alpha with the .mu plugin and see for themselves what result they get.

I am sorry if this comes across as curt but you keep saying it is not possible even though I have seen the results many times and it is just getting tiring.

@cineboxandrew

Link to comment
Share on other sites

13 minutes ago, ColdJ said:

The original set up by Cold War Aerospace caused the reflection to actually be a distorted lens of what was behind the model rather than a proper reflection

That’s what happens when you use the mapped specular shader with no normal map. I’m guessing the plug-in corrects that on export 

Link to comment
Share on other sites

@cineboxandrew I took a moment to throw this together to show you that your info is out of date. The following example uses the exact same shader as a base. KSP/Bumped Specular (Mapped) , the exact same texure pics for Main, SpecMap and BumpMap on exactly the same mesh. The only difference is the editing of the nodes in the blender program using the .mu plugin and saving as a .mu with a different name. As you can see in game, 1 looks like a polished metal and the other a mirror. If it was defaulting based on the shader name then they would look identical. I am sure that in blender without the plugin that what you say would be true, but it is obvious that the plugin has found a way to make it work.

zlolOES.jpg

metal setup.

t3z5lD5.jpg

mirror setup.

hDeziNU.jpg

Link to comment
Share on other sites

  • 2 weeks later...

Vertices get multiplied on export.

As has been referenced further back, the .mu plugin multiplies vertices, and it appears to do it on export. Apparently because it is adding extra info that is needed for KSP. Now apparently if a single mesh has over roughly 65,500 vertices on export it can't be read properly by the Unity engine and will end up jagged and distorted in game. This only applies to one mesh though. So if you cut your model into parts with each having roughly 10,000 vertices or less, then when the plugin exports and multiplies by roughly 5 to 6 times, then your individual pieces will each be below the roughly 65,500 limit and be able to read correctly. In game you won't be able to tell that it is made up of pieces. This is just cutting up without pulling things apart, still in the same place they were to start.

Link to comment
Share on other sites

  • 4 weeks later...

@Geonovast I will copy my reply here so that it might help others as well.

Ok, so in the blender environment. (I say this because I use a fork of it called BforArtists2 version 2.70, which is the equivalent of blender 2.93 alpha.) Using the .mu plugin.

Here is a pic showing the Mk1-3 pod imported in, you will notice on the right hand side I have clicked on the materials icon to bring up that section (in mine that is a brown, yellow and white pie chart.) The materials name it was given by it's author is "Mk1-3 Pod". That material name is the collection of all the shader settings used for the main pod. It also has a material setup called "no name" which is used for the flag mesh that is used in game so that you can change flags. In the second pic I have also imported another model into the same work area. It has the material name "octo". Now in the second pic you will see that there are 3 materials available because each model imported into the same work session, makes it's material setup available for use. I could click on the The material setup in the drop down for the Mk1-3 pod while having the Octo model highlighted and that would change that model to use the Mk1-3 Pod's material set up. Now of course it will be pointed to the texture files that the Mk1-3 pod uses, but you can go further down and change the name that the material looks for for it's texture pics, you can even edit the material name in that area shown in the pic and it will still retain all the colour, shininess etc settings from that material setup.

So if you are able to use blender with the .mu plugin. You can use this method to give your model the materials set up from the pod. My thread in this same section has all the links needed to set it up.

tPdSjgK.jpgglOWomm.jpg

Link to comment
Share on other sites

  • 2 weeks later...

@Stone Blue Have you by any chance tried the updated plugin in a blender 3 and above version?

BTW for another friend I have successfully converted some older type .dae models to the new standard.

Edited by ColdJ
Link to comment
Share on other sites

2 hours ago, Stone Blue said:

Yes... I've been using BFA v3.1.3 (based on Blender v3.2 Alpha), for awhile now...

Thank you. I have downloaded 3.1.3 and the new plugin seems to be working so far. Trying to remember how I got to the setup I like in the previous version.

Is there anything special about the latest version that you couldn't do in the previous, that you have noticed?

Link to comment
Share on other sites

29 minutes ago, ColdJ said:

Thank you. I have downloaded 3.1.3 and the new plugin seems to be working so far. Trying to remember how I got to the setup I like in the previous version.

Is there anything special about the latest version that you couldn't do in the previous, that you have noticed?

I havent quite figured that out... I just reinstall, open for the first time, re-setup everything on how I want it for start-up, then you can use "Save Startup File" in the Edit menu, and you're good to go... Remember to go thru and adjust/activate/deactivate your plugins before saving.

No, I havent run across any issues in the latest BFA release. (I also havent heard of any issues from other peeps using it in 3.0+ versions of Blender)

Link to comment
Share on other sites

1 hour ago, Watermel00n said:

When I try to export as .mu, this happens.

Hmm... i didnt even know that option was over there in the Export menu :P

Did you try the Export Mu button on top right, above the N-panel? Thats what I usually use

Link to comment
Share on other sites

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