Jump to content

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


Recommended Posts

9 hours ago, HIN0TORI said:

Could you explain the "Emission Map" in more detail again? I found info on it in this thread, but I couldn't see the picture and couldn't understand it.

I haven't been doing anything in blender for a while now and don't remember even talking about the subject. Could you link in your post the post in which you saw it, so I can work out what we are talking about?

Maybe it is named something else?

Link to comment
Share on other sites

  • 2 weeks later...

Hi @HIN0TORI.

Sorry I haven't been on a while. The post you saw is from @Kavaeric. They have their own page with the original info at their link.

https://kavaeric.notion.site/Notes-on-creating-engines-for-KSP-16f8338f483b473486ca9657674d85e2?pvs=4

A simpler way for you starting out is to import in any Squad .mu model that has heating effects, for example one of their engines, and look at their material properties setup. I looked at the "Twitch engine" and saw that it uses "KSP/Emissive/Specular. This contains 2 textures, The Main and the Emissive. The Emissive is the same as the main except it has brighter orange shaded areas. The game engine uses this texture as a reference to apply a heat effect to the engine, similar to the way it uses an emissive texture to create an effect for windows to look like they are lighting up. So when you have the correct module in the config and the correct mu shader setup with 2 referenced textures in the folder, the module will do the rest in game.

Hope this helps. Have a great end of year.

Link to comment
Share on other sites

  • 3 weeks later...

Hi @ColdJ.

I'm very new to Blender overall, and I could be doing something wrong here but I'm not sure.

whenever I'm done texturing and configuring something I always get this error when I try to export the .MU file. 

not sure what i'm doing wrong here. 

Screenshot_109.png?ex=65b543d9&is=65a2ce

Link to comment
Share on other sites

17 hours ago, CollectingSP said:

I'm very new to Blender overall, and I could be doing something wrong here but I'm not sure.

whenever I'm done texturing and configuring something I always get this error when I try to export the .MU file. 

not sure what i'm doing wrong here. 

I am not a coder so that is more of a @taniwha related question, asuuming they are around to answer it, they have been busy with other projects for some time.

This is their site.

Usually something like that turns up if you have forgotten a step somewhere. This one seems to relate to normals (faces) on one of your meshes. Suggesting you have started to change something but have not completed it. Assuming you have set up your materials. Try turning on "Face orientation" and seeing if anything is flipped or missing on your model surfaces.

Face orientation.

The blender enviroment does not make it obvious which way around your faces are orientated unless you turn on "Face Orientation." There are 2 versions it provides but I prefer the one that shows blue on the side that will be seen in KSP and red on the side that will be see through. It will not show in wireframe mode but will in "Solid" and "Material View" modes. Here is where to find the toggle.

hfvPruy.jpg

Can also be useful for finding places where meshes have gaps in them.

 

Edited by ColdJ
Link to comment
Share on other sites

okay, so I'm most certainly late to the party. especially as KSP2 is in early access. but is there any up to date info to get things working? I've tried adding the plugin to blender and bforartists, both throw errors when trying to import .mu files and won't complete the import. the errors all point to .py files in the plugin folders so i'm assuming the issue is compatability but maybe i've missed something along the way.

Link to comment
Share on other sites

23 minutes ago, Rventris said:

okay, so I'm most certainly late to the party. especially as KSP2 is in early access. but is there any up to date info to get things working? I've tried adding the plugin to blender and bforartists, both throw errors when trying to import .mu files and won't complete the import. the errors all point to .py files in the plugin folders so i'm assuming the issue is compatability but maybe i've missed something along the way.

I haven't updated anything since 3.1.3 and it all works fine for me. Can't comment on anything newer.

If you have followed the instructions on the start page to install BforArtists.

