Jump to content

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


Recommended Posts

It is very hard to find any unified thread to give you much info on how to make KSP parts in the blender enviroment. This thread will attempt to put knowledge learned through trial and error from me and hopefully anybody out there who has experience in to one place in the hope that together we can help each other out. It will have no particular order as it is just as we go. I am just like you, a relative beginner, stumbling through, but I have worked out some things over the last few months. I use the last BforArtist 2 version known to work with the .mu plugin, version 2.7. It is a fork of and the equivalent of Blender 2.93 alpha.

All info, from anybody with knowledge of using this system is very welcome.

I cannot guarantee that questions will be answered quickly, if this thread has a decent size by the time you see it, please look through to see if your question already has been covered.

 

Edited by ColdJ
Link to comment
Share on other sites

Reserved for index

Update added 04/03/2024

There have been some updates and clarifications since the thread started. I will try to slowly add them here.

First off @taniwha has released a newer version of the .mu plugin. Found through this link.

https://github.com/taniwha/io_object_mu

You click on the green "Code" button and then download the Zip file in drop down.

(for those who understand coding and would like to see how the plugin is being upgraded over time, use this link the logs. )

This version requires a Blender or BforArtist version greater than 3 to work.

As the BforArtist version is much easier for someone starting out to get a handle on I will put the link for version 3.1.3 here. Remember it is Blender , just with an easier to use interface. Leaving this link for now as it is the one I currently use. @Stone Blue and others have used the latest plugin on all BforArtist versions up to the latest and it is working, so lastest release link below this one.

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

 

BforArtists latest release page.

You can find a link on this page for older versions too.

https://www.bforartists.de/download/

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.

All blender releases.

https://download.blender.org/release/

Save and Edit

Now I have been told many times to do all your editing work in a .blender file and only Export as a .mu file when you believe you have got the model the way you want it. It is good practice to save often and when you have major changes to make new saves with increasing numbers at the end of it's title, that way if anything goes very wrong you can go back to a previous iteration to recover. Saving often is important, I personally have been over an hour into work many times, only to have the program shut down without any warning, so losing anything not saved.

If I understand correctly, Blender can hold much info about a vertice (the dots in editing mode that are points where edges join together to create faces.) but that the unity engine that KSP runs off can only read a limited amount per vertice. As such when the .mu plugin Exports it creates extra vertices at the identical points in virtual space, each extra vertice contains different bits of info so that the Unity engine can get the whole picture. Now there is a limit as to how many vertices Unity can render per mesh section, it is roughly 65,500 vertices. (I can never remember the exact amount) and as the export can multiply each vertice 5 to 6 times, it is good practice to limit the amount of vertices to 10,500 per section. This does not mean the entire model has to be less than this, just that it be cut into pieces with each being less than this. On export you will get a yellow warning dialogue pop up if a section exceeds the limit.

Heirachy

When creating models for KSP it is always best to start with an empty axis as the top of your heirachy. Best practice is to have 2, 1 within the other and then your meshes within that second one, this allows for manipulating positions and sizes of the parts of your model and having them stay as you left them. When a save file is loaded it likes the top of a heirachy to be exactly oriented as it was when first created, having your meshes under the heirachy will mean they are loaded in the orientation you left them in. The second empty allows you to manipulate the entire model as 1 thing so that everything under it can be moved and resized as one piece.

To add an empty axis you need to, go to the lower header near the top of the work space and click on "Add", then roughly half way down hover over "Empty" then on it's drop down click on "Plain Axes". This will add a plain axis in to the heirachy on the right hand side of the workspace. Go over and double click to make it editable and then rename it to suit your project name. If you already have meshes you can simply hold down shift, left click and hold on them to drag them over the axis and then release the click to have them now inside your new axis heirachy. It is also best to have any animations you do be within a double empty as to buffer it from being changed on loading a save.

Apply Scale

Before you add your colliders and export as a .mu it is best to use the function provided by the plugin to "Apply Scale", this makes sure that no matter what size your pieces ended up as, they can be set to be considered 1 in all dimensions. The reason to do this before adding colliders is because if the colliders are already there when you do this they will be reset and you will have to redo them to get them back to how you had them.

Towards the top right are 4 boxes in blue, one says "Mu Heirachy" Click on it and then click on "Apply Scale", when you have a mesh piece highlighted, to set it to being considered 1 in all dimensions.

