Jump to content

[1.2-1.7] Blender (2.83+) .mu import/export addon


Recommended Posts

10 hours ago, Send help(to Ryan) said:

Why does some files give me this error?  https://imgur.com/NaHq1LN

Why do some people not say what files are being imported to produce such errors?

If you look closely at the stack trace, you'll see that an armature is being imported: thus "some files" is a subset of models using bones/skinned meshes. Looking even closer you would see that for some reason, b is None. If you look at the code around the specified line, you'll see that since b comes from prev_roots, somehow None got into prev_roots (which is a problem). Looking up further, it is obvious that prev_roots comes from roots. Slightly further, the construction of roots is found and with a bit of thought it is clear that the test for b.parent being in bones should check if b.parent is not None.

However, where there's one problem, there's often others, thus without knowing what file to import to test, I have no way of knowing if that is actually the fix or if there are more places to be fixed.

Link to comment
Share on other sites

14 minutes ago, Send help(to Ryan) said:

So there is no fix? I looked into the code and could not find the problem

I did not say there is no fix. In fact, I said what I think it is (you did ask why ;)), but without knowing what model to import, I have no way of testing.

Link to comment
Share on other sites

@Send help(to Ryan) You need to go deeper into the rabbit hole.

The top level craft is a single collection instance of the craft collection

that craft collection contains parts that are collection instances of the parts themselves

then each part collection has model collection instances (usually only one)

If I remember correctly, the model collections are editable.

Link to comment
Share on other sites

11 hours ago, Send help(to Ryan) said:

Problem now I can copy the loaded models into scene and unlink it. I can edit all the peaces but they are all in the midel Is there any way I can have it same but in the right place. or am I doing it wrong.

This is more or less by design. However, that design was based on people wanting to 3d-print their ships. My recommendation is to dive into the import_craft directory and figure out how to make it do what you want (then submit a PR). That does require learning python but it's always good to add another skill.

Link to comment
Share on other sites

  • 2 weeks later...

shader.png

Getting errors whenever I try selecting most shaders. Some of them only build a couple of the nodes and only a couple load entirely. 

I setup my preferences and downloaded the shader presets so idk what the issue is. I'm on blender v2.80.75 atm.

Link to comment
Share on other sites

hey taniwha, i've been using the add-on to make a custom engine.
i got to the point where i can add the model in the game with the transforms in the correct places.
but the texture is all over the place :(

i've tried to make the texture a .png and mirror it in the x and y 
also make it a .dds and try the mirroring as well

 

Link to comment
Share on other sites

2 hours ago, Space_Wyvern said:

i've tried to make the texture a .png and mirror it in the x and y 
also make it a .dds and try the mirroring as well

Don't flip PNG impages, It's only DDS images that need flipping on the Y axis.

Do your modeling and UV layout in Blender naturally, with no thought to KSP or Unity. If you do your texturing in blender, still just do it naturally and write out the PNG when you export. If you do your texturing outside of blender, stick to PNG. For testing in KSP, stick to PNG. It's only when releasing your parts that you might consider converting to DDS (and then doing the Y-axis flip).

In other words, don't second-guess anything. Up in the VAB is up in Blender, and VAB door is right. It's only when following tutorials aimed at doing things in Unity (and Maya?) that get a little confusing because you will need to swap Y/green and Z/blue in any axis references (X/red stays the same)

1 hour ago, Space_Wyvern said:

when i click on the import .mu files on blender and go to the gamedata->parts.... folder it only shows the cfg files.

Oh dear. I had forgotten that button even exists. It's a work in progress for IVA prop support, not for importing just .mu files. Use File->import->KSP mu instead.

Link to comment
Share on other sites

@cukkoo The craft importer does work. You probably didn't tell it where to find the files it needs to work. instructions here. Technically, I should just ignore your post because it is utterly uninformative. ie, you don't say that it's doing to not work. But I'd rather be helpful, and this is the usual cause. Note that there are some problems with restock models (especially engines), but it works fine with stock and most other parts mods.

@Space_Wyvern: I'm sorry, but your screenshots tell me nothing other than you have a messed up texture. How you got that messed up texture depends very much on what you did. if you're trying to import a part, edit the texture and re-export... don't. The imported DDS is upside down in blender (the importer does some tricks with the texture nodes in the material to make it work). Really, the addon is NOT meant for import-tweak-export. It's meant for importing models to study them, and export newly created models. The import-tweak-export path is not guaranteed to produce the same model (it can't for some things), and the textures are a mess thanks to DDS.

Link to comment
Share on other sites

OHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH IT HAS BEEN 1 YEAR THAT I PRESS THE WRONG BUTTON Why i am so stupid Even i want to make animation entitie in other game i press the wrong button for 5 months

Good add-on btw

Still dont work :(

The import problem is at import craft.py

Edited by cukkoo
Link to comment
Share on other sites

So I thought I installed it correctly, but every time I try to import any .craft file, an error message pops up.

8jvu88S.png

I tried uploading .craft files from the Steam workshop files, same thing happens.

Edited by ChrisSpace
Link to comment
Share on other sites

For everyone here who says the craft importer does not work, I did get it to work first time. In case for some reason the directions in the OP don't make sense, 

Step 1) I'm using Blender on Steam, v2.83.2, ksp 1.9.1.

Step 2) download the addon zip file from the github repo.

Step 3) unzip the folder and go to C:\Users\<your name>\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons --> this is the addon folder for all blender mods and paste the whole thing here.

