Jump to content

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


Recommended Posts

1 minute ago, ColdJ said:

Last I knew the .mu plugin cannot create and assign shaders not already a part of the game and have them stick on export.

That's the mystery for me but various changes to blender shader settings like glossiness actually work on import with KSP shaders. This is how stock cockpits have glossy windows using alpha channel of the texture to define which part of the texture should be glossy. And this is how I messed up and made the whole cockpit glossy instead of a canopy :D

Link to comment
Share on other sites

16 minutes ago, Manul said:

That's the mystery for me but various changes to blender shader settings like glossiness actually work on import with KSP shaders.

Yep, you have seen this in the thread before.

Only changing the settings in the right hand panel will stick though.

But you can't add new modules in blender you can only adjust levels in the supplied shaders.

20 minutes ago, Manul said:

And this is how I messed up and made the whole cockpit glossy instead of a canopy

Chop your meshes up into the parts you want to do what. Glass sections like canopies should always be separate so they can have a shader different from the body.

Link to comment
Share on other sites

37 minutes ago, ColdJ said:

Chop your meshes up into the parts you want to do what. Glass sections like canopies should always be separate so they can have a shader different from the body.

They aren't separate in stock, they just use the alpha channel of a texture to apply gloss to glass parts only. And I managed to give my cannopy a purple-golden AZO-alike gloss while keeping it in the same mesh as a non-glossy fuselage.

Spoiler

BF8enqs.png

 

Edited by Manul
Link to comment
Share on other sites

4 minutes ago, Manul said:

They aren't separate in stock, they just use the alpha channel of a texture to apply gloss to glass parts only. And I managed to give my cannopy a purple-golden AZO-alike gloss while keeping it in the same mesh.

Feel free to do a write up to clearly explain how you did that in blender.

But even if you can do that to have different parts of the same mesh look different, it is good practice to chop your mesh up. Makes it easier for editing parts without things you don't want edited getting in the way, helps to make sure you don't exceed the vertices cap, and makes it easier for those who don't have much experience to make complex looking models.

The mesh pieces are all part of the same.mu

Link to comment
Share on other sites

3 minutes ago, ColdJ said:

Feel free to do a write up to clearly explain how you did that in blender.

I took a Blender material setup from an existing cockpit. There is a line connecting the MainColor Alpha cahnnel to shader Gloss setting.

Spoiler

1Ga4a12.png

All parts of the texture that are not supposed to be glossy have their alpha set to 0 so they are 100% invisible in the Paint.net (I applied "invert alpha" after making them) while the canopy has 255 alpha setting.  And the golden tint was made by editing Unity setup in the right window

Spoiler

EyQnKTm.png

 

17 minutes ago, ColdJ said:

But even if you can do that to have different parts of the same mesh look different, it is good practice to chop your mesh up.

Yep, I had to cut a taxi light into 3 different meshes to get the result. But I preferred to not cut the cockpit because I was not sure back then how separating meshes affects the drag cube calculations. Now after some experiments I know that it (almost) doesn't affect dragcubes, only the combined shape of all meshes matters.

Link to comment
Share on other sites

@Manul

I tried that FSAnimate and though it spins a bit longer it still comes to a stop.

With all sincerity I ask that you create a new thread in this section on Advanced Texture Teqniques in Paint.net

Though I can see in BforArtists the complete texture I do not know how to see the whole thing in Paint.net nor do I know how to create one using the method you have descibed.

I can create the effect using the methods I am used to but not that way.

1 hour ago, Manul said:

But I preferred to not cut the cockpit because I was not sure back then how separating meshes affects the drag cube calculations. Now after some experiments I know that it (almost) doesn't affect dragcubes, only the combined shape of all meshes matters.

Glad you have seen this for yourself.

Link to comment
Share on other sites

7 hours ago, ColdJ said:

Haven't heard back from you.

Had been busy with real life™ things like a power grid failure after the storm :confused:

7 hours ago, ColdJ said:

advanced texturing