Importing things from other models.

It can save you a lot of time to take things from already existing models and drag them in to your own. You do this by having your model loaded and then importing another model in that has things you would like to add to your own. Everything from thrust transforms, docking transforms, ladder and airlock colliders, or even mesh pieces. Now with transforms and those colliders. it is important which way around they are because the game uses their orientation to determine which way to apply things. The blender enviroment has the Z axis and Y axis reversed compared to Unity, so several things are orientated along Y. Positive Y is the direction a Kerbal will face when leaving an airlock or climbing a ladder. Positive Y is also the side of a docking transform that will attract and join to another docking port. The docking transform (thrust transform too) tends to be loaded with no obvious direction, so you need to highlight it and then on the small menu on the right click on the symbol that looks like three lines joined in the centre in a triangular shape. This is called the "Object data properties" within it is a drop down marked as "Display As" It's default will be "Plain Axes", you will want to change it to "Arrows" so you can now see the axies.

Quite often when you drag things across (done by highlighting the thing then holding shift and left click holding it before dragging it in the heirachy menu till you are over the section you want it moved to. You then release the click to have it reparent itself where you released it.) they seem to keep the same orientation but after you export, if you were were to import your new export, you will find these dragged in things both not where you left them and often pointing in a different direction. To try to stop this from happening, once dragged in to your heirachy,

Towards the top right are 4 boxes in blue, one says "Mu Heirachy" Click on it and then click on "Clear Inverse", this should clear the orientation kept from it's old heirachy and set it to how it looks right now in your session. That way it will be where you expect, next import.

Seeing your texture in the editor

