Jump to content

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


Recommended Posts

On 12/29/2020 at 10:47 AM, Frostydog1793 said:

I cant seem to export it as an STL file. When I do it just becomes a pile of non-connected parts clipping inside of each other. Image here: My Best KSP Rocket Yet! - Imgur

I imported the craft, hit "make instances real", deleted whatever parts were too fiddly, and highlighted the entire craft and exported it as an stl.

Link to post
Share on other sites
  • 2 weeks later...

Please can someone help me?

I have ksp blender and this addon and whenever I try to import a craft I get a FileNotDoundError: [WinError3] The system cannot find the path specified: ' '

I've been looking for hours on how to fix it but I can't seem to getit to work

Link to post
Share on other sites

@UltraGeekIt's mentioned several times throughout this thread but your problem is most likely that you have not set your KSP GameData path in blender via the options panel where you enabled the addon (you'll have to open the panel as it is collapsed by default).

Link to post
Share on other sites
On 1/12/2021 at 2:13 AM, taniwha said:

@UltraGeekIt's mentioned several times throughout this thread but your problem is most likely that you have not set your KSP GameData path in blender via the options panel where you enabled the addon (you'll have to open the panel as it is collapsed by default).

thx now I feel kinda embaraced for missing that, btw great job with the addon

Edit: now I'm getting this error

Python: Traceback (most recent call last):
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 106, in execute
    return import_craft_op(self, context, **keywords)
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 80, in import_craft_op
    obj = import_craft(filepath)
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 60, in import_craft
    part = gamedata.parts[pname].get_model()
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu-master\import_craft\part.py", line 64, in get_model
    self.cfg, loaded_parts_collection())
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu-master\model\model.py", line 49, in compile_model
    obj = mdl.instantiate(f"{name}:submodel", position, rotation, scale)
AttributeError: 'NoneType' object has no attribute 'instantiate'

location: <unknown location>:-1

Edited by UltraGeek
Link to post
Share on other sites

@UltraGeek Unfortunately, there aren't any clues in there to help find the problem part (not your fault, python's),

After looking at the code in the area suggested by the exception and doing a quick test on my system, I suspect that either the model referenced by the MODEL node is missing, or it has the wrong case: while windows is case-insensitive, linux (what I use all the time) is not, and nor is the database.

Link to post
Share on other sites

