Jump to content

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


Recommended Posts

@taniwha Alrighty, I've gotten the stuff to display and I can select individual parts; however, I can't select things like colliders, which I'm wanting to remove; I'm basically trying to get the models all arranged as they are in the craft, without any of the colliders, unused bits like shrouds, etc.

Link to comment
Share on other sites

I haven't looked into the collider issue yet, but I have got the importers working on the most recent versions of blender (git as of an hour or so ago), but other than shaders, I expect the fixes to be good for most versions of blender.

Link to comment
Share on other sites

@Lucas3214: please post the stack trace. With what you've given, all I know is that there was an error, no clue as to where.

However, one common mistake: The KSP GameData path (in the addon config panel in user prefs) has not been set.

Edited by taniwha
Link to comment
Share on other sites

On 3/27/2020 at 3:08 AM, taniwha said:

I can't help you if I don't see the trackback, other than to suggest that maybe you haven't configured the KSP GameData directory in the addon's config panel (in user->prefs->addons).

I'm having the same problem trying to select the .craft file for import , here's the traceback error:

Spoiler

Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.82\2.82\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.82\2.82\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.82\2.82\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.82\2.82\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.82\2.82\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.82\2.82\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

 

Also, if there is some extra step required, such as:  "maybe you haven't configured the KSP GameData directory in the addon's config panel (in user->prefs->addons)"

Could you please add that as "step 9" on the end of your installation instructions in the OP?

Also, I did take a look at the addon's config panel and was still not sure which directory slot we are supposed to characterize as the KSP GameData directory?  For me, when I navigate to user->prefs->addons, there is no option to specify a KSP GameData directory?  I only have checkbox options to enable/disable your import/export addon.

Could you be more specific here?  

 

Edited by XLjedi
Link to comment
Share on other sites

10 hours ago, XLjedi said:

Also, I did take a look at the addon's config panel and was still not sure which directory slot we are supposed to characterize as the KSP GameData directory?  For me, when I navigate to user->prefs->addons, there is no option to specify a KSP GameData directory?  I only have checkbox options to enable/disable your import/export addon.

I too went for years without knowing that those bars could be opened into panels. Click on the little triangle on the left end of the bar.

As for the instructions, sorry, I thought I had said something. I will fix that.

Link to comment
Share on other sites

On 3/28/2020 at 8:09 PM, taniwha said:

I too went for years without knowing that those bars could be opened into panels. Click on the little triangle on the left end of the bar.

As for the instructions, sorry, I thought I had said something. I will fix that.

Thanks I got it to work, but you're still really missing a step 9-10 in the OP so folks will know how to get the thing functional.

Link to comment
Share on other sites

On 3/28/2020 at 9:45 AM, XLjedi said:

I'm having the same problem trying to select the .craft file for import , here's the traceback error:

  Reveal hidden contents

Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 2.82\2.82\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.82\2.82\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.82\2.82\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.82\2.82\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.82\2.82\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.82\2.82\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

 

Also, if there is some extra step required, such as:  "maybe you haven't configured the KSP GameData directory in the addon's config panel (in user->prefs->addons)"

Could you please add that as "step 9" on the end of your installation instructions in the OP?

Also, I did take a look at the addon's config panel and was still not sure which directory slot we are supposed to characterize as the KSP GameData directory?  For me, when I navigate to user->prefs->addons, there is no option to specify a KSP GameData directory?  I only have checkbox options to enable/disable your import/export addon.

Could you be more specific here?  

 

Going back to my previous post where I already suggested it...  you eluded to it with this comment:

"maybe you haven't configured the KSP GameData directory in the addon's config panel (in user->prefs->addons)"  

My gut response to that is, "Well, you didn't tell me in the directions that I needed to do that or how to do it?"

Step 9 would be where specifically to look in blender (user->prefs->addons etc.) to find your installed app.

Step 10 would be your instructions (click on yellow triangle?) to make the input section appear where you can enter the default directory... and then to enter the KSP gamedata default directory

This is not in any way obvious.  Whether that's 1, 2 or 5 steps is up to you... it's just missing from the OP directions.

 

Edit:  oops, my bad...  did you go back and add it as sub-bullets there in step 6?  I don't actually recall seeing that before.  But that seems to be fine.  I just didn't notice it was added.  If I missed it originally, I concede I must be blind.