There is an issue with some of the KSP shaders that mean if you don't do a thing in the shader section, they will only show as all black in "Viewport Shading, Display in Material preview mode" which is one of the four ball choices up near the top right of the workspace. The one with the little red and white checker pattern. Usually when you click on this, any UV mapping you have done will show your texture pic applied to your model. But on KSP shaders that make use of the "Vertex Color" parameter you get the black unless you detatch the "Color" link. This is fine because unless you rename the title of your shader set up it won't be saved and will be linked next time you load it. (atleast on loading a previously exported .mu, haven't checked a .blend file yet.)

So with a part of your model that has been given a UV map and texture pic previously, highlight it and then bring up the shader workspace ( Tab on the top Header labeled "Shading") and you will see a number of of rounded end boxes with link cables connecting them.  Look for a red one named "Vertex Color" and click and hold on the yellowish link, then drag it away to detatch. Now when you have "Viewport Shading, Display in Material preview mode" selected, you should see your texture applied to your model, but only the parts that share the same material setup. If you have parts that use a different material you will have to unlink theirs as well if they also use a shader with the "Vertex Color" parameter.

 

Simple UV mapping.

 

Making your UV map first then creating a texture pic to match.

Use this example.

 

Getting the Warning: "Ngons in the mesh, Tangents will not be saved."

Ngons are faces that have not been divided up into sections. Unity likes all faces to be divided up into triangular sections, thankfully the .mu exporting program will automatically triangulate all faces on export so even though you will get this warning it will be fixed in the exported .mu file.

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.

Spoiler

hfvPruy.jpg

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

Normals.

These relate directly to Face orientation. Here is the technical explanation.

"Normals in Blender represent lines that are created perpendicular to the geometry. The direction of the geometry determines the direction of the normal. Normals are used to determine the inward and outward sides of a face, edge, or vertex and can influence how geometry is rendered.

So a normal is created every time geometry is created and is used to determine which side of the geometry is the outward facing side. Let’s take a look at normals in more detail and find out why it is so important to understand normals."

Answer for people like me.

In relation to building models for KSP, Normals can be thought of as being the way of determining which way out the face that can't be seen through in KSP, is pointing. So when you use Face Orientation and see if what should be the outside of your mesh is correct = Blue, or incorrect = Red, you can flip the faces so they will be the other way around.

In editing, select the vertices of the face you want to flip. If you have got them all correctly then the face you are choosing will become a deeper shade of red or blue (assuming you have Face Orientation on). Remember if you are selecting many faces at once that if the vertices you have chosen are also all the vertices of a blue face, that it will get flipped to red. So try to pick groups of faces that don't highlight all the vertices of a blue face at the same time.

Then Click on The "Mesh" dropdown menu. Go down till you see "Normals", click on this and then go to the "Flip" option and click on it. All the red faces you have highlighted should now be blue. Repeat until you get all the incorrect faces.

Normals quite often get generated in reverse to what you expect, so it is good practice whenever you create new faces to check with Face Orientation to make sure they generated how you wanted.

Material Setup. Very important for exported .mu

Any model you create in the blender environment must have a Material set up applied before you  export as an .mu or else the meshes without them will be considered not to exist. Now I have just found out from @taniwha that there is an option on the import list pop up called "Force Invisible Meshes" , It can be found to the right of the list and is there to try to force meshes to show up that haven't been given a Material setup. Generally though meshes exported without a Material set up won't show up when imported. (Have  used the "Force" option successfully).

There are 2 ways to go about giving meshes a material set up, 1: you can import a model that already has the sort of KSP Shader setup you want and set your mesh to use it, then go down and edit the textures that it looks for to your own, as in this example.

2: You can create from scratch. As long as you followed the instructions when you first installed the plugin, then under the Material section, represented by a small pie chart symbol in the symbols menu on the right of the workspace. You will find that with that clicked (you must have a mesh highlighted first for it to be an option), that if you scroll down inside it's opened up menu you will reach a section (as this is from scratch nothing will show unless you clicked "New" at the top, it defaults to the name "Material" but you can click on and edit this to a name you want.) that is labeled "Mu Shader". Within this is a blue drop down named "Shaders", clicking on this will bring up a list of all the possible KSP shaders. When you choose one it will appear in a box 2 below called "Shader:" inbetween is a box called "Name:" You will want to put your choice of name in here or it won't save on export. Then below those 2 boxes is a drop down named "Textures". Depending on what you chose as your shader, there will be 1 or more name types e.g "_MainTex" "_BumpMap" "_Emissive" that when clicked on will show a box below it called  "Name:" with that name in it, just below that is a box that usually is defaulted to say "gray". You want to change it from gray to the the name of the texture pic you plan to use for that aspect. You will need to do this for each of the textures used by that shader. I usually pick a name and add a Capital B to the end for my Bump map and Capital E for my Emissive etc.

Once that is all done your mesh now has a Material setup. You can set other parts of your mesh to use the same Material as in the above example or you can give them a different Material setup depending on what they are for. A good example is for the new Lights in KSP. This is one where I use the Material setup from the stock lights for light up windows as the Material has an animation in it that I do not know how to do from scratch. That material set up and the unique name of the mesh you have using it are required in order to have the new light animation work in your model.

Spoiler

dqTILgV.png

gsWYl91.png

 

.DDS vs .PNG used for your texture files.

KSP can actually work with a wide range of texture type files and even used to use an obscure one called .mbm

These days KSP has the easiest time when using .dds format. Only problem is that .dds are flipped vertically when compared to most other formats. Even though blender will flip it in Material View, it won't in the UV map workspace, so if you are working off a .dds, where you place your UV maps will not correspond in Material View as seen on your model. The answer to this is use a .png to start when you are mapping, once you have finished all your mapping and have your model textured as you want it. Open your .png in something like Paint.net and flip it vertically then save it as a .dds Make sure you flip it, not rotate it.

It is important that you save it as a"BC3 (Linear, DXT5)" type .dds for it to be used properly by KSP. The option shows up on the "Save Configuration" window when "Saving As" in Paint.net

 

Layers in KSP

There are 32 layers available. This is a hard limit in Unity. Layers 0 to 7 are reserved by Unity.

  • 0: Default (Unity built-in): All external visible parts that interact.
  • 1: TransparentFX (Unity built-in)
  • 2: Ignore Raycast (Unity built-in)
  • 3:
  • 4: Water (Unity built-in)
  • 5: UI (Unity built-in)
  • 6:
  • 7: (  @Ger_space said : found Layer 7: its the editor Gizmo handles in the SPH and VAB. )
  • 8: PartsList_Icons
  • 9: Atmosphere
  • 10: Scaled Scenery
  • 11: UIDialog
  • 12: UIVectors
  • 13: UI_Mask
  • 14: Screens
  • 15: Local Scenery
  • 16: kerbals/ Internals and their props. Everything in the heirachy must be set to layer 16, compared to external models the scene is rotated 180 degrees around the blender Z axis then 90 around the X axis.
  • 17: EVA
  • 18: SkySphere
  • 19: PhysicalObjects
  • 20: Internal Space: Used to prevent IVA camera views being blocked by props or hull parts also used when creating internal props)
  • 21: Part Triggers: Airlocks and Ladders etc, Must be tagged as to their function and have the boxes for trigger and separate ticked.
  • 22: KerbalInstructors
  • 23: AeroFXIgnore: Prevents parts from showing aero effects
  • 24: MapFX
  • 25: UIAdditional
  • 26: WheelCollidersIgnore: Layer for the wheel collision enhancer.
  • 27: WheelColliders: Used for the flat wheel collider, this tells the game where the wheel interaction is to be. It is the radius in the config that sets height of visible wheel to ground. If the radius is too large you will bounce high on spawn, too low , wheel will spin but not move.
  • 28: TerrainColliders
  • 29: DragRender
  • 30: SurfaceFX
  • 31: Vectors