It is best to download the Zip version, create a folder on the main hard drive (not in "Program Files" on a windows computer as it will mess up it's needed permissions) and then extract into the folder you have created. Once you have it in go through the folder structure so that you are in bforartists3_313\3.2\scripts\addons_contrib\ and then extract the .mu plugin into it.

This will put the folder  "io_object_mu-master" into there.

Now start BforArtists and under the "Edit" drop down tab, at the bottom you will see "Preferences", click on it and when it's window comes up, go half way down it and click on Add-ons, then at the top middle click "Testing" once it is clicked scroll down the list till you see "Import-Export MU models KSP" and click the check box. Once it has a tick in it, make sure you go in to it using the expansion triangle that is next to the tick box, then go down and click on the following, "Install KSP Shader Presets", "Install KSP Config Templates" and "Create Community Color Palettes".

Once you have done this go to the bottom left of the window and click on the small blue box with 3 parallel lines in it and then click on "Save Preferences" This way what you have just done will be loaded every time you open BforArtists and you won't have to keep doing it. Close the "Preferences" window and you are ready to go.

Then it should work, unless something has been changed recently.

Make sure you read and follow all the instuctions to edit the preferences to tick everthing needed. Same for making sure the plugin is in the correct folder.

The plugin I have is from July 2022.

and the BforArtists

https://github.com/Bforartists/Bforartists/releases/tag/v3.1.3

Hope you can get it working.

 

Anything to do with the code past this is not my area and is best looked for on here.

 

Link to comment
Share on other sites

@ColdJ

looks like my previous post hasn't had it's edit approved just yet, not sure if this or that will be the first but hey-ho.

so, this time i properly cloned the repo for the add-on instead of downloading it via browser as i did before.  from there i followed the same steps as i had before and was very worried when the add-on manager said there was a script missing from io_object_mu, which was new. as one does when something different happens I tried the import again... SUCCESS!

not sure why changing the download method for the plugin worked but thank you for taking the time to respond to my query :)

 

Link to comment
Share on other sites

13 hours ago, Rventris said:

not sure why changing the download method for the plugin worked but thank you for taking the time to respond to my query :)

You are welcome.

Link to comment
Share on other sites

Hey there it's me again. I've run into a new (to me) problem.

for now all i'm doing is making a new texture for a stock fuel tank. in B4artists it all looks good:

D6R4D1u.png

But when I take a look in-game it winds up looking like this:

46c9P2s.png

Don't get me wrong the "final product" I think looks kinda cool... It just isn't what I was aiming for and wondering what if anything i need to change to ensure the texture is applied correctly?

thanks in advance

Rventris

Link to comment
Share on other sites

18 hours ago, Rventris said:

Don't get me wrong the "final product" I think looks kinda cool... It just isn't what I was aiming for and wondering what if anything i need to change to ensure the texture is applied correctly?

thanks in advance

Rventris

I can see in the top pic that you did your mapping on a .DDS rather than a .PNG

Blender/BforArtists doesn't take into account that .DDS are flipped compared to .PNG/ .JPG and basically everything else. But the game automatically flips .DDS  So if you mapped onto a .DDS then your mapping won't be on the correct parts of the texture pic, even though they look right in B/Bfor.

So 2 choices. Either use some thing like Paint.net to flip (not rotate) the pic top to bottom, save, then open BForA and do your mapping, export, then go and flip it back and save.

Or use some thing like Paint.net to flip (not rotate) the pic top to bottom "Save As a .PNG with a slightly different name, then rename the original and then rename the new to the originals name (not suffix). Then go in and map. Leave it as a .PNG and you won't have to flip again.

 

Link to comment
Share on other sites

@ColdJ

With the flip attempted both ways what I end up with is either a black cylinder with the ends as intended or the whole things black.

I can't help but think that it's more than an image flip issue. simply because how it looks in the above pic is as if the image is being repeated at different angles around the tank while the ends are correct.

Maybe I need to remap entirely instead of just moving,scaling and rotating the maps from the imported model? If so not exactly sure how to clear the "old" ones to replace them myself.

 

Link to comment
Share on other sites