I ran into an other issue(the last one was caused by me not following the install guide and setting the game's folder not the gamedata folder)

 

Python: Traceback (most recent call last):
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu\import_craft\import_craft.py", line 106, in execute
    return import_craft_op(self, context, **keywords)
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu\import_craft\import_craft.py", line 80, in import_craft_op
    obj = import_craft(filepath)
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu\import_craft\import_craft.py", line 44, in import_craft
    gamedata = GameData(Preferences().GameData)
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu\import_craft\gamedata.py", line 140, in __init__
    self.models = Model.Preloaded()
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu\model\model.py", line 95, in Preloaded
    preloaded = Model(None, url)
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu\model\model.py", line 106, in __init__
    obj, mu = import_mu(model, path, False, False)
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu\import_mu\import_mu.py", line 199, in import_mu
    if not mu.read(filepath):
  File "C:\Users\HunKr\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\io_object_mu\mu.py", line 1181, in read
    self.file = open(filepath, "rb")
TypeError: expected str, bytes or os.PathLike object, not NoneType

location: <unknown location>:-1

I've seen that someone has had this issue and they've posted what they did to fix it but it's not too clear what they did to fix it.

Edited by UltraGeek
Link to post
Share on other sites
  • 1 month later...

Hi, I'm trying to use Blender to rotate an imported part, and the rotation doesn't seem to save. When I export the rotated part and import it again, it again gets the initial orientation

UPD:

The issue was with animation, it reset the whole model back. Had to delete it and make a new animation for new orientation

Edited by desert
Link to post
Share on other sites

Hi. I'm trying to Export a part and I'm getting an error message.  I'm using blender 2.91.

 

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\operators.py", line 81, in execute
    return export_mu(self, context, **keywords)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\operators.py", line 34, in export_mu
    mu = export.export_object (context.active_object, filepath)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\export.py", line 173, in export_object
    mu.obj = make_obj(mu, obj, "")
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\export.py", line 116, in make_obj
    return make_obj_core(mu, obj, path, muobj)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\export.py", line 105, in make_obj_core
    child = make_obj(mu, o, path)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\export.py", line 116, in make_obj
    return make_obj_core(mu, obj, path, muobj)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\export.py", line 105, in make_obj_core
    child = make_obj(mu, o, path)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\export.py", line 116, in make_obj
    return make_obj_core(mu, obj, path, muobj)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\export.py", line 105, in make_obj_core
    child = make_obj(mu, o, path)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\export.py", line 116, in make_obj
    return make_obj_core(mu, obj, path, muobj)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\export.py", line 105, in make_obj_core
    child = make_obj(mu, o, path)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\export.py", line 116, in make_obj
    return make_obj_core(mu, obj, path, muobj)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\export.py", line 84, in make_obj_core
    muobj = type_handlers[type(obj.data)](obj, muobj, mu)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\mesh.py", line 316, in handle_mesh
    muobj.shared_mesh = make_mesh(mu, obj)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\mesh.py", line 234, in make_mesh
    mumesh = make_mumesh(mesh, submeshes, vertex_data, vertex_map, num_verts)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu\export_mu\mesh.py", line 204, in make_mumesh
    if tangents[0] != None:
IndexError: list index out of range

location: <unknown location>:-1

Link to post
Share on other sites

@taniwha

I've been trying to load a craft file into Blender using your plugin.  For tests, I used KerbalX from KSP 1.10.1.  It loads, but is then totally uneditable.  The parachute is there, but it's just one big mass.  I'm trying to see if I can get an STL file from Blender to run through a 3d printer.

Any ideas?

Link to post
Share on other sites
  • 2 weeks later...

Hello,

I have some trouble using this addon.

I'm running the latest version of Blender, as I just updated it before installing the addon (from github).

Here's what I get when trying to import a .craft file :

bpy.ops.import_object.ksp_craft(filepath="C:\\Users\\Hugo\\Desktop\\_Geost__1.craft")

bpy.ops.outliner.item_activate(extend=False, deselect_all=True)

bpy.ops.outliner.delete(hierarchy=True)

bpy.ops.outliner.item_activate(extend=False, deselect_all=True)


Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu\import_craft\import_craft.py", line 106, in execute
    return import_craft_op(self, context, **keywords)
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu\import_craft\import_craft.py", line 80, in import_craft_op
    obj = import_craft(filepath)
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu\import_craft\import_craft.py", line 44, in import_craft
    gamedata = GameData(Preferences().GameData)
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu\import_craft\gamedata.py", line 146, in __init__
    self.create_db()
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu\import_craft\gamedata.py", line 129, in create_db
    recurse_tree(self.root, self.build_db)
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu\import_craft\gamedata.py", line 29, in recurse_tree
    files = os.listdir(path)
FileNotFoundError: [WinError 3] Le chemin daccès spécifié est introuvable: ''

location: <unknown location>:-1

Thanks in advance for your help.

Hugo.

 

Link to post
Share on other sites
1 hour ago, Hugo737 said:

I have some trouble using this addon.

I'm running the latest version of Blender, as I just updated it before installing the addon (from github).

Here's what I get when trying to import a .craft file :

Did you specify the GameData directory in the settings for the plugin?

Link to post
Share on other sites
4 minutes ago, linuxgurugamer said:

in the settings

Ah, thanks, I didn't even notice the inputs under the addon in the list in Blender.

Though I now have this error after a couple of seconds of loading :

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu\import_craft\import_craft.py", line 106, in execute
    return import_craft_op(self, context, **keywords)
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu\import_craft\import_craft.py", line 80, in import_craft_op
    obj = import_craft(filepath)
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu\import_craft\import_craft.py", line 60, in import_craft
    part = gamedata.parts[pname].get_model()
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu\import_craft\part.py", line 64, in get_model
    self.cfg, loaded_parts_collection())
  File "C:\Program Files\Blender Foundation\Blender 2.92\2.92\scripts\addons\io_object_mu\model\model.py", line 49, in compile_model
    obj = mdl.instantiate(f"{name}:submodel", position, rotation, scale)
