taniwha

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

Recommended Posts

On 3/13/2019 at 11:36 PM, taniwha said:

@RedPandaz: well, what error are you still getting and how are you installing the addon?

I changed it to what you told me to when you last replied several weeks ago, and it still isn't showing up

 

Share this post


Link to post
Share on other sites

@RedPandaz: I need the exact steps you went through, spelled out in detail, because something is not right. As can be seen from the rest of the thread, most people do get it working without too much trouble (at least well enough to send me exception reports). This implies that a vital point is being missed somewhere.

Share this post


Link to post
Share on other sites
Posted (edited)

@taniwha

"the io_object_mu-blender2.79 directory. Best is just io_object_mu"

On 3/1/2019 at 10:00 PM, RedPandaz said:

I changed it to that and it's still not showing up

Edited by RedPandaz

Share this post


Link to post
Share on other sites

I meant ALL the steps, from the very beginning. It might be a good idea to start again with a completely fresh install of blender.

My recommended steps:

  • Install blender.
  • Go to your blender addons directory, for me this is  ~/.config/blender/2.80/scripts/addons but I use Linux and blender 2.80. I have no idea where it is on other OSes.
  • Using git, clone the repository
    • for blender 2.79:
git clone -b blender2.79 https://github.com/taniwha/io_object_mu.git
  • for blender 2.80:
git clone https://github.com/taniwha/io_object_mu.git
  • In blender's user preferences, you should be able to find and enable the addon in the addons page.

Seriously, the zip files generated by github seem to cause more problems than they solve.

Share this post


Link to post
Share on other sites
2 minutes ago, taniwha said:

I meant ALL the steps, from the very beginning. It might be a good idea to start again with a completely fresh install of blender.

My recommended steps:

  • Install blender.
  • Go to your blender addons directory, for me this is  ~/.config/blender/2.80/scripts/addons but I use Linux and blender 2.80. I have no idea where it is on other OSes.
  • Using git, clone the repository
    • for blender 2.79:

git clone -b blender2.79 https://github.com/taniwha/io_object_mu.git
  • for blender 2.80:

git clone https://github.com/taniwha/io_object_mu.git
  • In blender's user preferences, you should be able to find and enable the addon in the addons page.

Seriously, the zip files generated by github seem to cause more problems than they solve.

Well, no, the folder is there, as "io_object_mu", but it just doesn't appear on the addons page

Share this post


Link to post
Share on other sites

I'm sorry, but there is nothing more I can do or tell you without more information, other than to direct you to the Blender community. I do not use Windows (or MacOS), and my past efforts have been sufficient for others, so I am at a loss.

Share this post


Link to post
Share on other sites
On ‎7‎/‎30‎/‎2013 at 8:41 AM, taniwha said:

Hello, I have been working on an addon for Blender to import and export .mu files. It is still very incomplete, but I have released it under the GNU General Public License (version 2), and it is available from github.

NOTE: The addon is now targeted for Blender 2.80. Those requiring 2.79 support should checkout the blender2.79 branch.

NOTE 2: Blender won't load the plugin if the directory name has periods in it, so if the resulting directory has periods in it, you will need to rename it.

NOTE 3: I haven't done an actual release for a long time, nor do I have plans to do so any time soon, so ignore the release section on github and just clone the repository. I do update the code whenever something comes up.

 

For help with Blender in general, #blender on irc.freenode.net is generally full of experts.

However, thanks to @Snark, here are some installation instructions:

  1. Clone the github repo
  2. Copy the entire folder (io_object_mu) into Blender's scripts/addons folder
  3. Start Blender
  4. Go to File ->  User Preferences... -> Add-ons tab -> Import-Export category
  5. Find "Import-Export: Mu model format (KSP)" in the list
  6. Check the checkbox next to it
  7. Click "Save User Settings"
  8. If you go to the File -> Import menu, it now has "KSP Mu" and "KSP Craft" in the list.

 

