DrexW Posted March 24, 2018 Share Posted March 24, 2018 oi taniwha,does exporting work yet?i have a serious urge to make a small mod but i just cant seem to find out how to export models to .mu and this addon seems like just the right thing Quote Link to comment Share on other sites More sharing options...
taniwha Posted March 24, 2018 Author Share Posted March 24, 2018 @DrexW: exporting of what, in particular? AFAIK, the only thing not working currently is skinned meshes and bones. Quote Link to comment Share on other sites More sharing options...
DrexW Posted March 24, 2018 Share Posted March 24, 2018 exporting of a blender model.textures are not required,nor do they work,since each time i attempt to export the model blender gives me an error Quote Link to comment Share on other sites More sharing options...
taniwha Posted March 25, 2018 Author Share Posted March 25, 2018 @DrexW: I'm sorry, but I need specifics. What is the error? What steps did you perform to get the error? Also, have you grabbed the latest updates (3 days ago as of this post)? [note, you need to use git]. At a guess, the error you are getting is about missing UV maps. This was fixed three weeks ago. Quote Link to comment Share on other sites More sharing options...
taniwha Posted March 25, 2018 Author Share Posted March 25, 2018 I have removed the version from the thread title as it is quite incorrect and I have not done an actual release since 1.0.0, nor do I plan to do an actual release any time soon. However, I very much do plan on continuing development. Quote Link to comment Share on other sites More sharing options...
DrexW Posted March 25, 2018 Share Posted March 25, 2018 actually,nevermind,it was textures messing it up,after doing a quick uv re-map it was fine Quote Link to comment Share on other sites More sharing options...
taniwha Posted April 11, 2018 Author Share Posted April 11, 2018 (edited) @LatiMacciato: just a heads-up to let you know this exists. Thought it better than derailing the KPBS thread too much. Edited April 11, 2018 by taniwha Quote Link to comment Share on other sites More sharing options...
LatiMacciato Posted April 11, 2018 Share Posted April 11, 2018 20 hours ago, taniwha said: @LatiMacciato: just a heads-up to let you know this exists. Thought it better than derailing the KPBS thread too much. I've yet get to get used with Blender (I'm used to C4D tho, unsure how to make meshes that fillfill the requirements for KSP). I might get behind it eventually, in a far far future LOL. Quote Link to comment Share on other sites More sharing options...
pencatpigpus Posted June 1, 2018 Share Posted June 1, 2018 Thank you so much Quote Link to comment Share on other sites More sharing options...
Jesusthebird Posted July 1, 2018 Share Posted July 1, 2018 Ive found this useful for locating specific meshes to exclude for TU shaders. This is going to help me a lot with my future project . Thanks a bunch! Quote Link to comment Share on other sites More sharing options...
ringerc Posted July 9, 2018 Share Posted July 9, 2018 (edited) How practical would it be to take the .mu reading code and teach it to dump the part properties to the command line instead? I'm looking for a way to see the CoG, CoP etc baked into the part, and it's amazingly opaque in KSP. edit: https://github.com/taniwha/io_object_mu, python dump.py /path/to/KSP_linux/GameData/Squad/Parts/Command/Mk1-3Pod/Mk1-3.mu shows me the model metadata, but I don't see the CoG there. Hint? Is it part of M1-3 Pod lp (-1.4010000228881836, 0.0, 0.0) lr (1.0, -0.0, -0.0, -0.0) ls (1.0, 1.0, 1.0) Edit, from the code print("%s lp %s" % (" " * level, str(trans.localPosition))) print("%s lr %s" % (" " * level, str(trans.localRotation))) print("%s ls %s" % (" " * level, str(trans.localScale))) so "localPosition", "localRotation" and "localScale" respectively. I'm assuming that localPosition is the default CoM, but some insight would be a huge help. Also, do your vectors have the same component-order as the ModuleManager vectors? Because lp would make way more sense if it were (0.0, -1.4, 0.0) for the CM... (Fascinatingly, this shows me that the mk1-3 pod does have RCS ports in its model, but they're unnamed. Wonder if that means I can't enable them from ModuleManager - I've wanted to make RCS stock on all pods). Also, Kia-Ora from an Aoterora expat in the big flat red place. Edited July 9, 2018 by ringerc Quote Link to comment Share on other sites More sharing options...
DAWN Posted July 9, 2018 Share Posted July 9, 2018 this tool is great.however,i cant import .craft files. Quote Traceback (most recent call last): File "D:\new\blender\2.79\scripts\addons\io_object_mu-master\import_craft.py", line 93, in execute return import_craft_op(self, context, **keywords) File "D:\new\blender\2.79\scripts\addons\io_object_mu-master\import_craft.py", line 74, in import_craft_op obj = import_craft(filepath) File "D:\new\blender\2.79\scripts\addons\io_object_mu-master\import_craft.py", line 41, in import_craft gamedata = GameData(Preferences().GameData) File "D:\new\blender\2.79\scripts\addons\io_object_mu-master\__init__.py", line 146, in Preferences return addons["io_object_mu"].preferences KeyError: 'bpy_prop_collection[key]: key "io_object_mu" not found' location: <unknown location>:-1 that's the error code,how can i solve this problem? (thanks for your tool!) (please forgive me for my poor English) Quote Link to comment Share on other sites More sharing options...
taniwha Posted July 10, 2018 Author Share Posted July 10, 2018 (edited) @DAWN: rename your io_object_mu-master directory to io_object_mu. @ringerc: The default COM for a part is the root object. When you import a .mu into blender, press alt-g to ensure the model is at blender's origin. Blender's origin is then the part's COM unless the COM has been offset in the .cfg file. If the cfg does set the COM offset, move the whole model in the opposite direction: blender's origin will then be the part's COM. I doubt it's much more useful to your purposes, but you might find mucfg.py more interesting that dump.py: it dumps the model data as a KSP cfg file (nothing reads it yet, though). Edited July 10, 2018 by taniwha Quote Link to comment Share on other sites More sharing options...
ghostbuzzer7 Posted July 30, 2018 Share Posted July 30, 2018 (edited) @taniwha I can't express how happy I am to read about the revival of the .mu importer. Even more so that you took on the task to fix it. I always loved making renders out of this thing until it became outdated... and to see it come back again just opens up memories to this great blender addon. I've tried working around the code for this one but I got stumped by it. I guess my time away from KSP and the blender importer really came in effect. The game version was 1.4.3 and even a single part fuel tank craft would load up the axis but not the physical model. (and keep up the good work! It's exciting to see this addon resurface on this forum ) If the album doesn't work because I forgot how to work the forums too, here is the link. Album GsdbU1w will appear when post is submitted I give up on albums: Spoiler Edited July 30, 2018 by ghostbuzzer7 Forum changes too much. Quote Link to comment Share on other sites More sharing options...
Maeyanie Posted August 30, 2018 Share Posted August 30, 2018 (edited) Using Blender 2.79 and git version 49e9ab0 , Trying to import a .craft file gave me this error: Traceback (most recent call last): File "D:\Blender Foundation\Blender\2.79\scripts\addons\io_object_mu\import_craft.py", line 95, in execute return import_craft_op(self, context, **keywords) File "D:\Blender Foundation\Blender\2.79\scripts\addons\io_object_mu\import_craft.py", line 70, in import_craft_op obj = import_craft(filepath) File "D:\Blender Foundation\Blender\2.79\scripts\addons\io_object_mu\import_craft.py", line 56, in import_craft part = gamedata.parts[pname].get_model() File "D:\Blender Foundation\Blender\2.79\scripts\addons\io_object_mu\part.py", line 68, in get_model self.cfg, loaded_parts_scene()) File "D:\Blender Foundation\Blender\2.79\scripts\addons\io_object_mu\model.py", line 57, in compile_model scale = parse_vector(n.GetValue("scale")) NameError: name 'parse_vector' is not defined It doesn't seem to happen for every craft, though. The one I pasted this from was RO RN Sputnik 1 (though it did happen with some others as well.) Also, the "Install KSP Shader Presets" button gave this error: Traceback (most recent call last): File "D:\Blender Foundation\Blender\2.79\scripts\addons\io_object_mu\preferences.py", line 55, in execute install_presets("shaders") File "D:\Blender Foundation\Blender\2.79\scripts\addons\io_object_mu\preferences.py", line 30, in install_presets dst=presets[-1] + "/" + shader.IO_OBJECT_MU_MT_shader_presets.preset_subdir NameError: name 'shader' is not defined Edited August 30, 2018 by Maeyanie Quote Link to comment Share on other sites More sharing options...
VentZer0 Posted September 12, 2018 Share Posted September 12, 2018 (edited) ^ I get the same error when trying to install the shaders, also on 2.79 (Steam) The creating of color palettes is also giving an error. Edited September 12, 2018 by VentZer0 Quote Link to comment Share on other sites More sharing options...
taniwha Posted October 18, 2018 Author Share Posted October 18, 2018 I am currently working on support for blender 2.8 (available on the blender2.8 branch). While there are still some warts, the very basics are mostly working: importing .mu files works except for the blender material setup, exporting .mu files works but due to a missing feature in blender 2.8, the volume calculations are broken (I imagine most people didn't know about that feature anyway :P ) Quote Link to comment Share on other sites More sharing options...
Electrocutor Posted October 18, 2018 Share Posted October 18, 2018 Is there any chance you could offload the byte format stuff for .mu files into a compiled .dll so as to allow .mu files to be read? Namely, I am looking to read a .mu and get a list of mesh names, material names, and texture paths from those materials. I am working on a WPF app to create/edit parts via GUI, and the mesh and material names are needed to pre-fill drop-downs for some values in PartModule config sections. It also has a sub-feature for scanning the mod folder for orphaned files, such as unused textures. Quote Link to comment Share on other sites More sharing options...
Mecripp Posted October 18, 2018 Share Posted October 18, 2018 3 hours ago, Electrocutor said: Is there any chance you could offload the byte format stuff for .mu files into a compiled .dll so as to allow .mu files to be read? Namely, I am looking to read a .mu and get a list of mesh names, material names, and texture paths from those materials. I am working on a WPF app to create/edit parts via GUI, and the mesh and material names are needed to pre-fill drop-downs for some values in PartModule config sections. It also has a sub-feature for scanning the mod folder for orphaned files, such as unused textures. Have you tried https://github.com/sarbian/DebugStuff Quote Link to comment Share on other sites More sharing options...
Electrocutor Posted October 18, 2018 Share Posted October 18, 2018 33 minutes ago, Mecripp said: Have you tried https://github.com/sarbian/DebugStuff DebugStuff runs inside Unity after KSP has already read in the .mu data; this needs to be programmatic and is done outside the game. Quote Link to comment Share on other sites More sharing options...
taniwha Posted October 19, 2018 Author Share Posted October 19, 2018 @Electrocutor: the file handling code is already in a separate file, mu.py, and there are already several tools ini the io_object_mu directory that use it to do various things, just as jumping the .mu file to .cfg node, edit wheel collider parameters (not so useful since KSP 1.1), and convert all mesh colliders to convex hulls, amongst others. Some of those tools came before the importer, even. Quote Link to comment Share on other sites More sharing options...
Electrocutor Posted October 19, 2018 Share Posted October 19, 2018 20 minutes ago, taniwha said: @Electrocutor: the file handling code is already in a separate file, mu.py, and there are already several tools ini the io_object_mu directory that use it to do various things, just as jumping the .mu file to .cfg node, edit wheel collider parameters (not so useful since KSP 1.1), and convert all mesh colliders to convex hulls, amongst others. Some of those tools came before the importer, even. Alright, thanks. I'll see if I can find a decent python to c# converter. Quote Link to comment Share on other sites More sharing options...
Electrocutor Posted November 7, 2018 Share Posted November 7, 2018 @taniwha I import a .mu, change the material properties (there is only one), and then export it, but the new render seems to have only rendered 1/4, while the rest are now black. Any ideas? Quote Link to comment Share on other sites More sharing options...
taniwha Posted December 2, 2018 Author Share Posted December 2, 2018 As Blender 2.80 has finally gone beta, I have merged my blender2.8 branch into master and created a blender2.79 branch to continue support for 2.79. This update brings a lot to the table: Much faster import of dds images, especially dds normal maps (shader hacks to do the conversions instead of in python). Much better blender material creation from KSP shaders (not all shaders supported yet). Looks great with Eevee :). Initial skinned mesh/armature support (animations broken still). Support for CoMOffset, CoPOffset and CoLOffset when generating cfg files from cfg.in (just add an empty with the right name to your hierarchy). Full support for collection instancing (including nested collections) on export. Better collider workflow (don't need to add a zillion empties for complex collider setups). Duplicated primitive colliders (sphere/box/capsule/wheel) do copy-on-write when a duplicate is tweaked. Models are now always imported at the cursor. Directory hierarchy cleaned up: much easier to find the command line utilities. Mu Tools buttons moved to blender's new tool properties panel. Clear parent inverse tool added: recursively clears the parent inverse transform of objects. This is necessary for correct transform handling in Unity, and makes for cleaner animations in blender anyway (yeah, what is "parent inverse transform"? Hard to explain but the important thing is that blender's default parenting behavior will mess up your hierarchy if the parent object is transformed). Attach node transforms import correctly (ie, correct orientation) There are bugs still (and likely will be some due to recent blender API changes), but I have been using blender 2.80 for "production" for a while now. Quote Link to comment Share on other sites More sharing options...
taniwha Posted December 11, 2018 Author Share Posted December 11, 2018 I have just pushed (to both master and the blender2.79 branch) a fix for incorrectly exported tangent vectors. 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.