I don't actually posses any advanced texturing skills, don't even know how to deal with layers. I have some experience with CAD software that helps me putting polygons together but I have absolutely no experience with placing pixels the right way,  just one little trick I learned while I was looking at "invisible" textures that are used in stock and by many mods like OPT spaceplanes, NMB and many others that have stockalike textures.   The trick is simple:

clicking "Invert Alpha" option allows to turn this

jxM7upF.png

Into this:

QsWLMTP.png

So the general idea is to draw fuselage and other non-glossy parts then invert alpha and draw windows. Using material properties of any stock cockpit will make these textures work as they are supposed to.

Link to comment
Share on other sites

1 hour ago, Manul said:

So the general idea is to draw fuselage and other non-glossy parts then invert alpha and draw windows. Using material properties of any stock cockpit will make these textures work as they are supposed to.

Ahh, my version of  Paint .net doesn't have that option, so that explains that. I am on Windows 8.1 so I won't be updating it to the latest. I will have to live without that technique.

Link to comment
Share on other sites

@JonnyOThan

As you have alot of experience with props, would you know why the rotation of the props in editor do not match the rotation in the configs?

Does the line in props

proxy = 0, 0, 0,     0.075, 0.01, 0.09,     1.0, 0.5, 0

Have anything to do with it?

Link to comment
Share on other sites

1 hour ago, ColdJ said:

rotation of the props in editor do not match the rotation in the configs?

Can you be more specific?  The rotation of props in the cfg file is specified as a quaternion instead of Euler angles that are sometimes used elsewhere.  Exporting from parttools should generate these correctly.

I’m not sure what the proxy stuff does.

I think there is some discrepancy between parttools and the game if the root object in the .mu file has a rotation on it, so for best results make sure you’re exporting things with no rotation on the roots.

Link to comment
Share on other sites

Posted (edited)
4 hours ago, JonnyOThan said:

Can you be more specific?

bJFH7zJ.jpeg

In the Blender environment I always work in Quarterions and no matter how you leave the top of your heirarchy, on export it will always be set to W:1.000, X:0.000,Y:0.000,Z:0.000

This is why any model I create has 2 Empties at the top. The very top always left at the default rotation, the second empty parented inside the first and then everything else parented inside the second so that the entire model can be rotated or resized as one. (The only exception is when making wheels, The wheel collider goes inside the first but outside the second.) This makes sure that however you set up the model on export, it will be the same in game.

Stock Props come a few different ways, the functional ones use the same system I do, but static ones like the Pilot Chair only have the mesh.

For most displays it ends up like this.

Trouble is it is not consistent and some props are set up differently. For things like Atmosphere depth and Speed readout it is "first is second and negative in BFA2(X), last is first (W)"

e.g

    PROP
    {
        name = ledPanelSpeed
        position = 0.0,0.07,-1.9813
        rotation = 0.707,0,0,0.707
        scale = 1,1,1
    }

In this example the first number 0.707 is in blender in the X rotation box and a negative number. The last number 0.707 is found in the W rotation box and the same positive.

Now in the pic above you can see the prop Seat_Pilot is set to W:0.000, X:0.000, Y:0.000, Z:-1.000 in order to be in the correct orientation for the internal model, but in the configuration it has to be written

0.000, 1.000, 0.000, 0.000

I have a theory that in the configuration for the displays the W value is moved to the end and that the other 3 are are always the inverse. e.g 1 = -1. But I haven't experimented enough to be sure.

I had hoped you might know, but if Unity/PartTools does it all for you then I guess you have not come across this before.

I had thought you might know what the "Proxy" line is for, but it appears that is another mystery.

Thank you for getting back to me.

 

Edited by ColdJ
Link to comment
Share on other sites

@Princedave

Going to need alot more details to help you, did you create this image yourself or are you trying to look at a stock texture?

Is it in the image editor or is it in the game?

Etc

It may just be an inverted alpha channel if it is you looking at a stock texture pic.

Link to comment
Share on other sites