Working features

  • Import .mu into blender. Meshes, materials, textures (including .mbm) and colliders supported. Many animation properties are supported (transform, light, material (not texture))
  • Export from blender to .mu. Same as features and limitations as import, however .mbm is not written.
  • Unity colliders can be added via the Add menu. Updating the collider via the tool panel or the object panel works as expected (ie, visual updates). Note that other than mesh colliders, editing the mesh of the collider will have no effect.
  • Create mesh colliders from multiple selected mesh objects. Optionally (default) "convert" the mesh to a convex hull as Unity (and thus KSP) requires part mesh colliders to be convex.
  • Convex hull creation can be used separately as a modeling tool.
  • KSP shaders can be created by selecting the shader type in the materials panel. The material will be built automatically any time something is changed (a little inefficient, but it works (actually, it doesn't right now)). The material setup is really just a best-effort WYSIWYG thing.
  • Standalone (still requires python to run) command line script that lets you view and edit wheel collider parameters.
  • Skins work for import-only.
  • v4 materials for import, possibly for export (not fully tested).

 

Plans (no particular order):

  • More animations.
  • Bones and skins (WIP).
  • Better IVA support (WIP?)

 

Export is simple: select the root object, then File->Export->KSP Mu. The active object and all of its children (of supported types) will be exported to the one .mu file.

  Okay I must be doing something wrong here I did EXACTLY as instructed and it is NOT on the list to select.  Even tried putting the zip file there too.  Any ideas why it's not working?  

Share this post


Link to post
Share on other sites

If you have a zip file, you did not follow the instructions. While blender can install addons from zips, github's auto-generated zips of repositories can cause a lot of trouble because of periods in directory names (python does not support them). I don't do up release zips because I wish to encourage people to use git and thus get updates more easily.

This post shows how to clone the repository:

 

Share this post


Link to post
Share on other sites

@AstroCarson: Yeah, you are using blender 2.79 on the master branch. checkout the blender2.79 branch or switch to blender 2.80.

Share this post


Link to post
Share on other sites

Bones support is very very WIP and not working properly yet.

Share this post


Link to post
Share on other sites

I'm running into a problem when I grab a test stl off thingiverse and then try to save it as mu file. Is it worth me posting error messages (here? github?) or is stl --> mu not an intended pipeline?

Share this post


Link to post
Share on other sites

Another question, this one about mu.py: that will work as a stand alone? 

 

Share this post


Link to post
Share on other sites

yeah, there are several tools in the source tree that use mu.py standalone. mucfg.py might be an interesting reference.

As for stl... I can't say without seeing the error, but you might be better off writing a command line stl->mu converter, since the exporter expects certain things that the stl importer for blender would not set.

Share this post


Link to post
Share on other sites

Hi @taniwha, I've been using the plugin but I cannot get a working model in game.

I loaded up the standard blender cube and hit export as a .mu. I didn't see any extra options along the way. It was not a valid MU, and did not appear in game. When changing the model path to a stock part or "city", it worked fine.

Do you have a step-by-step of what is absolutely necessary for a mu model to work? Clearly I am missing something, but I have no idea what. 

Thanks

Share this post


Link to post
Share on other sites

hey I can't find the branch for the 2.79 version of blender, is it gone?

 

Share this post


Link to post
Share on other sites

@Gameslinx: KSP models are mildly complex and my exporter does little to ease that. I suggest importing a few to see what they look like, but the main thing is the exporter works on whole hierarchies, not individual objects, and the root object of the hierarchy should be an empty (ksp cancels out the transform (ie, 0,0,0 for location, 0,0,0,1 for rotation and 1,1,1 for scale) on the root object of the model).

Other than that: mesh objects are exported such that you can see them (you do need to set up the material properly though: importing existing models and studying their materials will help greatly here), and colliders are always separate, specially marked (internally) objects (you have to use provided commands to create them). Armatures and skins are not yet supported (WIP)

Both the importer and exporter understand lights and cameras in that they have to be specially handled to translate between blender and unity. Most of the light and camera properties for KSP can be found in the light/camera tab in blender.

Share this post


Link to post
Share on other sites

@nanokarlo: that appears to be blender 2.79: either update to blender 2.80 (much nicer), or get the blender2.79 branch of my addon.

@doodlemh: no, blender2.79 branch is very much there still. Make sure you're spelling it correctly (all lower-case, no spaces, one dot (watch out for period vs comma)).

Share this post


Link to post
Share on other sites

my mistake was searching it in the ksp forum, i didnt realize it was an option on github, sorry.

 

Share this post


Link to post
Share on other sites
Posted (edited)

@taniwha The latest commits for better armature support are amazing. Tried it on the new Breaking Ground Seismic Sensor and it imports it correctly now, but the animations are still screwed up.

All the other animations I tested work fine.

Edited by Olympic1

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.