Jump to content

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


Recommended Posts

Yeah I don't know what any of that stuff means. I'm just trying to get my texture to show up on my part. Everything else works. The nodes work, the collision works. The model shows up. It's just the texture that's refusing to show up.

The whole part just gets rendered as grey.

 

EDIT: Nevermind. Apparently there was an issue with the MU Shader's property not having the same name as the texture file.

Edited by xiaoxiao181
Link to comment
Share on other sites

1 hour ago, xiaoxiao181 said:

Yeah I don't know what any of that stuff means.

That stuff, is stuff learned about how the .mu plugin operates, including how to make the shader look for the texture pic you named for your model. If you already know all that it tells and more, then please add to it's knowledge base for those who don't.

Link to comment
Share on other sites

  • 1 month later...

i have been trying to export my part, what is this error and how can i fix it???

Python: Traceback (most recent call last):
  File "C:\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu-master\export_mu\operators.py", line 63, in execute
    return export_mu(self, context, **keywords)
  File "C:\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu-master\export_mu\operators.py", line 34, in export_mu
    mu = export.export_object (context.active_object, filepath)
  File "C:\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu-master\export_mu\export.py", line 173, in export_object
    mu.obj = make_obj(mu, obj, "")
  File "C:\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu-master\export_mu\export.py", line 116, in make_obj
    return make_obj_core(mu, obj, path, muobj)
  File "C:\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu-master\export_mu\export.py", line 92, in make_obj_core
    muobj.collider = make_collider(mu, col)
  File "C:\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu-master\export_mu\collider.py", line 53, in make_collider
    col.mesh = make_mesh (mu, obj)
  File "C:\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu-master\export_mu\mesh.py", line 234, in make_mesh
    mumesh = make_mumesh(mesh, submeshes, vertex_data, vertex_map, num_verts)
  File "C:\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu-master\export_mu\mesh.py", line 204, in make_mumesh
    if tangents[0] != None:
IndexError: list index out of range

location: <unknown location> 

 

Link to comment
Share on other sites

If I import crafts that used TweakScale, the scaled parts aren't scaled when imported.

Kinda same thing for B9 Procedural Wings. Any Procedural (Wing) Part will revert to standard shape of the given part (the shape you get when you want to place that part in VAB!)

 

someone needs to try and import CFRP CarnationRed Flexible Fuel tanks and see if they have the custom shape or the "normal shape". @CarnationRED @linuxgurugamer(lgg, current maintainer)

Edited by kerbmario
Link to comment
Share on other sites

3 hours ago, kerbmario said:

If I import crafts that used TweakScale, the scaled parts aren't scaled when imported.

Kinda same thing for B9 Procedural Wings. Any Procedural (Wing) Part will revert to standard shape of the given part (the shape you get when you want to place that part in VAB!)

 

someone needs to try and import CFRP CarnationRed Flexible Fuel tanks and see if they have the custom shape or the "normal shape". @CarnationRED @linuxgurugamer(lgg, current maintainer)

Parts that require mods cannot be imported properly, since those mods can't run in Blender.  Even stock part variants are not supported. This is not likely to ever change. The craft importer was written at a time when such mods were not yet in common use.

Link to comment
Share on other sites

20 minutes ago, taniwha said:

Parts that require mods cannot be imported properly, since those mods can't run in Blender.  Even stock part variants are not supported. This is not likely to ever change. The craft importer was written at a time when such mods were not yet in common use.

so the importer only is able to import simple rockets?

Link to comment
Share on other sites

11 hours ago, kerbmario said:

so the importer only is able to import simple rockets?

Unfortunately, yes. However, if you treat it as "some assembly required", you can still use it to import more complex rockets. There are instructions for getting at the imported parts (right down to the mesh) in this thread. By doing so, you can tweak scales and visible mesh objects as needed. All of the imported parts should be placed correctly (though robotics parts might make that interesting), so the only real loss is automation.

Link to comment
Share on other sites

I just resized my model vertically to make it longer, when I select all of the parts and File>Export as Mu I get the folowing error.

Python: Traceback (most recent call last):
  File "C:\Users\ultro\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\io_object_mu-master\export_mu\operators.py", line 63, in execute
    return export_mu(self, context, **keywords)
  File "C:\Users\ultro\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\io_object_mu-master\export_mu\operators.py", line 34, in export_mu
    mu = export.export_object (context.active_object, filepath)
  File "C:\Users\ultro\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\io_object_mu-master\export_mu\export.py", line 181, in export_object
    anim_root_obj.animation = make_animations(mu, animations, anim_root)
  File "C:\Users\ultro\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\io_object_mu-master\export_mu\animation.py", line 296, in make_animations
    clip.curves.append(make_curve(mu, muobj, curve, path, typ))
  File "C:\Users\ultro\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\io_object_mu-master\export_mu\animation.py", line 172, in make_curve
    property, mult, ctyp = property_map[curve.data_path][curve.array_index]
KeyError: 'rotation_euler'


 

Link to comment
Share on other sites

1 hour ago, 1000sowy said:

I just resized my model vertically to make it longer, when I select all of the parts and File>Export as Mu I get the folowing error.

Nothing to do with the scaling. Euler rotations are not (yet) supported for animations. Use quaternions. ie, change the XYZ Euler under the rotation data to Quaternion (WXYZ). I don't know whether you'll have to reanimate or not.

Link to comment
Share on other sites

19 minutes ago, taniwha said:

Nothing to do with the scaling. Euler rotations are not (yet) supported for animations. Use quaternions. ie, change the XYZ Euler under the rotation data to Quaternion (WXYZ). I don't know whether you'll have to reanimate or not.

I'm already on Quaternion mode. 

Link to comment
Share on other sites

10 hours ago, 1000sowy said:

I'm already on Quaternion mode. 

Your animation data is not, though. So I guess you will need to remove the animation data and reanimate. I am currently busy with other things (including fixing some problems with the quickhull implementation), but if you were to compare property_map in import_mu/animation.py and export_mu/animation.py, you'd find that adding support shouldn't be too hard, and a PR would be greatly appreciated.

Link to comment
Share on other sites

1 hour ago, taniwha said:

Your animation data is not, though. So I guess you will need to remove the animation data and reanimate. I am currently busy with other things (including fixing some problems with the quickhull implementation), but if you were to compare property_map in import_mu/animation.py and export_mu/animation.py, you'd find that adding support shouldn't be too hard, and a PR would be greatly appreciated.

I'm more than a developer than I'm a designer, but I'm a Javascript guy, although they are similar languages in basic, I may be insufficient in Python. To be honest, I WOULD be. But I will take a look since you said it wouldn't be too hard.

 

Uh, so turns out it has nothing to do with programming. I thought this would require some Python knowledge. Forwarding this to Github now.

Edited by 1000sowy
Link to comment
Share on other sites

26 minutes ago, 1000sowy said:

Uh, so turns out it has nothing to do with programming. I thought this would require some Python knowledge. Forwarding this to Github now.

Yeah, it's more a data issue than a code issue. My problem is testing this sort of thing.

Link to comment
Share on other sites

first is scale, second is animation type (transform, material, light, etc). I suspect you'll need to scale by 180/pi because blender works in radians (internally) and Unity works in degrees (thus tau in the importer). Also, you might have problems with rotation order.

Link to comment
Share on other sites

6 hours ago, kerbmario said:

I want to save my animated part with XYZ euler, i get errors, i heard that that isnt supported is that true?

I have not had a chance to look at @1000sowy's PR, so not supported yet. I suspect there'll be issues with scaling and rotation order (Unity does not use the same order).

5 hours ago, kerbmario said:

welllll, if i manage to export (tried with WXYZ), and import again to see if it works MOST OF THE STUFF; ALL MESHES ARE GONE!!!! EVEN SOME COLLIDERS

This sounds suspiciously like you didn't create any materials. The easy check for this is to try importing again, but enable the "Force Invisible Meshes" option (right-hand side of the import dialog). If your objects show up, missing materials is the problem.

To set up materials, first to to Preferences -> Addons, Mu model format, and click the little triangle beside the checkbox that enables the addon. This will open the addon's options. In there, click the "install KSP Shader Presets" button (the others are optional, and GameData Path is for craft imports). You will probably want to ensure "Autohide Mesh Colliders" is NOT enabled. Once you have done that, in the Materials tab, find "Mu Shader" and where is says "Shaders" select the KSP shader you want. Below that (probably closed, so click the little triangles) are the various properties for the shader. Panels with defined properties have an indicator on their right.

In addition, beware the Dreaded Pirate Rob^W^W Parent inverse. This is a "feature" in Blender that makes working with the transforms of parented objects a little more intuitive (maybe), but wreaks havoc even in Blender when animating, let alone when exporting. Trying to use Blender's "Clear Parent Inverse" option is a long and winding path of pain and misery. Instead, select your model's root object and press "Clear Inverse" in the Mu Hierarchy panel in the tools tab. When it doubt, bounce on it.

There are probably many other gotcha's, but one important thing is that contrary to a certain forum poster, importing your own model should not be a part of your workflow. There are many things the exporter understands that the importer does not (and never will as some information the exporter uses cannot be stored in a .mu file). For example, the exporter does the right thing with modifiers. There is no way the importer can recreate a modifier stack.

Link to comment
Share on other sites

Thank you @taniwha for some more great information, didn't know you could get a model with no materials set to show up. I actually covered making sure that you have materials set up in my thread, will see about getting the info closer to the begining.

I basically got thrown in the deep end with 3D modeling without much in the way of clear instructions and I asked many questions on this thread with only very little reply of knowledge. So alot of what I worked out was through trial and error. At the time I started my thread you hadn't posted here since April 2021. Knowing how hard it had been for me to get clear information I set up the thread to try to pass on what I had found out so that other people had an easier time of it. As I have learned more I have tried to clear some misunderstandings up, I will see about going through and editing conflicts.

Very glad you are around again now.

 

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