Jump to content

KSP <-> Unity rotation


Recommended Posts

Okay, so I've managed to create a (extremely simple) model & collider, made an UV wrap and (extremely simple) texture, set up Unity & Part Tools and managed to get the stuff into the game. Been searching for and hour now: changed orientation of the models and exported them to Unity, also tried changing orientation of the root as well as the subs in Unity, written the model.mu again and again, reloaded the database or even restarted again and again ... KSP seems to ignore everything and just plants the parts in the same orientation ... over and over again.

The old parts are based on the Squad wing parts and are in the distance in the correct orientation, the new parts need to be in the same orientation but won't do what I need yet. I need the new models to use the same part.cfg files as the old ones.

NwhBwn0.png

So ... anyone please help?

Edited by Azimech
Link to comment
Share on other sites

I created the problem myself when I created a new KSP install with a minimum amount of parts to decrease loading times/database reload, but forgot to change the Part Tools data dir.

So I did it, made my first models and textures but they look horrible. I'm not sure what to do next.

 

Link to comment
Share on other sites

  • 8 months later...

Sorry for Necro but i am facing the Exact same problem as OP.

I save the model from Unity to a specified folder, i can confirm it is saving there, then i move/overwrite the model in my Dev install GameData dir - nothing, the model stays the same no matter what i do in Unity :(

Is there some cache i need to invalidate ?

It seemed to work at some point but not anymore :/

Link to comment
Share on other sites

Is the part you exporting from unity actually changed in unity scene, not only in the unity assets folder?

This might sound dumb but here is what I mean:

There is this difference between the "model", the one you exported from your 3d editor and that resides in the assets/model folder of unity and the "object" you create in the hierarchy of unity by dragging it into the scene.

The latter one usually consists of at least 2 objects:

Game Object (with the part tools script bound to it) and the actual model object itself as the child of this Game object.

The latter one now can be in two states: "prefab" or "not prefab". Prefab means (for me, surely there is a way better definition) the object is just some sort of "link" to the actual model (from assets/models). This means whenever you update the model (new export from the 3d app) the prefab that is the child of the game object with the part tools script in the actual scene in unity is updated, too.

If you change the hierarchy of the model object in unity's hierarchy window (by deleting some part of it, or changing the hierarchy of it by changing a parent/child status of parts of the model (like the actual mesh, the collider or an empty or anything that will result in unity warning you "This action will break the prefab instance! Are you sure you want to continue?"), then you will loose the "linkage" between the model object and the model from assets/models. Than the object in the scene has no connection to the actual model any more. It is now a instance of its own. That means even if you re-export the model from your 3d application, and the model in assets/models gets updated, the object that is in the scene, as the child of the game object with the KSPpart tool script, is NOT updated and NOT changed.

You then have to manually delete the object from the hierarchy of the scene in unity, re-drag&drop the models from assets/unity and make your changes that broke the prefab instance again.

I have this problem with my parachute models. I use a bone armature to animate the different parts of the parachute differently, so that the cable doesn't change in diameter when the canopy inflates, and the canopy can change it's lenght when inflating while the risers dont change etc). To work properly the actual mesh of the canopy has to be a child of the armature, but whether or not i set this up in blender, after importing the two are siblings, not in a parent/child relationship, so i have to drag&drop the mesh to be the child of the armature, thus braking the prefab instance. So I have to repeat this process of adding the model to the scene whenever I re-export it from blender.

Link to comment
Share on other sites

On 08/09/2016 at 7:49 PM, Jasseji said:

Sorry for Necro but i am facing the Exact same problem as OP.

HI if it's not the problem highlighted by InsaneDruid  above,  when you start your game and load the scene, sph/vab, are you loading a previously saved version of the part, meaning have you built a craft with the part?  and do you load this craft in order to see your changes? If so, you are not seeing the updated part, you are seeing a ghost, It's actually called once again a prefab which is how the game stores saved craft. 

So no matter what you do the game will load the same parts on the saved vessel over and over again, drawing it each time from the previously saved prefab not your recently changed part. The only way to check if part X has changed is to use a fresh part from the part editor. 

I run into this a lot and the only solution is to build a new craft with the part, you may  find the same situation arises with cfg's the cfg for the part is baked in with the prefab/saved craft and changes to the cfg are not reflected in the loaded craft, I recently discovered that I can manipulate these values with MM, so in a recent example was able to remove an obsolete part module from several very detailed craft that would not load without it  and so allow them to load again.

This post has a lot of relevant info on the saving and prefabs created

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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...