A little bit more poking around and I've discovered all I needed to do was use a .png and move the piece of my texture that was off to line up with the original models uvmap.

I feel like such a fool now. Should've been rather obvious that setting a uv map for a new instance of a model when the texture is for a stock part was going to go badly for me.

Link to comment
Share on other sites

13 hours ago, Rventris said:

A little bit more poking around and I've discovered all I needed to do was use a .png and move the piece of my texture that was off to line up with the original models uvmap.

I feel like such a fool now. Should've been rather obvious that setting a uv map for a new instance of a model when the texture is for a stock part was going to go badly for me.

Glad you got it, but you might want to reread what I wrote before, as it explained just that. A .DDS is upside down compared to all other formats, so when you see it in BForA it upside down compared to what it will be when used in the game. So it needs to be flipped before you map to it, then after you have mapped be flipped back. Then your mapping will be in the right place in game. Simpler to just use .PNG, then you won't need to flip.

Link to comment
Share on other sites

6 hours ago, ColdJ said:

Glad you got it, but you might want to reread what I wrote before, as it explained just that. A .DDS is upside down compared to all other formats, so when you see it in BForA it upside down compared to what it will be when used in the game. So it needs to be flipped before you map to it, then after you have mapped be flipped back. Then your mapping will be in the right place in game. Simpler to just use .PNG, then you won't need to flip.

no, I understood what you meant about .dds flipping that's why I took option two and just  stuck with .png for now. Save myself the extra step  :D 

But the flipping was only part of the issue.

i had drawn my texture to a modified uv map of an imported model, then using the texture on a stock model with its "stock" uv map in game, hence why i had weird rotated mirroring on the cylinder and the ends correct. the ends mapping i didnt change. but i did shift the section that covered the cylinder.

I've been exporting uv maps "as is" from stock models and drawing to them since and having much better luck.  :D

P1k0FnV.png

Still a few details to fiddle with but I'm pleased with my efforts so far, I figure by the time i've roughly doodled a few tanks & SRB's I'll know what to do when i go back over them to "tidy up".

Edited by Rventris
missed information
Link to comment
Share on other sites

  • 1 month later...

Two things.

First: I have mentioned before that the standard Squad empty used to designate where and in what direction thrust comes from, alway turns 90 degrees on export. I had always thought this was some quirk of them being built in Unity, rather than Blender. As such I use my own and they are named differently. But recently I tried to use one I put in myself, renamed to match their name "thrustTransform" and upon export it turned 90 degrees. It had not occured to me that the name of the empty could affect how it is exported. I have to assume this is some quirk in the .mu plugin, though why it would happen is a mystery to me. So simply, don't name your thrust empty "thrustTransform" and remember to adjust your config so that it uses what ever name you did choose, and you will be right.

Secondly: Rather lazily on my part, I had previously not bothered to look at the Depth Mask model that the Squad internals use to stop the entire internal from showing through, as such my internals could always be seen from all angles. I finally tried it and it makes for a much more realistic view from the outside. You simply take a section of the outside of your cab or cockpit that covers the areas you want blocked. Make sure it is set to layer 16, just like your internal and then import a Squad Depth Mask model. The Mk1 inline one for example. Then simply change the material property of your model to the "depthmask" material set up used by their mask. I do this because I can't see this material set up in the Shaders menu that comes with the .mu plugin. No need for any texture pics. This is because it just blocks the internal from being seen. Export to the folder you have your internal config in and add the model path to the config as a second MODEL. If unsure just look at a Squad cockpit internal config to see how they have done it. Load the game and if you remembered to adjust your Cockpit config to use your new internal config, you should get a good internal when you look out on the runway.

Link to comment
Share on other sites

  • 2 weeks later...

Putting this here so I don't have to search for it again. Parameters for part variation module.

Original post by @Electrocutor