On 7/6/2024 at 6:31 PM, ColdJ said:

first is second and negative in BFA2(X), last is first (W)"

Yes that’s because of the different coordinate systems. You can’t directly take the blender quaternion and use it in a cfg.  If you’re using blender there is a “show model transform” button that outputs the correct values to use in a cfg on the blender log.

Link to comment
Share on other sites

26 minutes ago, JonnyOThan said:

 If you’re using blender there is a “show model transform” button that outputs the correct values to use in a cfg on the blender log

We discussed this before. It outputs in degrees rather than quaternions. So I could use it for part stacking in a config, but not for prop placement.

Link to comment
Share on other sites

52 minutes ago, ColdJ said:

We discussed this before. It outputs in degrees rather than quaternions. So I could use it for part stacking in a config, but not for prop placement.

No, it outputs both.

Link to comment
Share on other sites

2 hours ago, JonnyOThan said:

No, it outputs both.

I scrolled through the whole output, the only place I found rotation was at the very end in degrees.

If you believe it can be found in there, please explain where and a picture to help us noobs find it.

Link to comment
Share on other sites

9 hours ago, ColdJ said:

I scrolled through the whole output, the only place I found rotation was at the very end in degrees.

If you believe it can be found in there, please explain where and a picture to help us noobs find it.

I don't know if it's different in BFA cause I don't use that. https://imgur.com/a/rj1gZzg

Link to comment
Share on other sites

13 minutes ago, JonnyOThan said:

I don't know if it's different in BFA cause I don't use that.

That is method I use to get there, but sadly mine only shows degrees.

I am using version 3.13, and I think I am using the last version available of the plugin. I will check, I wonder if there is some setting I need to enable.

Link to comment
Share on other sites

Just copying this here so it is easy for me to find again.

Allow color tinting on all parts: stock or mod.

oPpUHlQ.jpg

 

Requires:
ModuleManager

 

Instructions:

  • Create a new text file under \GameData with extension .cfg (f.e. ColorTinting.cfg)
  • Copy and paste one of the following into the file and save it.

 

Natural Color System (NCS)

  Hide contents
// Natural(NCS) Colors
@PART[*] {
	%MODULE[ModulePartVariants] {
		%name = ModulePartVariants

		VARIANT {
			name = NCS_Black
			displayName = Black

			primaryColor = #323232
			secondaryColor = #323232

			TEXTURE {
				_Color = #323232
			}
		}
		VARIANT {
			name = NCS_Red
			displayName = Red

			primaryColor = #c40233
			secondaryColor = #c40233

			TEXTURE {
				_Color = #c40233
			}
		}
		VARIANT {
			name = NCS_Green
			displayName = Green

			primaryColor = #009f6b
			secondaryColor = #009f6b

			TEXTURE {
				_Color = #009f6b
			}
		}
		VARIANT {
			name = NCS_Blue
			displayName = Blue

			primaryColor = #0087bd
			secondaryColor = #0087bd

			TEXTURE {
				_Color = #0087bd
			}
		}
		VARIANT {
			name = NCS_Yellow
			displayName = Yellow

			primaryColor = #ffd300
			secondaryColor = #ffd300

			TEXTURE {
				_Color = #ffd300
			}
		}
	}
}

 

 

Pigments (CMYK)

  Hide contents