Edited by XLjedi
Link to comment
Share on other sites

Just now, taniwha said:

Those instructions are there now and have been for a week or so (just in step 6).

Ah...  I just didn't notice them at a glance today.  Was expecting something added to the last step.  

All is good!  I did get it to import a craft file.  Now I just need to devise some reasons for why that might be useful to me?  

Appreciate the app, thank you!

Link to comment
Share on other sites

Hello, i install the addon according to instruction in blender 2.82.

When i try to load a craft i get this error:

Spoiler

Traceback (most recent call last):
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\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\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 80, in import_craft_op
    obj = import_craft(filepath)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 44, in import_craft
    gamedata = GameData(Preferences().GameData)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 146, in __init__
    self.create_db()
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 129, in create_db
    recurse_tree(self.root, self.build_db)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 36, in recurse_tree
    recurse_tree(p, func)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 36, in recurse_tree
    recurse_tree(p, func)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 38, in recurse_tree
    func(p)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 102, in build_db
    self.process_cfg(path)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 89, in process_cfg
    cfg = ConfigNode.loadfile(path)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\cfgnode\cfgnode.py", line 90, in loadfile
    return cls.load(text)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\cfgnode\cfgnode.py", line 75, in load
    script = Script("", text, "{}=", False)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\cfgnode\script.py", line 32, in __init__
    elif text[0] == u"\ufeff":
IndexError: string index out of range

location: <unknown location>:-1

bpy.ops.import_object.ksp_craft(filepath="C:\\Program Files (x86)\\Steam\\steamapps\\common\\Kerbal Space Program\\Ships\\VAB\\Ariane 5 - Hermes.craft")
 

I'm complete new to blender. I can't identify the problem

Link to comment
Share on other sites

18 hours ago, taniwha said:

@josselin2196: That looks like the file itself is truncated to 0 bytes (ie, is empty). I suggest double checking the contents of the craft file. However, I do need to work on better error reporting.

I try using a vanilla craft, i have the same output:

Spoiler

Traceback (most recent call last):
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\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\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 80, in import_craft_op
    obj = import_craft(filepath)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 44, in import_craft
    gamedata = GameData(Preferences().GameData)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 146, in __init__
    self.create_db()
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 129, in create_db
    recurse_tree(self.root, self.build_db)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 36, in recurse_tree
    recurse_tree(p, func)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 36, in recurse_tree
    recurse_tree(p, func)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 38, in recurse_tree
    func(p)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 102, in build_db
    self.process_cfg(path)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 89, in process_cfg
    cfg = ConfigNode.loadfile(path)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\cfgnode\cfgnode.py", line 90, in loadfile
    return cls.load(text)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\cfgnode\cfgnode.py", line 75, in load
    script = Script("", text, "{}=", False)
  File "C:\Users\Josselin.LeBec-PC\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\io_object_mu-master\cfgnode\script.py", line 32, in __init__
    elif text[0] == u"\ufeff":
IndexError: string index out of range

location: <unknown location>:-1

bpy.ops.import_object.ksp_craft(filepath="C:\\Program Files (x86)\\Steam\\steamapps\\common\\Kerbal Space Program\\Ships\\VAB\\AeroEquus.craft")

 

Link to comment
Share on other sites

Blender gave me some errors when I tried to import a .craft file. I'm using Blender 2.82 and the version of this that you updated 20 hours ago. The .mu import works, just not the .craft. I did set the GameData directory, so I'm not sure if I missed a step or did something wrong. I tried with one of the stock .craft files as well, and same thing happened. Only other thing I can think of is that KSP is on D:\ instead of C:\

Spoiler

Traceback (most recent call last):
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.82\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 (x86)\Steam\steamapps\common\Blender\2.82\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 (x86)\Steam\steamapps\common\Blender\2.82\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 (x86)\Steam\steamapps\common\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\part.py", line 70, in get_model
    Vector((1, 1, 1)) * scale)
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\2.82\scripts\addons\io_object_mu-master\import_craft\part.py", line 76, in instantiate
    obj.instance_collection = self.model
ReferenceError: StructRNA of type Collection has been removed

location: <unknown location>:-1

bpy.ops.import_object.ksp_craft(filepath="C:\\Users\\Micro753\\Documents\\Dove.craft")

 

 

Edited by Micro753
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...