Step 4) Go to Edit->Preferences menu in Blender and click addons. Look/search for "Import-Export: Mu model format (ksp)". You should find it now that the folder is in the addon directory.

Step 5) Click the checkbox next to the name so it can be enabled.

Step 6) Click the little right pointing triangle next to the checkbox so the item box expands and go to the GameData Path box. Put the FULL path to the game data folder. I used C:\Users\name\Desktop\KSP 1.9.1 PLAY\GameData\

Step 7) Save your preferences and return to the main Blender window that you get when you start the software.

Step 8) Go to File->Import->KSP Craft (.craft)

Step 9) Navigate to where your .craft file is and WAIT. I can't stress this enough that the loading does take a bit of time, but while Blender is running don't try to do anything or it will freeze and possibly crash. I presume the larger the craft the more time it will take but don't quote me on that.

Step 10) Enjoy.

I haven't figured out yet I somewhat can access the individual part meshes and delete empties for example. I believe, and someone with better blender knowledge than me can correct, that you need to open and select the mu_utils scene and go to the loaded_models collection. From there you can right click on a part and link to the empty mu_utils scene window. Edit whatever you want, then move the edited part back inside of loaded_models. When you switch back to the original scene, the edits will be applied to the craft mesh. Taniwha provides instructions on the github for what all is inside of the mu_utils scene. I hope that helps some of you with exactly what software versions I'm using and the exact file paths that I can guarantee work as of this post. 

I am dumb about editing individual part meshes see below. This particular explanation did the trick. The key is switching back to View Layer after selecting the mu_utils scene. 

On 5/18/2020 at 11:26 AM, taniwha said:

@Briso: you need a more recent blender. I know 2.83 works. I didn't realize VertexColors was new.

@Sparrowhawk: They're tucked away. Go to the outliner, set it to "Scenes" mode, click on the "mu_utils" scene (this will switch you to that scene, so clicking on "Scene" will take you back to the default scene), then switch the outliner back to "View Layer" mode (alternatively, you can have two outlines open: one in scenes mode, the other in outline). You will probably need to turn on the extra vis/selection options: do so by clicking the funnel icon in the upper right and enabling "select" "disable in viewports" and "disable in render". You'll then be able to make the collection you want selectible and visible (and renderable if you so choose). To edit the part models, you will want the "loaded_models" collection. the model you want will be in there. Note that editing these objects will edit all instances of them.

As additional information: loaded_parts holds the "compile parts" much like the parts list in KSP (some parts are made up of multiple models). "craft_collection" holds the assembled craft (much like the VAB or SPH (or even out in flight).

 

Edited by aeroeng14
Figured out everything
Link to comment
Share on other sites

9 hours ago, taniwha said:

@ChrisSpace: I you look at the bottom of that message, you'll see "no such file or directory" (and an empty set of quotes). This means you did not set the GameData path as mentioned in step 6.1 in the OP, or in these instructions.

So I tried that, and loaded in the default Ion-powered probe as a test. Problem is, for some reason now every ship except the Ion probe is showing the same error message.

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