taniwha Posted July 21, 2019 Author Share Posted July 21, 2019 (edited) I have finally got armature (ie, skinned mesh renderer with bone deformation) support working, for both import (which it wasn't, really, before) and export, including animation of bones. (post got merged) @Olympic1: oh, great well, thanks, I'll look into that (I did my testing on the launch clamp and @Angel-125's DSEV centrifuge). Edited July 21, 2019 by taniwha Quote Link to comment Share on other sites More sharing options...
taniwha Posted July 21, 2019 Author Share Posted July 21, 2019 Yeah, that's pretty messed up. Just a general failure all-round. I see the problem, though: it's because there are two skins sharing the one armature hierarchy. I was wondering if I would need to support that situation. It looks like the answer is a resounding "yes". Quote Link to comment Share on other sites More sharing options...
taniwha Posted July 21, 2019 Author Share Posted July 21, 2019 @Olympic1: the problem was exactly what I thought it was: two skins sharing the skeleton. That is fixed, but it turns out I've got the fcurve transformation wrong so that still needs fixing. Quote Link to comment Share on other sites More sharing options...
taniwha Posted July 21, 2019 Author Share Posted July 21, 2019 (edited) @Olympic1: another update: the cause of the fcurve problem is that it seems the skeleton/armature is not anywhere near the skins in the hierarchy. I'm not sure how, of even if, I can automate this. [edit] or at least partially caused by that [edit 2] Actually, I'm not sure about that at all. Not one skirt bone has a nice rotation, and none of the skirt bones work properly. The switches are all unrotated and do work properly. I did noticed while getting export that blender's bone rotation fcurves are in bone space (location can be forced to be parent space), so I guess I've got to figure out what I'm doing wrong with the rotations. Edited July 21, 2019 by taniwha Quote Link to comment Share on other sites More sharing options...
Olympic1 Posted July 21, 2019 Share Posted July 21, 2019 @taniwha Thx for trying to fix this, I really appreciate your work for this addon Quote Link to comment Share on other sites More sharing options...
taniwha Posted July 21, 2019 Author Share Posted July 21, 2019 I got the rotations sorted out. There's still a problem with either bind pose setup or location/scale animation, but it works much better now. Quote Link to comment Share on other sites More sharing options...
taniwha Posted July 24, 2019 Author Share Posted July 24, 2019 @LatiMacciato: Answering here not because it's off topic in EL, but because it's on topic here (others with similar questions are more likely to look here). Dealing with textures for KSP in blender varies in difficulty: most difficult being dds (they're upside down). However... UVs are are done the same way as any other blender model. The exporter uses the first layer on the list (and only one layer because when I tried supporting two, I found that KSP ignored the second layer). That's the easy part (hah, from what I've heard from other modders regarding UVs...) done... Materials are a little fiddly, but not too bad... Before doing anything (this is generally once-only), ensure the shader presets are installed: in User Preferences -> Add-ons, open the Mu model import panel. You should find a Shaders section with an "Install KSP Shader Presets" button. Click that, it will install a bunch of shader configs that you can use later. (config templates are a little advanced and off topic for this post, but the color palettes might interest you (for texture and image painting in blender). gamedata path is for importing craft files). With your object selected, go to the materials panel and add a material (make sure it's connected to the mesh rather than the object: dropdown to the right of the new material button/material name). Then scroll down through the panel until you find the Mu Material section. At the top of that, you will find a "Shaders" dropdown: from that select the shader you want to use (requires previous step, so if there's no list, go do that). Selecting a shader will fill in a bunch of values with reasonable defaults. The "Name" field is the name of the material in the .mu file. "Shader" is the name of the shader that will be used and must be one available to KSP when the model is loaded (Unity, KSP, or mod shader should be ok). I'll use "KSP/Diffuse" as an example because it's simple. Below that is a series of collapsed boxes: Textures, Colors, Vectors, Float2 and Float3 (I never did figure out whether the two float types in a mu material spec can be merged, or what the exact difference is in unity): those hold the various shader properties, and those with fields in them will have a dot to the right of the bar. For KSP/Diffuse, only Textures and Colors have values. In general, you need to edit only Textures, so open that. In there you'll find a list of shader properties (click on the one you edit, but for KSP/Diffuse, there's only _MainTex), a field with the property name (don't edit unless you know what you're doing), and below that, the name of the texture to use (default is "gray"): set this to the name of your texture (for preview in blender, you need to have an image loaded with the same name in the image editor). I think that's pretty much it. Other shaders just have more/different properties. Note that not all shaders are supported for viewing in blender (I haven't figured out the node setup), but for those that are, they look pretty cool in Eevee render . Quote Link to comment Share on other sites More sharing options...
LatiMacciato Posted July 24, 2019 Share Posted July 24, 2019 (edited) @taniwha You're just amazing! Thank you very much for helping out! Shaders installed and the 2 other options is a very great help. Seriously .. I was searching for the 3 Buttons for 30 mins .. yes Blender is killing me LOL but the 2.80 interface looks WAAAY better! EDIT: I'm aware of this addon is not even alpha, tho I ran into this error when attempting to export mu file: Spoiler Traceback (most recent call last): File "<snip>/blender-2.80rc2-linux-glibc217-x86_64/2.80/scripts/addons/io_object_mu/export_mu/operators.py", line 63, in execute return export_mu(self, context, **keywords) File "<snip>/blender-2.80rc2-linux-glibc217-x86_64/2.80/scripts/addons/io_object_mu/export_mu/operators.py", line 34, in export_mu mu = export.export_object (context.active_object, filepath) File "<snip>/blender-2.80rc2-linux-glibc217-x86_64/2.80/scripts/addons/io_object_mu/export_mu/export.py", line 157, in export_object mu.obj = make_obj(mu, obj, "") File "<snip>blender-2.80rc2-linux-glibc217-x86_64/2.80/scripts/addons/io_object_mu/export_mu/export.py", line 120, in make_obj return make_obj_core(mu, obj, path, muobj) File "<snip>/blender-2.80rc2-linux-glibc217-x86_64/2.80/scripts/addons/io_object_mu/export_mu/export.py", line 109, in make_obj_core child = make_obj(mu, o, path) File "<snip>/blender-2.80rc2-linux-glibc217-x86_64/2.80/scripts/addons/io_object_mu/export_mu/export.py", line 120, in make_obj return make_obj_core(mu, obj, path, muobj) File "<snip>/blender-2.80rc2-linux-glibc217-x86_64/2.80/scripts/addons/io_object_mu/export_mu/export.py", line 89, in make_obj_core muobj = type_handlers[type(obj.data)](obj, muobj, mu) File "<snip>/blender-2.80rc2-linux-glibc217-x86_64/2.80/scripts/addons/io_object_mu/export_mu/mesh.py", line 237, in handle_mesh muobj.renderer = make_renderer(mu, obj.data) File "<snip>/blender-2.80rc2-linux-glibc217-x86_64/2.80/scripts/addons/io_object_mu/export_mu/mesh.py", line 182, in make_renderer rend.materials = mesh_materials(mu, mesh) File "<snip>/blender-2.80rc2-linux-glibc217-x86_64/2.80/scripts/addons/io_object_mu/export_mu/mesh.py", line 173, in mesh_materials if mat.mumatprop.shaderName: AttributeError: 'NoneType' object has no attribute 'mumatprop' location: <unknown location>:-1 EDIT 2: Hierarchy resorting helped! I had the RecycleField object/collider next to the main object, but should have been as part inside of the main mesh. Edited July 25, 2019 by LatiMacciato Quote Link to comment Share on other sites More sharing options...
seanth Posted August 2, 2019 Share Posted August 2, 2019 (edited) When importing .mu or .craft, are they supposed to have their textures automatically? If so, I think mine is configured incorrectly https://www.dropbox.com/s/v90xpqpxqem3j8u/Screenshot 2019-08-02 18.13.45.png EDIT: Ignore me. I'm a Blender noob and was just missing a critical step. Herp derp Edited August 2, 2019 by seanth Quote Link to comment Share on other sites More sharing options...
Guest Posted August 6, 2019 Share Posted August 6, 2019 Hello ! I have just one question : how to use the mesh collider ? When i want to add one, blender send me an error message. So thank you for your help ! Quote Link to comment Share on other sites More sharing options...
taniwha Posted August 16, 2019 Author Share Posted August 16, 2019 @Lgg159: sorry, I need more details. I just tried all the mesh collider options (in blender 2.80) and they all worked. Quote Link to comment Share on other sites More sharing options...
Guest Posted August 16, 2019 Share Posted August 16, 2019 @taniwha Ok the problem come from an older version of your addon. I've downloaded the last one and the problem is gone. But thank you anyway ! Quote Link to comment Share on other sites More sharing options...
taniwha Posted August 19, 2019 Author Share Posted August 19, 2019 ah, cool, glad you got things working Quote Link to comment Share on other sites More sharing options...
Wasabi Posted September 1, 2019 Share Posted September 1, 2019 On 8/2/2019 at 4:15 PM, seanth said: When importing .mu or .craft, are they supposed to have their textures automatically? If so, I think mine is configured incorrectly https://www.dropbox.com/s/v90xpqpxqem3j8u/Screenshot 2019-08-02 18.13.45.png EDIT: Ignore me. I'm a Blender noob and was just missing a critical step. Herp derp My textures aren't working, and rather than digging through this thread to try and find an answer, could you explain to me what you did to fix your problem? Quote Link to comment Share on other sites More sharing options...
linuxgurugamer Posted September 14, 2019 Share Posted September 14, 2019 (edited) @taniwha Never mind, my shortcut was going to the wrong Blender Edited September 14, 2019 by linuxgurugamer Quote Link to comment Share on other sites More sharing options...
linuxgurugamer Posted September 14, 2019 Share Posted September 14, 2019 Ok, so back to my original problem. Blender 2.80, and the plugin cloned today I'm importing a tank into Blender. I rename the main object So far, so good. To export, I select the collection, and then do the export. But when I load this into KSP, the tank is on it's side What can I do to fix this? Thanks in advance Quote Link to comment Share on other sites More sharing options...
ceceriboli Posted September 26, 2019 Share Posted September 26, 2019 Hi @taniwha, I would like to import a whole craft to Blender. Is it possibile using this Plugin? Because I tried but got an error. Quote Link to comment Share on other sites More sharing options...
ssd21345 Posted October 6, 2019 Share Posted October 6, 2019 On 9/26/2019 at 2:30 PM, ceceriboli said: Hi @taniwha, I would like to import a whole craft to Blender. Is it possibile using this Plugin? Because I tried but got an error. You need to set gamedata folder location in Preferences> expand mu importer addon info. However if you have a lot of mods the addon will freak out Quote Link to comment Share on other sites More sharing options...
Guest Posted October 17, 2019 Share Posted October 17, 2019 Quote Traceback (most recent call last): File "E:\SteamLibrary\steamapps\common\Blender\2.80\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 106, in execute return import_craft_op(self, context, **keywords) File "E:\SteamLibrary\steamapps\common\Blender\2.80\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 80, in import_craft_op obj = import_craft(filepath) File "E:\SteamLibrary\steamapps\common\Blender\2.80\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 60, in import_craft part = gamedata.parts[pname].get_model() File "E:\SteamLibrary\steamapps\common\Blender\2.80\scripts\addons\io_object_mu-master\import_craft\part.py", line 70, in get_model Vector((1, 1, 1)) * scale) File "E:\SteamLibrary\steamapps\common\Blender\2.80\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 This is the series of error I got when trying to use the craft importer Quote Link to comment Share on other sites More sharing options...
Nether Posted October 24, 2019 Share Posted October 24, 2019 (edited) Wondering if someone could help with an issue, my goal is to remove variants from .mu files for a mod that breaks with variants to work. After removing variants the part looks fine in shading window preview, bu in game the shading looks off. I tried just importing a part, doing 0 changes and then exporting it, and it still breaks. This is how it looks in the preview:https://imgur.com/chULkio In game it looks like this : https://imgur.com/LRCOltv And when I import it back into Blender it now looks like this, there is a line that breaks the smoothness of the surface and at that line there is drastic change in shading.https://imgur.com/ytFwiJ7 Edited October 24, 2019 by Nether Quote Link to comment Share on other sites More sharing options...
Supergamervictor Posted November 7, 2019 Share Posted November 7, 2019 (edited) @taniwha I'm assuming MultiMesh and Procedural mods are not (yet) supported? I have the unfortunate predicament of having every ship made from B9 Proc Wings and MultiMesh parts. Are there any other mods that might not work with the plugin? Thanks for updating this for 2.8 btw, really excited to see what I can make using this. Edited November 7, 2019 by Supergamervictor Quote Link to comment Share on other sites More sharing options...
ZeroC00l Posted December 7, 2019 Share Posted December 7, 2019 (edited) I tried to import a craft, but it is said that the file ' ' doesn't exist Can this be fixed? Quote Traceback (most recent call last): File "C:\Users\aaliu\AppData\Roaming\Blender Foundation\Blender\2.81\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\aaliu\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 80, in import_craft_op obj = import_craft(filepath) File "C:\Users\aaliu\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_object_mu-master\import_craft\import_craft.py", line 44, in import_craft gamedata = GameData(Preferences().GameData) File "C:\Users\aaliu\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\io_object_mu-master\import_craft\gamedata.py", line 146, in __init__ self.create_db() File "C:\Users\aaliu\AppData\Roaming\Blender Foundation\Blender\2.81\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\aaliu\AppData\Roaming\Blender Foundation\Blender\2.81\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 Edited December 7, 2019 by ZeroC00l Quote Link to comment Share on other sites More sharing options...
Björn Kerman Posted January 4, 2020 Share Posted January 4, 2020 How do you install this in blender 2.8? there is no "User preferences" tab in "file". Quote Link to comment Share on other sites More sharing options...
Björn Kerman Posted January 4, 2020 Share Posted January 4, 2020 On 9/14/2019 at 4:38 AM, linuxgurugamer said: Ok, so back to my original problem. Blender 2.80, and the plugin cloned today I'm importing a tank into Blender. I rename the main object So far, so good. To export, I select the collection, and then do the export. But when I load this into KSP, the tank is on it's side What can I do to fix this? Thanks in advance Put the tank on it's side in blender, so it get's turned the right way in KSP? Quote Link to comment Share on other sites More sharing options...
taniwha Posted January 8, 2020 Author Share Posted January 8, 2020 Old instructions. It's in "edit" now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.