Crimeo Posted May 3, 2017 Share Posted May 3, 2017 (edited) Hi, I can import fine, but the export button is visible, yet grayed out (can export to dae etc., but mu is grayed out only)? All I did was import a mu file, delete a coffee cup, and dag some cameras around, so I'm pretty confident I didn't add any unsupported things, etc. since I didn't add anything at all, or change any properties. Why is it not letting me export? Edited May 3, 2017 by Crimeo Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 3, 2017 Author Share Posted May 3, 2017 @Crimeo: For the export button to be enabled, the active object must be either an empty or a mesh object. What you need to do is select the root object of the model, which will pretty much always be an empty. KSP models are a tree of objects in parent-child relationships. Quote Link to comment Share on other sites More sharing options...
khr15714n Posted May 23, 2017 Share Posted May 23, 2017 At some point in the past GameData\Squad\Spaces\MK3_CrewCab_Int\MK3_CrewCab_Int.mu was changed and ended up with two Camera_Left004 and no Camera_Left003. [LOG 14:21:51.447] PartLoader: Compiling Internal Space 'Squad/Spaces/MK3_CrewCab_Int/internal_MK3_CrewCab/MK3_CrewCab_Int' [LOG 14:21:51.449] InternalSeat: Cannot find portraitCamera of name 'Camera_Left003' While I was able to distinguish the two lights correctly and changing the mu in a hex-editor is working this is not the way I wanna go. I followed the instructions seen in thread as simple as they are and importing works fine. Renaming the two lights (Camera_Left004 becomes Camera_Left003 and Camera_Left004.001 becomes Camera_Left004) is simple. But it seems I'm missing something when I try to export the mu: Spoiler A 2.04 MB mu becomes a 592 KB one. Including the expected error in ksp.log. What am I doing wrong in Blender? Thanks in advance Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 23, 2017 Author Share Posted May 23, 2017 This may or may not be the cause of the errors, but I was able to export the internal (unmodified) just fine: you need to select the root object of the heirarchy. This is the empty named "MK3_CrewCabin_Int", and is at the root of the tree in the scene view (currently hidden under your error panel). If you select only that empty, it should work. Quote Link to comment Share on other sites More sharing options...
khr15714n Posted May 24, 2017 Share Posted May 24, 2017 Thanks for reply. You can see the highlighted (white) "MK3_CrewCabin_Int" root object between the third and fourth line hidden under the error panel. I've also moved the "Select" snippet to show this better. I've followed your instruction and only selected the root object "MK3_CrewCabin_Int": Spoiler Same result. Just to make sure there is no other flaw on my side: Extracted https://github.com/taniwha/io_object_mu/releases io_object_mu-1.0.0.zip ... C:\Program Files\Blender Foundation\Blender\2.78\scripts\addons\io_object_mu\*.py Blender 2.78c in Blender mode I've also tried to rename the four *.mbm to *.dds in MK3_CrewCab_Int.mu just in case the missing textures would be the problem - same result. But does Blender support dds? No. So I changed *.mbm to *.png in mu and converted *.dds to *.png - same result. I've tried to import/export unmodified Squad\Spaces\MK3_CrewCab_Int\MK3_CrewCab_Int.mu - same result. I've also tried to import/export unmodified Squad\Parts\Command\mk1Cockpits\CockpitStandard.mu - similar result. Ok, last info: Windows 10 x64. Could it be that the import/export doesn't work with x64? No. Same result with Blender for x32. You've said it works fine for you. So there has to be something on my side. Any ideas? As a wise man said: Quote There is no can't. -- Duun It's better to have it and not need it than to need it and not have it. -- taniwha Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 24, 2017 Author Share Posted May 24, 2017 Actually, I found the change that fixed the bug you're encountering: Tue May 10 18:06:50 2016 +0900. Update by cloning from github (rather than downloading any zips). That way, in the future you can update just by doing a "git pull". Quote Link to comment Share on other sites More sharing options...
khr15714n Posted May 24, 2017 Share Posted May 24, 2017 First things first - no error when exporting. Here are the results: Spoiler http://s000.tinyupload.com/?file_id=66820851788888046484 MK3_CrewCab_Int.mu.select http://s000.tinyupload.com/?file_id=07797732471318974237 MK3_CrewCab_Int.mu.select_hierarchy Both are very similar, both throw no error in ksp.log but now none of the 16 portraitCameras can be found: Spoiler [LOG 12:22:31.034] PartLoader: Compiling Internal Space 'Squad/Spaces/MK3_CrewCab_Int/internal_MK3_CrewCab/MK3_CrewCab_Int' [LOG 12:22:31.036] InternalSeat: Cannot find portraitCamera of name 'Camera_Left001' [LOG 12:22:31.037] InternalSeat: Cannot find portraitCamera of name 'Camera_Left002' [LOG 12:22:31.038] InternalSeat: Cannot find portraitCamera of name 'Camera_Left003' [LOG 12:22:31.039] InternalSeat: Cannot find portraitCamera of name 'Camera_Left004' [LOG 12:22:31.039] InternalSeat: Cannot find portraitCamera of name 'Camera_Left005' [LOG 12:22:31.040] InternalSeat: Cannot find portraitCamera of name 'Camera_Left006' [LOG 12:22:31.041] InternalSeat: Cannot find portraitCamera of name 'Camera_Left007' [LOG 12:22:31.042] InternalSeat: Cannot find portraitCamera of name 'Camera_Left008' [LOG 12:22:31.043] InternalSeat: Cannot find portraitCamera of name 'Camera_Right001' [LOG 12:22:31.044] InternalSeat: Cannot find portraitCamera of name 'Camera_Right002' [LOG 12:22:31.045] InternalSeat: Cannot find portraitCamera of name 'Camera_Right003' [LOG 12:22:31.045] InternalSeat: Cannot find portraitCamera of name 'Camera_Right004' [LOG 12:22:31.046] InternalSeat: Cannot find portraitCamera of name 'Camera_Right005' [LOG 12:22:31.047] InternalSeat: Cannot find portraitCamera of name 'Camera_Right006' [LOG 12:22:31.048] InternalSeat: Cannot find portraitCamera of name 'Camera_Right007' [LOG 12:22:31.049] InternalSeat: Cannot find portraitCamera of name 'Camera_Right008' The original mu has 2,148,245 bytes. After import/export both end up a bit larger: 2,454,640 bytes. I wasn't expecting the same size but with rearranging the data and no deeper knowledge about the format I would have to start from scratch analysing the files. I hope you can fiddle it out. Or in case you create different, hopefully correct results you can tell me how to avoid making something wrong. Sorry for not mentioning before, it's a clean KSP install, no mods. Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 24, 2017 Author Share Posted May 24, 2017 That is odd, the cameras are there in my test export. As for analyzing the file, take a look at dump.py in the io_object_mu, it's a tool I created to help me debug various issues. Quote Link to comment Share on other sites More sharing options...
khr15714n Posted May 24, 2017 Share Posted May 24, 2017 (edited) The cameras don't vanish. You can see them in the exported mu's I've uploaded for you. Imported again in Blender the cameras are all there. In game I've noticed no visual difference. Using "V" in IVA there are four views in Squad (Left003 missing), Hacked (none missing) and Blender-export (all 16 missing). As posted before there are no ERR but LOG entries in ksp.log. Locating the reason why was no problem. Solving it due a hack (changing 0x20c3bd from 0x34 to 0x33, Blender helped in locating the wrong Left004) is easy and the LOG entry vanishes, ksp is happy. After import/rename/export ksp can (now) still read and display mu somewhat correctly. While ksp claims to be unable to find the 16 portraitCameras in ksp.log they are somehow still accessible. Or they are simply not used anymore as there are four seats in Mk3 Cockpit and you can switch through them using any of the three different mu's. Nonetheless the portraitCameras are recognized but the related data can't be found by ksp. On 27.9.2013 at 2:50 PM, taniwha said: Try liquidEngine1 (that's what I used for initial testing). It's the LV-T30, and I've just confirmed it's version 1. Also: what errors are you getting? So I tried the LV-T30. Import/export, just made sure that "liquidEngine1" was selected. Result on my side is a very different mu file in size and content (http://s000.tinyupload.com/?file_id=65345131473896721265). Also ksp seems to be happy on a first try to fly this new "liquidEngine1" while the mu-file was missing "HeatAnimationEmissive" (at 0xb8) and many more. Neither are there new entries in ksp.log. As this was the test file you've used before I'm sure you can see at a glance what's wrong with the result I've produced. I assume I simply miss some important click you haven't mentioned because it's so obvious to anybody familiar with Blender. But as I've mentioned, I've installed Blender the day before and am anything else but familiar with it. I would like to use your tool but I have to know at least what to do to produce working mu's. There are many happy kerbals out there writing you've done a tremendous job. Conclusion: I'm missing some simple but essential information. Edited May 24, 2017 by khr15714n Quote Link to comment Share on other sites More sharing options...
cakepie Posted May 29, 2017 Share Posted May 29, 2017 Quick question: What criteria is used to split edges on import? Are any two faces that meet at an angle automatically split? Or is it something else? I noticed when importing the mk2 crew cabin internals that the cargo bags became blocky looking due to edges being split. These are smooth in the original, so I had to merge the edges back manually to restore the desired look. I'm working on something that requires rebuilding the stock parts (with some modification), so knowing what to look out for would be very helpful -- i.e. knowing where to find undesirable split edges so they can be merged back accordingly. Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 29, 2017 Author Share Posted May 29, 2017 Problems with things looking blocky on import are because I haven't figured out how to set vertex normals in blender. However, I'm pretty sure I was able to extract vertex normals properly (my exported modes are smooth). Quote Link to comment Share on other sites More sharing options...
cakepie Posted May 29, 2017 Share Posted May 29, 2017 Ah, so the edges were split to begin with, but without setting vertex normals they default to the face normal. Same visual outcome. Thanks for clarifying. I think my workaround -- merging the edges -- should still do the trick? If I understand the situation correctly, this is pretty much betting on the general case being a smooth edge -- normals averaged from the adjoining faces. If the original mesh had some other custom vertex normals set, then all bets are off I guess. Quote Link to comment Share on other sites More sharing options...
Dynames Posted May 30, 2017 Share Posted May 30, 2017 I am trying to use this on windows and am having trouble importing. I have tried re-downloading and re-installing everything and am only using stock crafts. I receive the attached report from the command window. Is it because KSP was just updated to 1/3? Quote Link to comment Share on other sites More sharing options...
taniwha Posted June 1, 2017 Author Share Posted June 1, 2017 On 5/29/2017 at 10:22 PM, cakepie said: If I understand the situation correctly, this is pretty much betting on the general case being a smooth edge -- normals averaged from the adjoining faces. If the original mesh had some other custom vertex normals set, then all bets are off I guess. Unfortunately, yes. However, I have yet to see a model that has custom vertex normals, so it's not all bad. @Dynames: This is something about which I forgot: the location of KSP's GameData is hard-coded in import_craft.py. However, the hard-coding is in only one place and is easy to fix. Near the top (should be line 37), you will find a line saying: gamedata = "/home/bill/ksp/KSP_linux-ckan/GameData" Simply change the contents of the quotes to be the path to your KSP's GameData. Note that / works just as well in windows as it does in linux, and that \ needs to be specified as \\ (eg, "c:/KSP/GameData" or "c:\\KSP\\GameData"). Quote Link to comment Share on other sites More sharing options...
cakepie Posted June 1, 2017 Share Posted June 1, 2017 2 hours ago, taniwha said: I have yet to see a model that has custom vertex normals Reassuring to know. Thanks! Quote Link to comment Share on other sites More sharing options...
Dynames Posted June 4, 2017 Share Posted June 4, 2017 Thanks Taniwha, I have changed the path, but now it is still throwing me another error. I feel like I should be able to figure this out, but I am not a programmer. Just trying to get it to work so my students at school can print off their prototypes Quote Link to comment Share on other sites More sharing options...
taniwha Posted June 5, 2017 Author Share Posted June 5, 2017 @Dynames: if you grab the latest version, it should be fixed (though you'll need to fix the path again). KSP 1.3's i18n support broke my ConfigNode parser slightly. Quote Link to comment Share on other sites More sharing options...
Dynames Posted June 5, 2017 Share Posted June 5, 2017 Awesome Taniwha, Its working great now. Thank you so much Quote Link to comment Share on other sites More sharing options...
GonDragon Posted July 20, 2017 Share Posted July 20, 2017 It's posible that, if you have an .MU file of a model that wasn't maded in Blender, then this Addon don't recognize the format of the file and can't load it? Quote Link to comment Share on other sites More sharing options...
taniwha Posted July 20, 2017 Author Share Posted July 20, 2017 @GonDragon: Just this morning I pushed a commit that makes the addon recognize version 5 .mu files, so I suspect that's your problem. Also committed changes such that attach nodes are exported as NODE{} allowing access to the other attach node options. Quote Link to comment Share on other sites More sharing options...
Geonovast Posted August 8, 2017 Share Posted August 8, 2017 (edited) Just discovered this. Easy to install. I have no idea how to use Blender, but now I can convert the .mu files to .stl. You've made my printers very happy. Thank you! Edited August 8, 2017 by Geonovast Quote Link to comment Share on other sites More sharing options...
Ben987 Posted September 10, 2017 Share Posted September 10, 2017 Hi - have been trying to use the mu importer addon (with Blender 2.78 on Mac) Always get the following error - any ideas? Ben Quote Link to comment Share on other sites More sharing options...
taniwha Posted September 11, 2017 Author Share Posted September 11, 2017 Hmm, the code there looks a little bogus. I need to double check what I had in mind because I'm not sure what the right fix would be. Thanks for the report. Quote Link to comment Share on other sites More sharing options...
Ben987 Posted September 11, 2017 Share Posted September 11, 2017 Much appreciated, thanks Quote Link to comment Share on other sites More sharing options...
panarchist Posted October 3, 2017 Share Posted October 3, 2017 Looks like this has no trouble with Stock models, but I get all kinds of errors when trying to import an .mu from the KSO mod. Is there any other way to get an object list from an .mu file? All I really need is to know what the object inside super25commandkso.mu is called. 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.