AttributeError: 'NoneType' object has no attribute 'instantiate'

location: <unknown location>:-1

 

Link to post
Share on other sites

I'm Having a similar issue with importing .craft files. I am able to import .mu files perfectly fine but when I'm trying with a .craft, It always displays a python error:

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 106, in execute
    return import_craft_op(self, context, **keywords)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 80, in import_craft_op
    obj = import_craft(filepath)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 44, in import_craft
    gamedata = GameData(Preferences().GameData)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 146, in __init__
    self.create_db()
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 129, in create_db
    recurse_tree(self.root, self.build_db)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 29, in recurse_tree
    files = os.listdir(path)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''

location: <unknown location>:-1

 

Link to post
Share on other sites
7 hours ago, gatkat13 said:

I'm Having a similar issue with importing .craft files.

Looks like what I had at first, make sure you put the game directory here :

capture_blender_ksp1.png

Link to post
Share on other sites

Hm, for some reason I get another error log.
I'm now on Blender 2.83 which is the version the addon was made for and I'm trying to open a non-modded aircraft.

bpy.ops.import_object.ksp_craft(filepath="C:\\Program Files (x86)\\Steam\\steamapps\\common\\Kerbal Space Program\\saves\\par défaut\\Ships\\VAB\\test.craft")


Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\addons\io_object_mu\import_craft\import_craft.py", line 106, in execute
    return import_craft_op(self, context, **keywords)
  File "C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\addons\io_object_mu\import_craft\import_craft.py", line 80, in import_craft_op
    obj = import_craft(filepath)
  File "C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\addons\io_object_mu\import_craft\import_craft.py", line 44, in import_craft
    gamedata = GameData(Preferences().GameData)
  File "C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\addons\io_object_mu\import_craft\gamedata.py", line 140, in __init__
    self.models = Model.Preloaded()
  File "C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\addons\io_object_mu\model\model.py", line 95, in Preloaded
    preloaded[url] = Model(None, url)
  File "C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\addons\io_object_mu\model\model.py", line 106, in __init__
    obj, mu = import_mu(model, path, False, False)
  File "C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\addons\io_object_mu\import_mu\import_mu.py", line 199, in import_mu
    if not mu.read(filepath):
  File "C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\addons\io_object_mu\mu.py", line 1181, in read
    self.file = open(filepath, "rb")
TypeError: expected str, bytes or os.PathLike object, not NoneType

location: <unknown location>:-1

Thanks in advance for your help.

Link to post
Share on other sites
On 3/10/2021 at 2:51 AM, Hugo737 said:

Looks like what I had at first, make sure you put the game directory here :

capture_blender_ksp1.png

I have done that but after a couple seconds of loading, I get this message: 
 

Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 106, in execute
    return import_craft_op(self, context, **keywords)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 80, in import_craft_op
    obj = import_craft(filepath)
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 60, in import_craft
    part = gamedata.parts[pname].get_model()
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu-master\import_craft\part.py", line 64, in get_model
    self.cfg, loaded_parts_collection())
  File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\io_object_mu-master\model\model.py", line 49, in compile_model
    obj = mdl.instantiate(f"{name}:submodel", position, rotation, scale)
AttributeError: 'NoneType' object has no attribute 'instantiate'

location: <unknown location>:-1

 

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.

×
×
  • Create New...