Jump to content

[0.23.5] Part Angle Display - View and set accurate angles for parts in editor


Padishar

Recommended Posts

This has now been officially released over in the other forum.

I have had a need to set the orientation of certain parts to very accurate angles for quite a while so I finally got around to knocking up a quick plugin to do this.

It isn't "nice" or particularly intuitive but I am releasing it here just in case anyone else finds it useful or wants to develop it further. There are various issues with it (e.g. the editable fields behave quite strange) but it works for what I need it for (setting the pitch angle of radially attached girders to 2 decimal places).

Simply put, the plugin allows you to display a small window in the VAB/SPH that displays the orientation of the currently selected part as pitch, roll and yaw angles and it also allows you to enter increment values for the pitch, roll and yaw and to apply these to the selected part.

It currently uses a single hotkey (Alt-P as it doesn't clash with any of the mods I use). If you do not have a part selected then it will show or hide the window. If you do have a part selected then it will apply the angle increments to the part.

Download PartAngleDisplay.zip (Updated 23/05/2014 14:06 GMT)


23/05/2014 14:06 GMT Fixed editable fields to work better

20/05/2014 23:17 GMT Removed some unused code and logging

20/05/2014 15:52 GMT First release

The source is on GitHub. (Pull requests are more than welcome)

The code is released under the MIT license (also added to source on GitHub).

Edited by Padishar
Link to comment
Share on other sites

Like I said, it isn't nice or intuitive at the moment but you can probably use it to do lots of things that haven't really been possible before if you play about with it until you understand what it's doing...

It would be much easier if plugins could simply adjust the angle increment the wasdqe keys (or at least the shifted ones) rotate the part by. Having a hotkey that cycles the shift-rotate keys through 5, 1, 0.1 and 0.01 degrees would mean all you would need is the angle display.

Link to comment
Share on other sites

Holy cripes. This is just what I was looking for! Thanks a lot, man.

Perhaps you could also let us snap a part to a specific axis and let us control, for example, the distance from the surface attachment point? This would make aligning things a lot easier. For example attaching wings onto a curved fuselage, or sliding them into a fuselage to prevent unsightly gaps where there should be none.

It's a shame the part placement system is so weak in a game so heavily dependent on their placement.

Edited by MAKC
Link to comment
Share on other sites

It would be much easier if plugins could simply adjust the angle increment the wasdqe keys (or at least the shifted ones) rotate the part by. Having a hotkey that cycles the shift-rotate keys through 5, 1, 0.1 and 0.01 degrees would mean all you would need is the angle display.

Sounds like a job for the Editor Extensions author, perhaps with help from your code.

In the meantime, a (hopefully minor) tweak I would suggest is having the +/- values be applied to the part only based on the part's original orientation when it is first selected. This makes it very easy to then go back and forth with +/- amounts and just zero out all the fields if you want to return the part to the orientation it was at when you first started messing with it - without having to unselect it, hit Ctrl+Z and reselect it. Mainly this change would just make tweaking easier without have to remember how much you moved a part one way and have to move it back another.

Link to comment
Share on other sites

Just thought I'd let you know that Bolt On Screenshot System uses Alt P as well.

Edit:

I did a brief test and it seems like it only works decently for parts placed centerline. Above or below that you'll still get the wonky KSP rotation axis coupling behavior where a previous rotation in one axis will affect the way it rotates when you adjust another axis, but this is not your fault obviously. This is why axis alignment is needed.

Edited by MAKC
Link to comment
Share on other sites

Sounds like a job for the Editor Extensions author, perhaps with help from your code.

Trying to do this at the moment would be awkward and error prone. A plugin would have to detect the part has been rotated and change the amount it was rotated by. Even if the rotation can be reliably detected the rotation by 5 degrees and then back by 4 degrees would probably not look very nice.

In the meantime, a (hopefully minor) tweak I would suggest is having the +/- values be applied to the part only based on the part's original orientation when it is first selected. This makes it very easy to then go back and forth with +/- amounts and just zero out all the fields if you want to return the part to the orientation it was at when you first started messing with it - without having to unselect it, hit Ctrl+Z and reselect it. Mainly this change would just make tweaking easier without have to remember how much you moved a part one way and have to move it back another.

I'm not sure I quite follow, and I'm not particularly interested in taking it much further as it does everything I needed it to do.

Just thought I'd let you know that Bolt On Screenshot System uses Alt P as well.

Sorry about that. It is a trivial change to make it use a different key so I may release an alternative version that uses a different key.

I did a brief test and it seems like it only works decently for parts placed centerline. Above or below that you'll still get the wonky KSP rotation axis coupling behavior where a previous rotation in one axis will affect the way it rotates when you adjust another axis, but this is not your fault obviously. This is why axis alignment is needed.

Yes, the "partRotation" value that it is adjusting is the rotation of the part when it is grabbed by the mouse and away from the craft, not when it is snapping to the rest of the craft. The part attachment rules (nodes and surface attachment) cause an additional transformation which is not displayed. E.g. if you have a normal fuel tank and you create a girder segment it will appear vertical attached to the mouse, but when you move it to radially attach to the tank, it rotates to be horizontal and sticking straight out but the angle display still says 0,0,0.

Link to comment
Share on other sites

Holy cripes. This is just what I was looking for! Thanks a lot, man.

Perhaps you could also let us snap a part to a specific axis and let us control, for example, the distance from the surface attachment point? This would make aligning things a lot easier. For example attaching wings onto a curved fuselage, or sliding them into a fuselage to prevent unsightly gaps where there should be none.

It's a shame the part placement system is so weak in a game so heavily dependent on their placement.

Idem dito all above.

Great work, Padishar!

I needed such a system almost every day and every hour playing KSP since September 2012.

Link to comment
Share on other sites

skbernarnd: since the key combination is also required to apply the rotation to a "picked up" part (when mouse clicking is obviously unavailable) that won't work.

Padishar: posting again to say how much I love this mod: between this and Firespitter's gear alignment, we can finally have non-slippy landing gear!

Link to comment
Share on other sites

Padishar: posting again to say how much I love this mod: between this and Firespitter's gear alignment, we can finally have non-slippy landing gear!

Cheers, I'm still surprised how useful it is considering there's only 2 really significant lines of code... ;)

Link to comment
Share on other sites

I have updated the zip linked in the first post to fix the editable fields to work much better as they were just too annoying. The values are now stored as strings and converted to numbers when they are applied (if not a number then it uses 0).

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