Briso Posted May 17, 2020 Share Posted May 17, 2020 (edited) Hi, everybody. Thank you to the author for the work done, but unfortunately I have trouble. I hope it's a mistake on my part. Edited May 17, 2020 by Briso Quote Link to comment Share on other sites More sharing options...
Sparrowhawk Posted May 18, 2020 Share Posted May 18, 2020 Apologies if this has been asked before, but how do I separate out individual models if I imported a .craft file? I would like to modify a few so they are 3D-printable and then export them as .stl Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 18, 2020 Author Share Posted May 18, 2020 @Briso: you need a more recent blender. I know 2.83 works. I didn't realize VertexColors was new. @Sparrowhawk: They're tucked away. Go to the outliner, set it to "Scenes" mode, click on the "mu_utils" scene (this will switch you to that scene, so clicking on "Scene" will take you back to the default scene), then switch the outliner back to "View Layer" mode (alternatively, you can have two outlines open: one in scenes mode, the other in outline). You will probably need to turn on the extra vis/selection options: do so by clicking the funnel icon in the upper right and enabling "select" "disable in viewports" and "disable in render". You'll then be able to make the collection you want selectible and visible (and renderable if you so choose). To edit the part models, you will want the "loaded_models" collection. the model you want will be in there. Note that editing these objects will edit all instances of them. As additional information: loaded_parts holds the "compile parts" much like the parts list in KSP (some parts are made up of multiple models). "craft_collection" holds the assembled craft (much like the VAB or SPH (or even out in flight). Quote Link to comment Share on other sites More sharing options...
Box of Stardust Posted May 21, 2020 Share Posted May 21, 2020 (edited) Hi, having errors trying to import craft in. Which is strange, since I was previously able to successfully import a craft once, then the importer just seemed to break once I tried importing other things. Could be related to the other things having some mod parts that wouldn't load correctly? Here's the log that shows up after trying to import a craft the previously successfully imported: EDIT: ok, I guess I just tried something dumb right after I posted this; I opened up a brand new file and tried the importer again and it functions now again. Will see if I can get it to break again. Here's a different problem, and I have a gist of what might be wrong, but I'm not entirely sure. This seems more of a problem with the part config itself than the importer, but I'm not sure what to modify in the part config such that the importer can recognize the part model associated with the config. Edited May 21, 2020 by Box of Stardust Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 22, 2020 Author Share Posted May 22, 2020 For the top one, something went wrong in computing the path to the model file. For the second one, it looks like you have no "f5jet" part in your GameData. Missing mod, perhaps? Quote Link to comment Share on other sites More sharing options...
Box of Stardust Posted May 22, 2020 Share Posted May 22, 2020 10 hours ago, taniwha said: For the top one, something went wrong in computing the path to the model file. For the second one, it looks like you have no "f5jet" part in your GameData. Missing mod, perhaps? For the first one, it seems like the importer breaks when I try and import a craft with parts that don't load, and then from that point on, it seems that that Blender file is corrupted in terms of being able to use the importer? Just trying to report back some observations I think I've noticed. The part is there; it's AirplanePlus's engine. How exactly does the importer locate the model for a part? Do they have to be linked as some specific name just filename-wise, or is there some internal name in the model file/.mu that gets read? If it's internal to the .mu file, I guess I'll have to do some odd editing somewhere to get it to locate the model. Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 22, 2020 Author Share Posted May 22, 2020 Ah, if it was a follow-on error, that might explain in. Anyway, the way it works is it scans GameData for part config files (actually, if ModuleManager.ConfigCache is there, it reads that instead) building a part database very similar to what KSP makes. This is why craft loading is so slow the first time. From the part config, the loader extracts the the model name(s) if MODEL nodes are used, otherwise it takes the first .mu file by ascii sort (this is exactly what KSP does, and I wasted a day figuring out why my attempts to have multiple parts in one directory would not work: don't use mesh= in your part.cfg). Anyway, one thing I can think of for the loader not finding the parts: you have MM but you have not run KSP after you installed a parts pack. Quote Link to comment Share on other sites More sharing options...
Battou Posted May 23, 2020 Share Posted May 23, 2020 Hi. I have problem with importing and then exporting some parts from Station Parts Expantion Redux mod. Such as HUB modules. B9 complains about COLLIDER* transforms not found by name. Seems like in some cases colliders get changed during import->export. Can you look into it? Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 24, 2020 Author Share Posted May 24, 2020 Things do get changed going through blender. Sometimes export (particularly PartTools) errors get fix, other times some optimizations, almost always certain triangle vertex indices. The process is not idempotent. However, for colliders, it's entirely possible the collider was on a separate game object in the original import but got merged into the parent game object on export. This is actually a feature (optimization), but can be overridden: find the collider object in blender, go to object properties, Mu Collider panel -> Separate. If you enable that, it will force the collider to be exported on its own game object. This is normally automatic if the parent object has more than one collider child object, but when there's only one collider child object, it will be merged into the parent unless Separate is enabled. I thought I Made it so separate was set when importing if the collider was on its own object. If that is not the case, please submit an issue as I have a gazillion things on my plate and I'm likely to lose track of something here. Quote Link to comment Share on other sites More sharing options...
Battou Posted May 24, 2020 Share Posted May 24, 2020 2 hours ago, taniwha said: Things do get changed going through blender. Sometimes export (particularly PartTools) errors get fix, other times some optimizations, almost always certain triangle vertex indices. The process is not idempotent. However, for colliders, it's entirely possible the collider was on a separate game object in the original import but got merged into the parent game object on export. This is actually a feature (optimization), but can be overridden: find the collider object in blender, go to object properties, Mu Collider panel -> Separate. If you enable that, it will force the collider to be exported on its own game object. This is normally automatic if the parent object has more than one collider child object, but when there's only one collider child object, it will be merged into the parent unless Separate is enabled. I thought I Made it so separate was set when importing if the collider was on its own object. If that is not the case, please submit an issue as I have a gazillion things on my plate and I'm likely to lose track of something here. Odd thing. Tried marking separate and still get error. BUT removing ".collider" from collider transform names resolved issue. Do those ".collider" addition to names needed? Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 24, 2020 Author Share Posted May 24, 2020 oh, still adding those? hmm, well they're not needed if the collider was originally on its own transform. That might be worth submitting an issue. Quote Link to comment Share on other sites More sharing options...
Battou Posted May 24, 2020 Share Posted May 24, 2020 10 hours ago, taniwha said: oh, still adding those? hmm, well they're not needed if the collider was originally on its own transform. That might be worth submitting an issue. Thanks! Submitted. Good to know that I can just delete that addition. Another question. I tried to import Centrifuges from Station part extension redux but they do not import correctly or when exported become messed up in game. Do complex animation or whatever do not supported yet? Quote Link to comment Share on other sites More sharing options...
Battou Posted May 24, 2020 Share Posted May 24, 2020 Oh, and I noticed that exported file always about 1.5-2 times larger than original before import. Also!))) Importing and then exporting extendible solar panels breaks their animations. They just extends as block through closed door and do not unfold. Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 25, 2020 Author Share Posted May 25, 2020 10 hours ago, Battou said: Oh, and I noticed that exported file always about 1.5-2 times larger than original before import. That's odd. Quite often they're smaller due to useless meshes being omitted. Only things I can think of that would inflate the size are additional animation keys and additional vertex data (normals, tangents, colors) 10 hours ago, Battou said: Also!))) Importing and then exporting extendible solar panels breaks their animations. They just extends as block through closed door and do not unfold. This is even odder. Have you confirmed that the solar panels are animated correctly in blender? Anyway, for both of the above, you will find a mucfg.py script in the addon director. You can use that to examine the contents of the .mu files. python mucfg.py model.mu There are some other useful debugging tools there: hierarchy.py and animprop.py Quote Link to comment Share on other sites More sharing options...
Battou Posted May 25, 2020 Share Posted May 25, 2020 44 minutes ago, taniwha said: That's odd. Quite often they're smaller due to useless meshes being omitted. Only things I can think of that would inflate the size are additional animation keys and additional vertex data (normals, tangents, colors) Dont know. Any .mu file that I import and then export, even if I havent done anything, is always bigger. 45 minutes ago, taniwha said: This is even odder. Have you confirmed that the solar panels are animated correctly in blender? No, they are not. Upon import animations are wrong in blender, they do not unfold. Its like some animations do not import. try for yourself, take 1x6 solar panel from ReStock mod and try to import. Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 25, 2020 Author Share Posted May 25, 2020 Oh, that's because they're animated via Euler angles which I didn't know was even supported (thought Unity animated via only quaternions). This will make things... interesting Quote Link to comment Share on other sites More sharing options...
Battou Posted May 25, 2020 Share Posted May 25, 2020 2 hours ago, taniwha said: Oh, that's because they're animated via Euler angles which I didn't know was even supported (thought Unity animated via only quaternions). This will make things... interesting Glad that I pointed you into this.)))) Hope you can figure out how to handle it.) Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 25, 2020 Author Share Posted May 25, 2020 I already have it working for import. Export will be a little more interesting (more in what to when the rotation mode is neither quaternion nor YXZ). Quote Link to comment Share on other sites More sharing options...
Battou Posted May 26, 2020 Share Posted May 26, 2020 On 5/25/2020 at 2:03 PM, taniwha said: I already have it working for import. Export will be a little more interesting (more in what to when the rotation mode is neither quaternion nor YXZ). Ive noticed update to repo. Tried to import Solar panels and it worked. But when I tried to export I got this: Traceback (most recent call last): File "D:\Program Files\Blender Foundation\Blender 2.82\2.82\scripts\addons\io_object_mu\export_mu\operators.py", line 63, in execute return export_mu(self, context, **keywords) File "D:\Program Files\Blender Foundation\Blender 2.82\2.82\scripts\addons\io_object_mu\export_mu\operators.py", line 34, in export_mu mu = export.export_object (context.active_object, filepath) File "D:\Program Files\Blender Foundation\Blender 2.82\2.82\scripts\addons\io_object_mu\export_mu\export.py", line 163, in export_object anim_root_obj.animation = make_animations(mu, animations, anim_root) File "D:\Program Files\Blender Foundation\Blender 2.82\2.82\scripts\addons\io_object_mu\export_mu\animation.py", line 296, in make_animations clip.curves.append(make_curve(mu, muobj, curve, path, typ)) File "D:\Program Files\Blender Foundation\Blender 2.82\2.82\scripts\addons\io_object_mu\export_mu\animation.py", line 172, in make_curve property, mult, ctyp = property_map[curve.data_path][curve.array_index] KeyError: 'rotation_euler' location: <unknown location>:-1 Quote Link to comment Share on other sites More sharing options...
taniwha Posted May 27, 2020 Author Share Posted May 27, 2020 @Battou Yes, export of animated Euler angles is still pending. I had no reason to attempt to support them until now Quote Link to comment Share on other sites More sharing options...
Battou Posted May 27, 2020 Share Posted May 27, 2020 7 hours ago, taniwha said: @Battou Yes, export of animated Euler angles is still pending. I had no reason to attempt to support them until now Oh, got it. Will wait.) Thank you! Quote Link to comment Share on other sites More sharing options...
YoshiIsOrbital Posted June 7, 2020 Share Posted June 7, 2020 So @taniwha I'm having an issue when i try to import a craft file. looks like this. https://imgur.com/a/FPp9o9H what do. Quote Link to comment Share on other sites More sharing options...
taniwha Posted June 8, 2020 Author Share Posted June 8, 2020 @YoshiIsOrbital: It looks like you didn't set up GameData. Details are here. Quote Link to comment Share on other sites More sharing options...
YoshiIsOrbital Posted June 9, 2020 Share Posted June 9, 2020 I actually /DID/ set it up properly, but fixed the issue. Turns out you have to run blender as an admin, somehow that very simple thing slipped past me. all good now! Quote Link to comment Share on other sites More sharing options...
taniwha Posted June 9, 2020 Author Share Posted June 9, 2020 9 hours ago, YoshiIsOrbital said: I actually /DID/ set it up properly, but fixed the issue. Turns out you have to run blender as an admin, somehow that very simple thing slipped past me. all good now! Ah, no, you should not run blender as an admin. Rather, do not install blender in Program Files. 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.