taniwha

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

Recommended Posts

@taniwha I'm getting this error when trying to import a .mu file. Could this have something to do that user preferences was renamed and moved from File > User Preferences... to Edit > Preferences...

TdK2kLY.png

Share this post


Link to post
Share on other sites

uh, quite possibly. I remember seeing that particular commit message (I scan the blender commit logs), but haven't tried importing since then. Thanks for the heads-up.

I just checked the commit itself: sure enough, user_preferences -> preferences. Again, thank you.

Share this post


Link to post
Share on other sites

@Nucleartaxi: First, the 2.79 branch does not worrk too well on windows (path separator issues: / vs \, silly microsoft (/ works everywhere, including windows, but...)). I've just had confirmation from a windows user that the 2.80 (now master) branch does work on windows. Note that parts that have skinned meshes tend to import incorrectly (WIP)

Second, you need to set your KSP GameData path for craft import to work (the importer needs to know where to find the parts). This is done via the addon's options panel in [User] Preferences ([] because blender recently changed the name). ie, go to [User] Preferences -> Addons -> Import Export: Mu model format (KSP). Set the GameData path to wherever your GameData is (eg, for me: /home/bill/ksp/KSP_linux/GameData/). You can use that folder icon to browse your system.

If you get into part modding, you might want to install the shader prefabs, config templates and color palettes while you're there (hmm, there's a spelling mistake: I have paletes. oops).

 

[EDIT} oops, except, I still need to fix that user_preferences -> preferences thing.

OK preferences fixed, so the addon will work with the latest builds of blender 2.80.

Edited by taniwha

Share this post


Link to post
Share on other sites

@Nucleartaxi: you need a more recent blender build. Rmember, 2.80 is still a fast-moving target. (or you can go back one git commit for the addon)

Share this post


Link to post
Share on other sites

@taniwha Thank you, the craft now imports! One final question, is there a way for it to show up with all its textures? It shows up as a model but without any textures.

Edited by Nucleartaxi

Share this post


Link to post
Share on other sites

Put the 3d veiwport into lookdev or rendered mode (usually (near) extreme right of viewport's header).

Share this post


Link to post
Share on other sites

@taniwha Just had another error. When trying to import the .craft file of a rover I got these errors:

Ll9x8VX.jpg

I narrowed it down to the new RoveMate model that came with KSP 1.6. When trying to import just that .mu file, I got these errors:

RFYV26F.jpg

If I try to import any other of the new 1.6 models, they work just fine.

Share this post


Link to post
Share on other sites

@Olympic1: Thanks. I suspect the texture is 0x0, but I made the normal map check try to do the right thing for small textures.

Share this post


Link to post
Share on other sites

@taniwha Is it possible to export the texture for the model that the plugin creates? I want to try and use an exported craft model in another program and the model works fine, but it needs a texture.

Share this post


Link to post
Share on other sites

@Nuclear: what you see in blender just uses the textures as specified by the models, just loaded and packed(?) into the blend file. Such is really beyond the scope of this addon and in the realm of another.

Share this post


Link to post
Share on other sites
Posted (edited)

Greetings... I just installed Blender 2.79b and I have Python 2.7.15+ and 3.7.2rc1 on my box (Debian Testing)

Never mind... I installed the 2.80 beta directly from blender.org instead of depending on the Debian package, and it works.

Edited by GeneCash

Share this post


Link to post
Share on other sites

Hey all. I'm stuck here trying to enable the add-on. Using Blender 2.8 and the cloned io_object_mu. It shows up as an addon, but this is what I get when I try to enable it. Any help is appreciated.

7GgZNRK.png

Share this post


Link to post
Share on other sites

Blender's python API is still shifting around. I remember recently seeing that the hemi light was removed. Thanks for the heads-up, I've pushed a fix.

Share this post


Link to post
Share on other sites
18 hours ago, taniwha said:

Blender's python API is still shifting around. I remember recently seeing that the hemi light was removed. Thanks for the heads-up, I've pushed a fix.

Whew, I thought it was me! Thanks for the fix. 

Share this post


Link to post
Share on other sites

How do i install it? It's just a bunch of .py files! Do i need python?

Edited by Gapone

Share this post


Link to post
Share on other sites

@Gapone: the easiest way is to clone the repository into your blender addons directory (~/.config/blender/2.80/scripts/addons/ for me on Linux using blender 2.80). If you use the zip provided by github, you will need to remove any periods from the directory name (python does not support periods in package or module names because the period is used as a separator for nested objects).

You do not need python to use the addon, but if you want to use the included stand-alone tools, you will need python.

Share this post


Link to post
Share on other sites

I'm getting a bunch of errors- first when I try to enable Importing .mu files, and then when I try to import .craft files, which is did let me enable. Help?

Share this post


Link to post
Share on other sites
4 hours ago, taniwha said:

clone the repository into your blender addons directory

What is "clone the repository"?

Share this post


Link to post
Share on other sites

@RedPandaz: make sure you're using the correct branch for your blender: master for 2.80 (recent build) or lbender2.79 for 2.79. Beyond that, I will need to see what errors you are getting.

@Gapone: "clone the repository" is how you download the code using git or a graphical git client. It makes a local copy of the repository (in this case, the directory structure on github) including all revision history. Once you've cloned a repository, updating is done by pulling from the repository.

Either way, you will need to click on the big green "clone or download" button, which gives a git command line to clone, or you can download the zip using the provided link. cloning is better because of the ease of updating, but you do need git.

Beware that if you use blender 2.79, you will need to first select the blender2.79 branch before downloading the zip (if cloning, you can use git to switch between branches easily).

Share this post


Link to post
Share on other sites

hi! thanks for all you've done and the help you're giving!

i'm trying to get this to run on my macbook, but having problems. here's what i've done:

  • i installed blender 2.8;
  • i downloaded the zip file, of master, from https://github.com/Dasoccerguy/io_kspblender;
  • in blender i did edit->preferences->add-ons then installed the zip;
  • i configured the gamedata path to /Applications/KSP_osx

then, i have the import KSP craft and import KSP mu menu items! great!

however, when i try to import a craft, i get an error (sorry, i literally can't figure out how to paste a screenshot) in model.py line 48

    obj = mdl.instantiate(f"{name}:submodel", position, rotation, scale)
AttributeError: 'NoneType' object has no attribute 'instantiate'

location: <unknown location>:-1

does anybody have any ideas, please?

Share this post


Link to post
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.