The next about tags was found in a thread by @SpannerMonkey(smce)

 

TAGS

Ladder ( used for ladders )

Airlock ( used for hatches/doors )

Icon_Hidden ( used to hide item from editor view, engine shrouds use this )

Icon_Only    ( is useful if you want objects to only appear inside of the thumbnail, like decorative protective intake covers and remove-before-flight tags. Also handy for indicating different sized but similar looking parts ( thanks Ven ) )

NoAttach (prevents surface attach to the collision mesh in Editor. so you can have a part with areas that are not surface attachable while other areas are. set in same way as previous tags)

Drag_Hidden  (Prevents things like turbo fan blades being included or added to drag calculations)

Objects are visible in game when on layers 0 (Default), 15 (Local Scenery) and 19 (Disconnected Parts), and can also be visible on the camera plane on layers 12 (UI_Main) and 13 (UI_Mask). Only layer 0 displays mach and re-entry effects, so placing an object on layer 15 will disable these effects for that object.

 

Lights

Under the light section there is a MU properties section. Within are two wide boxes filled with smaller boxes. Nothing obvious about which box is which but if you hover over a box and look at the end of the fine print you can see a number, knowing about layers now I can see that starting at layer zero at the top left and going all the way across both large boxes, that the top layer is 0 to 15. The next layer down is 16 to 31. If the box is highlighted then that layer gets lit. If not then not.

The modern Stock lights have 0, 15, 17 and 23 highlighted. My old lights have everything highlighted which meant illuminating the entire planet from space. That explains that. You simply tap on a small box to change it's status.

Quaternions

This is a rotational method used by KSP. It used for animations and for orienting Props in Internal models for IVA.

When you start a fresh project in BforArtists/Blender it usually is defaulted to Euler in the Item Transform in the main workspace. (where you see info on location, rotation and scale). Before creating an animation you will want to be sure all your Heirachy parts/meshes are set to Quaterions or else the animation won't work in KSP.

As said it is also used for orientation for stock props. 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.

Took a lot of experimenting to get that worked out. Unfortunately The Throttle and the Nav Ball are different.

Making lights requires you have the renderer set to Eevee. It affects what parameters are present on light objects and on Cycles the exported MU won't cast light.

Contributed by @tg626

Added information from the member @Kavaeric on page 8 of this thread. Here is the link to their out of forum pages.

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

 

thrustTransform

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.

 

Depth mask

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.

Edited by ColdJ
update
Link to comment
Share on other sites

The following are Extracts.

*.dds files are only texture files. It is the model file that contains the information as to which part of the texture file is used by which part of the model mesh. You can read *.mu files using this hex editor.

https://mh-nexus.de/en/hxd/

And you can look at the *.dds files and edit them using.

https://www.getpaint.net/

Most model files will have the mesh names written in plain English (some modders forget to name them though) The list of textures used by the model mesh are usually at the very end of the HEX translation, right hand side and then fast scroll to the bottom. In more modern *.mu files the mesh section names are usually not too far above the texture file names.

Hope this is helpful.

The thread for the .mu plugin is

Clone the the github plugin folder by clicking on the green "Code" button and downloading the zip file. Make sure to read the instructions for installation. Link here.

https://github.com/taniwha/io_object_mu