// optional: In Advanced mode in the VAB/SPH, themes change the default theme of all available parts, and allow you to apply the theme en masse to the current craft
VARIANTTHEME
{
	// required: name of theme
	name = <theme name>

	// required: name of theme as displayed in GUI, can be constant or a #localized reference
	displayName = <localized name>

	// optional: description of theme, can be constant or a #localized reference
	description = <localized description>

	// required: colors to use in GUI, alpha not supported
	primaryColor = #rrggbb
	secondaryColor = #rrggbb
}

// all <path>'s should not include extension (f.e. MyMod/MyModel.mu would be MyMod/MyModel, MyMod/MyTexture_d.dds would be MyMod/MyTexture_d)
PART {
	// all possible variant models must be added
	MODEL {
		model = <variant model>
	}

	// multiple ModulePartVariants allowed; lower variants will override node settings from previous ones if they are the same; for example you cannot change TEXTURE.shader in one and TEXTURE._Color in another, but can change GAMEOBJECTS.transform in one and TEXTURE._Color in another. JPLRepo has stated that while it is possible to have multiple ModulePartVariants, it is not recommended or intended.
	MODULE {
		name = ModulePartVariants

		// optional: name of VARIANT to use as default
		baseVariant = <variant name>

		// optional: name of default variant to display in GUI, can be constant or a #localized reference
		// default is 'Basic', only use if not specified a baseVariant
		baseDisplayName = <localized name>

		// optional: theme to which the default variant belongs
		baseThemeName = <theme name>
      
		// optional: whether to create multiple procedural drag cubes
		// default is true
		useMultipleDragCubes = <true/false>

		VARIANT {
			// required: default variant name is Basic, must be unique per part
			name = <variant name>

			// required: name of variant to display in GUI, can be constant or a #localized reference
			displayName = <localized name>

			// optional: name of theme to which this variant belongs; variants may only belong to one
			themeName = <theme name>

			// required: colors to use in right-click GUI, alpha not supported
			primaryColor = #rrggbb
			secondaryColor = #rrggbb

			// optional: allows grouping of like-variants. mostly used to disallow changing a variant to a non-like group while parts attached to surface.
			// GroupA, GroupB, GroupC
			sizeGroup = <group name>

			// optional: may be negative
			cost = <additional cost>
			mass = <additional mass>
      
			// optional: lists should be comma-delimited (but I haven't tested)
			disabledAnimations = <list of animations>
			disabledEvents = <list of module events> // format: <module name>.<event name>

			// optional: only one GAMEOBJECTS node per VARIANT
			GAMEOBJECTS {
				// set which transforms are visible/hidden
				<transform name> = <true/false>
			}

			// optional: arbitrary key,value pairs for use in PartModules/mods
			EXTRA_INFO {
				<info name> = <info value>

				// Known Examples (ModuleProceduralFairing)
				FairingsTextureURL = <path to _d>
				FairingsNormalURL = <path to _n>
			}

			// optional: only one NODES node per VARIANT, assumes scale=1.0, rescaleFactor=1.0
			NODES {
				// all optional: node adjustments per variant
				node_attach = x, y, z, angx, angy, angz, size
				node_stack_top = x, y, z, angx, angy, angz, size
				node_stack_bottom = x, y, z, angx, angy, angz, size
				node_stack_bottomXX = x, y, z, angx, angy, angz, size
				node_stack_connectXX = x, y, z, angx, angy, angz, size
			}

			// optional: multiple TEXTURE nodes allowed (for different materialName)
			TEXTURE {
				// optional: used to restrict this TEXTURE change to the named material within this part, otherwise all materials in this part
				// material names are usually the same as the mesh name to which they belong, but not always
                // note that this parameter automatically includes wildcards, so MyMat and MyMat2 would both change if set to MyMat; this can be worked around by adding an additional TEXTURE
				materialName = <name of material>

				// optional: change the existing material shader, only able to find built-in KSP shaders
				// shader short-list:
				// KSP/Alpha/Cutoff
				// KSP/Alpha/Cutoff Bumped
				// KSP/Alpha/Translucent
				// KSP/Alpha/Translucent Additive
				// KSP/Alpha/Translucent Specular
				// KSP/Alpha/Unlit Transparent
				// KSP/Bumped
				// KSP/Bumped Specular
				// KSP/Bumped Specular (Mapped)
				// KSP/Diffuse
				// KSP/Emissive/Bumped Specular
				// KSP/Emissive/Bumped Specular (Mapped)
				// KSP/Emissive/Diffuse
				// KSP/Emissive/Specular
				// KSP/Specular
				// KSP/Specular (Transparent)
				shader = <shader>

				<texture property> = <path>
				<color property> = #rrggbb // alpha not supported
				<float property> = 0.0

				// Known Examples
				_MainTex = <path to _d>
				_BumpMap = <path to _n>
				_Color = #rrggbb
				_SpecColor = #rrggbb
				_SpecMap = <path to _s>
				_Shininess = 1.0
				_EmissiveColor = #rrggbb
				_Emissive = <path to _e>
				_Opacity = 1.0
				_RimFalloff = 0.0
				_RimColor = #rrggbb
				_TemperatureColor = #rrggbb
				_BurnColor = #rrggbb
				_AmbientMultiplier = 0.2
			}
		}
	}
}
Link to comment
Share on other sites

  • 3 weeks later...