// Pigment(CMYK) Colors
@PART[*] {
	%MODULE[ModulePartVariants] {
		%name = ModulePartVariants

		VARIANT {
			name = CMYK_Black
			displayName = Black

			primaryColor = #323232
			secondaryColor = #323232

			TEXTURE {
				_Color = #323232
			}
		}
		VARIANT {
			name = CMYK_Red
			displayName = Red

			primaryColor = #ed1c24
			secondaryColor = #ed1c24

			TEXTURE {
				_Color = #ed1c24
			}
		}
		VARIANT {
			name = CMYK_Magenta
			displayName = Magenta

			primaryColor = #ff0090
			secondaryColor = #ff0090

			TEXTURE {
				_Color = #ff0090
			}
		}
		VARIANT {
			name = CMYK_Blue
			displayName = Blue

			primaryColor = #333399
			secondaryColor = #333399

			TEXTURE {
				_Color = #333399
			}
		}
		VARIANT {
			name = CMYK_Cyan
			displayName = Cyan

			primaryColor = #00b7eb
			secondaryColor = #00b7eb

			TEXTURE {
				_Color = #00b7eb
			}
		}
		VARIANT {
			name = CMYK_Green
			displayName = Green

			primaryColor = #00a550
			secondaryColor = #00a550

			TEXTURE {
				_Color = #00a550
			}
		}
		VARIANT {
			name = CMYK_Yellow
			displayName = Yellow

			primaryColor = #ffef00
			secondaryColor = #ffef00

			TEXTURE {
				_Color = #ffef00
			}
		}
	}
}

 

 

KSP Colors (this is the one most people would want)

  Hide contents
// KSP Colors
@PART[*]:HAS[!MODULE[ModulePartVariants]] {
	MODULE {
		name = ModulePartVariants

		VARIANT {
			name = KSP_Black
			displayName = Black

			primaryColor = #2d2e2d
			secondaryColor = #2d2e2d

			TEXTURE {
				_Color = #2d2e2d
			}
		}
		VARIANT {
			name = KSP_MetalGrey
			displayName = Metal Grey

			primaryColor = #7b7d7b
			secondaryColor = #7b7d7b

			TEXTURE {
				_Color = #7b7d7b
			}
		}
		VARIANT {
			name = KSP_DarkGrey
			displayName = Dark Grey

			primaryColor = #4c4f47
			secondaryColor = #4c4f47

			TEXTURE {
				_Color = #4c4f47
			}
		}
		VARIANT {
			name = KSP_Orange
			displayName = Orange

			primaryColor = #f49841
			secondaryColor = #f49841

			TEXTURE {
				_Color = #f49841
			}
		}
		VARIANT {
			name = KSP_Green
			displayName = Green

			primaryColor = #737a5a
			secondaryColor = #737a5a

			TEXTURE {
				_Color = #737a5a
			}
		}
		VARIANT {
			name = KSP_Yellow
			displayName = Yellow

			primaryColor = #e3b85f
			secondaryColor = #e3b85f

			TEXTURE {
				_Color = #e3b85f
			}
		}
		VARIANT {
			name = KSP_Red
			displayName = Red

			primaryColor = #a52a29
			secondaryColor = #a52a29

			TEXTURE {
				_Color = #a52a29
			}
		}
		VARIANT {
			name = KSP_Blue
			displayName = Blue

			primaryColor = #394563
			secondaryColor = #394563

			TEXTURE {
				_Color = #394563
			}
		}
		VARIANT {
			name = KSP_Cyan
			displayName = Cyan

			primaryColor = #567988
			secondaryColor = #567988

			TEXTURE {
				_Color = #567988
			}
		}
	}
}

@PART[*]:HAS[@MODULE[ModulePartVariants]:HAS[@VARIANT:HAS[!GAMEOBJECTS]]] {
	@MODULE[ModulePartVariants] {
		VARIANT {
			name = KSP_Black
			displayName = Black

			primaryColor = #2d2e2d
			secondaryColor = #2d2e2d

			TEXTURE {
				_Color = #2d2e2d
			}
		}
		VARIANT {
			name = KSP_MetalGrey
			displayName = Metal Grey

			primaryColor = #7b7d7b
			secondaryColor = #7b7d7b

			TEXTURE {
				_Color = #7b7d7b
			}
		}
		VARIANT {
			name = KSP_DarkGrey
			displayName = Dark Grey

			primaryColor = #4c4f47
			secondaryColor = #4c4f47

			TEXTURE {
				_Color = #4c4f47
			}
		}
		VARIANT {
			name = KSP_Orange
			displayName = Orange

			primaryColor = #f49841
			secondaryColor = #f49841

			TEXTURE {
				_Color = #f49841
			}
		}
		VARIANT {
			name = KSP_Green
			displayName = Green

			primaryColor = #737a5a
			secondaryColor = #737a5a

			TEXTURE {
				_Color = #737a5a
			}
		}
		VARIANT {
			name = KSP_Yellow
			displayName = Yellow

			primaryColor = #e3b85f
			secondaryColor = #e3b85f

			TEXTURE {
				_Color = #e3b85f
			}
		}
		VARIANT {
			name = KSP_Red
			displayName = Red

			primaryColor = #a52a29
			secondaryColor = #a52a29

			TEXTURE {
				_Color = #a52a29
			}
		}
		VARIANT {
			name = KSP_Blue
			displayName = Blue

			primaryColor = #394563
			secondaryColor = #394563

			TEXTURE {
				_Color = #394563
			}
		}
		VARIANT {
			name = KSP_Cyan
			displayName = Cyan

			primaryColor = #567988
			secondaryColor = #567988

			TEXTURE {
				_Color = #567988
			}
		}
	}
}