Can you please tell me how you get the textures you have created to show up on the 3D model in Blender/BforArtists2?

 

My way involves, clicking texture project in the UV menu then the "project" sub option in that option and then undo because the sub makes it change the UV map to "what you see", then turn off the texture project and voila, the texture shows up when I go to texture view.

The plugin has glitch, so you have to go into the "Shading" section and disconnect "Vertex Colour" so that your texture file shows up on the model you are editing when you switch to that view.

Edited by ColdJ
Link to comment
Share on other sites

Actually, you are *NOT* limited to the original number of characters in the filename... or the file extension, either

If using a hexeditor to change the filename, count your character length (I cheat.. I copy paste the filename+extension, and use this website: https://charactercounttool.com/ )...
Then take the character length, convert to hex (I cheat again & use this website: http://www.palmantics.com/html/hexadecimal/ )

Then take the hex for the length, and edit it to the character right in front of the filename, as highlited here: (thats a field that contains the expected character length for the immediately following texture file name)
9YQuS2a.jpg

Do this for *each* texture file...

Optionally, also, if you *add* or *remove* texture files, edit *this* value to = the total number of textures assigned to the .mu (its always the 5th value ahead of *only* the first texture :
AxwUz9y.jpg

Heres one with *three* textures:
vutCa87.jpg

That should do it for the hexeditor method. A BIG THANX to @cineboxandrew for teaching me that... I *think* I remembered that all correctly :P

Info from Stone Blue.

I think I have worked out how to change the texture files the model looks for in the 3D editor now.

Under "Materials" if you scroll down far enough you get "MU Shaders". Inside this section is a Texture section drop down and inside it are the texture node labels. In this example "_MainTex" and "Emissive". When you click on one of those a further section appears that has the image file name associated with that node. You can edit that name to change the image file that is referenced. It seems to have worked for me so cross fingers I have it now. 2K_Pod is the image name for the main texture and 2K_PodE for the emissive.

dqTILgV.png

gsWYl91.png

 

A webpage with all the blender releases from Orbital Maneuvers.

https://download.blender.org/release/

On 11/9/2021 at 11:28 PM, The Brazilian Luigi said:

How do I export without breaking the file, onto a file type usable with 3D printers

Save as an .STL in the Export as section. Your model won't retain things specific to KSP in that form but all the 3d modeling will. You can do the reverse to import but beware, usually STL are much larger models and have more vertices than the KSP engine can handle, also they can't be exported as a .mu and turn back up as a 3d model unless you assign materials to them (texture file.).

On 11/10/2021 at 9:27 AM, linuxgurugamer said:

The problem is that it's all one thing, I want to delete the parachute at the top of the craft, but can't figure out how to do it

Importing Craft file into Blender to work on.

 

Thanks to the wisdom of @Concodroid. For the benefit of others as @linuxgurugamer now knows. Here is a simple import of the stock KerbalX.craft file to remove it's chute and make it a 3d printable file format that could also be potentially then exported as a solid .mu to be used as static. Make sure your folder pathway is set to GameData for the .mu pluging under the preferences section. Go to Kerbal Space Program\Ships\VAB\ using the import KSP craft files option and get the KerbalX.craft file. Use the picture to see where the Make Instances Real option is and click it. You will now have a long list on the right and you want to find section canopy.001

0KBdNq7.png

vDBgAv3.png

With just it highlighted you want to right click it and left click delete hierachy.

FaT0RtY.png

This will remove the chute. You then want to use the box or lasso select to highlight everything at once by putting it around the entire model.

nOEOTiu.png

Once everything is highlighted go over to the File drop down, go down to Export and choose as an STL, give it a name and save.

Start new to clear everything and then Import STL back in your saved file. You should now have a solid model of the KerbalX.

pmjAcuR.png

Remember to assign a Materials file and put it under a heirachy before trying to export as a .mu to use as a static. I don't yet know how to create those from scratch, so I import a simple .mu model, Grab the new model in the list and drag and drop it into the other models top heirachy, once over the the section you want to drop into, hold Shift, the section will go darker, then just release the mouse button to drop it in. Once in , make sure it is highlighted, then go down to the materials section (circle that is quartered into to brown triangles, a yellow and a white) Click the drop down and choose a name from the list(the list is from the materials of the model you are adding in to.) Delete only the model info in the heirachy from the simple model you are using for it's heirachy, not the top of the heirachy and then making sure the top of the heirachy is the highlighted part, export as a .mu file.

Clear using New project option. Say no to save project as a blend etc, then import the export you just made and check that everything is as you expect. If yes the you can add a simple box collider as it is only a static, before exporting it again. Hope this helps.

sdxSvEP.pnggr5Ipil.png

 

On 12/12/2021 at 12:08 AM, MrPoker said:

Hi my .MU file is not exporting at real size. I exported 2 format. (FBX and MU). it appears as FBX is 9MB but the MU is 289Kb. Any ideas how to fix this? 

Different file formats store data differently and may be quite different in size. The size of the .mu is not a problem, whether it loads up properly after you have saved it is the what is important.

Edited by ColdJ
Link to comment
Share on other sites

Place it in it's own folder on your main drive (do not put it in Program Files as the operating system will stuff up it's permissions.) I gave the link above.  Place the plugin master folder in like this example.

VxN3tMD.png

Then in the program under edit\preferences\testing. tick the box to enable it and tick it's sub boxes so that every thing is loaded properly. You will now have options under import and export for .mu You should also get an export as mu up on the top right of the menu bar across the top. Make sure you have the top of your heirachy selected when you export and make sure all your parts have a material assigned to them or else they won't be a 3d model when you import back in. Good luck.

Tutorial by @Concodroid

I've made a tutorial for this. It should work for all stock craft and most mod craft, but it's specifically for RWP, so it gives an example of how to fix a craft with the troublesome mod in the RWP modpack (AirplanePlus)

 

Edited by ColdJ
Link to comment
Share on other sites

3 hours ago, ColdJ said:

I'm a complete n00b at this whole part mod thing, so this may be something completely obvious I'm missing. I want to create a new Variation on some existing stock parts. I thought I could import the MU, then use the UV Map to create a new texture. When I do the import, it seems to work but the mapping is all wrong. Is there a better way to approach this project? The image below is the UV Map for the long 1.25 stock tank. 

 

15qnM83.png?1

 

 

I am also a total noob, but as DDS files are read upside down compared to png. Try flipping your image vertically (saved upside down, and I mean flipped vertically, not rotated)before importing it in and see if the texture is now in the right places.

Do not worry if it says "there are Ngons in your mesh, tangents not saved" when exporting. It is sorted when you import the model back in.

If you're just wanting to change the texture, it is no longer necessary to alter or create a new model. You can use ModulePartVariants to add your own variant, probably best with a Module Manager patch.

	MODULE
	{
		name = ModulePartVariants
		primaryColor = #000000  
		secondaryColor = #000000
		useMultipleDragCubes = false
		VARIANT
		{
			name = MyVariant
			displayName = Custom Variant
			primaryColor = #ffffff  // set these to match your part
			secondaryColor = #000000 // set these to match your part
			TEXTURE
			{
				mainTextureURL = Squad/Parts/FuelTank/Size1_Tanks/125Tanks_BW // this would be your custom directory path
				_BumpMap = Squad/Parts/FuelTank/Size1_Tanks/125Tanks_N // only use this with Bumped Specular (it's your bump map)
				shader = KSP/Bumped Specular // could also be KSP/Diffuse, or KSP/Specular			
			}
		}
	}

Incidentally I don't think the mapping is wrong, it looks like the faces are triangles instead of rectangles is all.

Link to comment
Share on other sites

2 hours ago, Randazzo said:

If you're just wanting to change the texture, it is no longer necessary to alter or create a new model. You can use ModulePartVariants to add your own variant, probably best with a Module Manager patch.

Hi @Randazzo. These are extracts from from other threads with the questions and answers. This thread is dedicated to getting things working in a blender enviroment. I very much appreciate your willingness to help but MM patches are for a different thread. I have made many configs using the Part Variant Module and it is great for giving a part many look options in the SPH. Here we are trying to give people building their own part, info on how to do so in the 3d modeling program. Thank you.

P.S

A lot of models require the material name used by the .mu in order to display properly for variations, like in this example.

            VARIANT
            {
                    name = MontalcinoRed
                    displayName = Montalcino Red
                    themeName = MontalcinoRed
                    primaryColor = #510212
                    secondaryColor = #510212
                    TEXTURE
                    {
                        materialName = LandRover
                        mainTextureURL = KerbinRover/Parts/Rover/RoverMontalcinoRed
                        _BumpMap = KerbinRover/Parts/Rover/Rovernrml
                    }    
            }

Edited by ColdJ
Link to comment
Share on other sites

On 2/6/2022 at 10:27 AM, ColdJ said:

I've made a tutorial for this. It should work for all stock craft and most mod craft, but it's specifically for RWP, so it gives an example of how to fix a craft with the troublesome mod in the RWP modpack (AirplanePlus)

 

You made that?

Just kidding, I know it was an accident lol

 

As an aside, I would personally recommend using normal blender (2.83 to import and blender 3.0 for everything else) to everyone else, purely on the basis that it's far more widely supported. Tutorials and support are far easier to come by, for example, and 3.0 is just a complete game-changer.
BforArtists may not support some blender features and may do things a bit differently, hence why I'm bringing up tutorials and support.

That being said, BforArtists has its own merits, so if you know what you're doing, don't let me stop you. But I can only really provide support and tutorials for normal blender, and as I said, most support and tutorials are for normal blender as well. (Or vanilla, whichever you prefer)

Edit: I'll add some other information soon.

Edited by Concodroid
Link to comment
Share on other sites

Exporting a UV layout for texture creation in an outside editor.

Exporting one you have created in the B4A2 then in the 2d texture layout, there is a UV dropdown and in it is an option to export UV layout as a PNG. Make sure you have highlighted everything you want to show up, then click on the Export UV layout option, give the pic a name and be sure what folder you are sending it too, and it will create a wire drawing in a png for you to use outside in Paint.net or whatever you use. Look in this pic to see where the option is.

XNIq916.png

 

Edited by ColdJ
Link to comment
Share on other sites

2 hours ago, ColdJ said:

BforArtists 2 version 2.7 is Blender 2.93 alpha. Blender 3 can't use the plugin. So how are you going to assign the various .mu properties and export them as an .mu?

It would require unity and part tools, which is quite easy, but not what you're going for.

Link to comment
Share on other sites

5 hours ago, ColdJ said:

Nope. All those things are under the heading "Extracts." And it is rather clear that it is your work. The cute dragon gives it away..

Whoops! didn't see that.

 

5 hours ago, ColdJ said:

BforArtists 2 version 2.7 is Blender 2.93 alpha. Blender 3 can't use the plugin. So how are you going to assign the various .mu properties and export them as an .mu? You could only do 3d modeling work in 3, you would have to then save it as a .blend, go back to the earlier blender that works with the plugin, import the .blend and then do all the .mu work before exporting.

Yep. Although it's worth remembering we have different goals - I use this to make art, videos, and cinematics with these KSP craft through blender. You're using it to create parts for KSP.

Link to comment
Share on other sites

  • 2 weeks later...

Some things:
EDIT: ok... *one* thing... I will elaborate on others, when I get moar time :P
 

Quote

Check after they are in your heirachy what rotation they are now as most don't have the x,y,z tags. It can be handy after you have sorted direction to put something like a spotlight in the object you are working with's heirachy, as it is obvious which way it is pointing, as long as you don't config it ,it won't have any effect in game.

Not necessary to add lights or anything, for easy visualisation/labeling, to figure out proper axis-rotations, for odd-ball things KSP does, like thrust direction, RCS FX direction, the weird 90°/180° offset for IVAs, etc.
The method/settings i describe below, are just display settings, therefor, unlikke adding light-objects, or other, to your hierarchy, NOTHING extra gets exported/affects your .Mu, cluttering up your hierarchy while you work, or if you forget to remove before export ;)

NOTE: This setting, IIRC, is *unique* to whatever transform object you set it for. It does *NOT* universally change *all* your transform objects. Each one needs to be changed seperately.

1) In the Outliner, select the *transform* object you want clarification on, in *Object* mode...
2) In the Properties section under Outliner, select the *transform* ObjectData Properties icon, on the left (note that this icon/option is *different* than other types of objects, and this one only appears when *transform* objects are selected)
3) You'll see two options: "Display As", and "Size"
4) Default is "Plain Axes", and "1m". First pic shows this  (altho i already changed the "Size" to 2m, to extend the highlighted length, to outside the mesh)