8 hours ago, kspbutitscursed said:

Hi i want to change a .MU file to something that Blender can understand without using this plugin

The only way to do that, that I know of, would be to use the plugin to load the .mu file. Once it is in Blender then you can export it as any of the other formats that blender recognises. You can also save it as a .blender file. Once exported to another format you could use it in blender or another program that recognises the format you saved in, without the .mu plugin.

Link to comment
Share on other sites

  • 2 weeks later...

@ColdJ Hey, I'm having this weird problem and I was wondering if you could help me.

I finished making a KK static in sketchup, then exported to blender with colliders and shaders having been set up in blender, and i think i set up the materials correctly too. I Exported it as a .MU and wrote a .CFG for it but  it just will not load in game for some reason and i'm not sure why.

Any help you can provide?  I can post screenshots or send you a link to the model privately, as I don't want it public yet.

 

Link to comment
Share on other sites

1 hour ago, CollectingSP said:

Any help you can provide?  I can post screenshots or send you a link to the model privately, as I don't want it public yet.

You can send me a copy and paste of the config file to my inbox if you like. There are many very simple things that can stop a model from showing up. Literally putting a comma instead of a full stop in the wrong place in say the node attach or node stack lines can stop it turning up. Forgetting to give it a unique name will do it. Not making sure it has starting and ending brackets etc.

As it is a static then compare your static to one from a mod and see if anything looks out of place. Make sure your config, .mu and textures are all in the same folder and that that folder is in the GameData folder.

If it was a material setup problem, not pointing to the right textures then it would turn up but just be a uniform gray colour.

Here is an example static config for a bridge I made that I know turns up, just a simple static.

STATIC
{
    mesh = CurveBW.mu
    module = Part
    static = true
    author = ColdJ
    title = Wide long Curve Bridge
    category = Air-racing
    cost = 0
    manufacturer = CJ Construction
    description = A wide long curve bridge
    name = CJWideCurveBridge
}

So try the those simple things first, one at a time. If you don't do one at a time then you wont be sure what you fixed if it works.

If none of that works then I will PM you a way to send me the entire .mu, config and textures so that I can have a look and see if something isn't set up right in blender.

9 hours ago, kspbutitscursed said:

after reinstalling in new location it still fails i dont know why

If you have installed from scratch using my guide it should work. If doing it the way you started has mucked it up then you will need to completely remove it and then reinstall it again.

There is a config folder that Bforartist sets up in  C:\Users\YOUR USER NAME\AppData\Roaming\Bforartists\Bforartists

That you may need to delete before starting fresh.

Also make sure that your blender/BforArtists is installed directly on your main drive, not within a different folder structure.

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