// if has variants and has a variant that sets gameobjects, then do this; otherwise, just add normally

@PART[*]:HAS[@MODULE[ModulePartVariants]:HAS[@VARIANT:HAS[@GAMEOBJECTS]]] {
	@MODULE[ModulePartVariants] {
		+VARIANT,0 {
			@name = KSP_Black
			@displayName = Black

			@primaryColor = #2d2e2d
			@secondaryColor = #2d2e2d

			%TEXTURE {
				%_Color = #2d2e2d
			}
		}
		+VARIANT,0 {
			@name = KSP_MetalGrey
			@displayName = Metal Grey

			@primaryColor = #7b7d7b
			@secondaryColor = #7b7d7b

			%TEXTURE {
				%_Color = #7b7d7b
			}
		}
		+VARIANT,0 {
			@name = KSP_DarkGrey
			@displayName = Dark Grey

			@primaryColor = #4c4f47
			@secondaryColor = #4c4f47

			%TEXTURE {
				%_Color = #4c4f47
			}
		}
		+VARIANT,0 {
			@name = KSP_Orange
			@displayName = Orange

			@primaryColor = #f49841
			@secondaryColor = #f49841

			%TEXTURE {
				%_Color = #f49841
			}
		}
		+VARIANT,0 {
			@name = KSP_Green
			@displayName = Green

			@primaryColor = #737a5a
			@secondaryColor = #737a5a

			%TEXTURE {
				%_Color = #737a5a
			}
		}
		+VARIANT,0 {
			@name = KSP_Yellow
			@displayName = Yellow

			@primaryColor = #e3b85f
			@secondaryColor = #e3b85f

			%TEXTURE {
				%_Color = #e3b85f
			}
		}
		+VARIANT,0 {
			@name = KSP_Red
			@displayName = Red

			@primaryColor = #a52a29
			@secondaryColor = #a52a29

			%TEXTURE {
				%_Color = #a52a29
			}
		}
		+VARIANT,0 {
			@name = KSP_Blue
			@displayName = Blue

			@primaryColor = #394563
			@secondaryColor = #394563

			%TEXTURE {
				%_Color = #394563
			}
		}
		+VARIANT,0 {
			@name = KSP_Cyan
			@displayName = Cyan

			@primaryColor = #567988
			@secondaryColor = #567988

			%TEXTURE {
				%_Color = #567988
			}
		}
	}
}

 

 

Edited April 4, 2018 by Electrocutor
Link to comment
Share on other sites

On 7/9/2024 at 10:27 AM, JonnyOThan said:

No, it outputs both.

Solved it now. I have downloaded the latest version of the plugin and it is now turning up in the log like it shows in yours.

Thank you.

Link to comment
Share on other sites

@ColdJ
 

New issue. how can I get the object data to link with the "Terrain_Grass_00 mesh", like it's linked for all of the others?

I've been trying to get it to work the last 5 hours and i can't figure it out.

xZnZn5x.png

 

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