kZc63qS.jpg

2nd pic showing "Arrows" option (self-explanatory on what this option does)

8B30hrd.jpg

3rd pic showing what "Single Arrow" does. (I do not recall, how this one gets determined, which axis it does, but IIRC, generally, it automatically points to Z.) i find this one *most* useful, when doing those tricky orientations, where you NEED to have that certain axis, pointing correctly, or cant figure out *where* exactly, your thrust/gimbal/dockingnode, etc axis is currently pointing

lacw1qy.jpg

 

Edited by Stone Blue
Link to comment
Share on other sites

On 2/9/2022 at 2:33 PM, ColdJ said:

BforArtists 2 version 2.7 is Blender 2.93 alpha. Blender 3 can't use the plugin. So how are you going to assign the various .mu properties and export them as an .mu? You could only do 3d modeling work in 3, you would have to then save it as a .blend, go back to the earlier blender that works with the plugin, import the .blend and then do all the .mu work before exporting.

As for ^^this^^, I'm getting reports (and am testing myself), that everything in the plugin *does* seem to work in Blender 3.0, **EXCEPT* the import.
So, i am testing importing with Blender 2.83.9, saving immediatly (without *any* edits), as a .blend, then opening/working/*exporting to .mu* from Blender 3.0

Also, @ColdJ, I see you taling about importing a .mu... working with it... exporting it.... then *RE-IMPORTING* it **again**....
From what Taniwha has told me, you shouldnt do this.

You should only be *importing* the .mu *ONCE*, when you originally start to work with it. You should save any edits as a .blend, and update/save *that* as necessary... Its OK to *export* to .mu, for in-game testing at any time.... But you should *NEVER* reimport the .mu again, unless you want to start completely over from scratch, from the *original* .mu file that has *NEVER* been imported with the plugin.

Edited by Stone Blue
Link to comment
Share on other sites

@ColdJ Here are some quick notes I took when i was in contact with Taniwha. I had meant to get more details, and add them to the Wiki page on the plugin's repo, but didnt get around to it yet.

A couple of these are relevant to your response above.

Apply Scale & Clear Inverse, are why you are getting objects out of place/rotation/scale incorrectly.

 

Quote

Right after you import the .mu, you should manually go thru the hierarchy, and one by one select each mesh object, go to Edit mode, select all the geometry, and use Mesh-→Merge-→By Distance.
When you import an existing .mu,
all the vertices and edges get multiplied. By doing this, you clear out all the doubles. This is one reason why you don’t want to keep importing the same .mu over and over.

good practice to do: select “Part” in Model Type: for *each* game object

uncheck "Cast Shadows" & "Receive Shadows" on collider objects... or any meshes you *dont* want to be "seen" in-game

anytime you have any game object that has a scale parameter in any axis, other than 1.00, make SURE, to select the *whole* hierarchy for what you want in the mu, & hit the "Apply Scale" button under "Mu Hierarchy", before you hit Export Mu. Supposedly, using this over & over, every time you re-import the .mu, it can have negative, cumulative effects. I do remember Taniwha telling me this, but I cant remember the why of it. …?? So this is another reason not to keep re-importing the .mu after edits/changes.

also good practice to hit Clear Inverse, always, before export. IIRC, this can also have negative, cumulative effects when you use it repeatedly on a re-imported .mu. I do remember Taniwha telling me this, but I cant remember the why of it, on this either…?? So this is yet a third reason not to keep re-importing the .mu after edits/changes.


NEVER re-import a mu to finish work on it... Do an initial, first, import of the existing .mu… Svae the file as a .blend… Use the .blend file to work from, and to eep saving all your changes to. You can export the .mu as many times as you want, to test in-game… Just DO NOT re-import the .mu you just exported.
Overwrite it, by exporting again from the .blend.

For meshes, in the Properties Panel, Object Data Properties tab (the down-pointing triangle icon), make sure "Normals"---> AutoSmooth is *unchecked*

make your life easier, by modelling everything in quads, not tris. For each mesh object, select it, go into Edit mode, "Faces"---> Convert Tris to Quads. The plugin (or Unity, when you start KSP), will automatically reconvert quads to tris.

You also need an empty transform as your top-level parent object.
ie a mesh cant be the top parent object

 

Edited by Stone Blue
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...