linuxgurugamer

[1.9.x] Editor Extensions Redux released (with SelectRoot merge. StripSymmetry & NoOffsetLimits)

Recommended Posts

Fixed, thanks for the reports.

Updated both on Spacedock and Github

Note that when I did the initial update, Spacedock had not yet been updated for 1.1.1, so I was unable to mark it as compatible.  It now is

17 hours ago, Chimichanga said:

Thanks for the quick update, but ExceptionDetector is still showing EER as having exceptions, happening just after loading into VAB/SPH and happening after leaving 

 

I just tested using only EER and ED as the only two mods, continually getting this exception upon entering the VAB:

VLcz2Pd.png

 

From output_log:

InvalidCastException: Cannot cast from source type to destination type.
  at EditorExtensionsRedux.SelectRoot2.SelectRoot2Behaviour.Start () [0x00000] in <filename unknown>:0 

 

And this exception upon exiting it (ie, just before launch)

QLMGGtz.png

 

From output_log:

InvalidCastException: Cannot cast from source type to destination type.
  at EditorExtensionsRedux.SelectRoot2.SelectRoot2Behaviour+<>c__DisplayClass12_0.<InjectEvent>b__0 () [0x00000] in <filename unknown>:0
  at (wrapper delegate-invoke) EditorExtensionsRedux.SelectRoot2.SelectRoot2Behaviour/CleanupFn:invoke_void__this__ ()
  at (wrapper delegate-invoke) EditorExtensionsRedux.SelectRoot2.SelectRoot2Behaviour/CleanupFn:invoke_void__this__ ()
  at EditorExtensionsRedux.SelectRoot2.SelectRoot2Behaviour.OnDestroy () [0x00000] in <filename unknown>:0 
 
(Filename:  Line: -1)

Fixed and updated

11 hours ago, Blacks said:

Hello

One little problem i think you forget to pack 3.2.3 & set on release github page aka on https://github.com/linuxgurugamer/EditorExtensionsRedux/releases is only 3.2.2 (EditorExtensionsRedux-3.2.2.zip)

on Spacedock it apear like: "Outdated Mod / This mod is not known to work with the latest version of Kerbal Space Program. Proceed with caution."  no mater on change log it is: "Version 3.2.3 for Kerbal Space Program 1.1 / Released on 2016-04-29 / Updated for 1.1.1" personaly i was not check zip file from spacedock yet

Cheers

 

9 hours ago, Errol said:

FYI Spacedock is listing your latest change log, but is still labelling this as outdated for 1.1

Fixed and updated 

Edited by linuxgurugamer

Share this post


Link to post
Share on other sites

Hey I've been using your mod ever since Idiscovered it and just wanted to say thanks for all the work you put into it!

Edited by Dundral mk2

Share this post


Link to post
Share on other sites

The last version worked well for me in 1.1.1 trying newest version.

Share this post


Link to post
Share on other sites

I just downloaded v 3.2.5.  Spacedock said it was 1.1.2 compatible but the EditorExtensionsRedux.version reads that it's meant for KSP1.1.1 (KSP_VERSION_MAX).  It works, but I am getting a notice.

Edited by Sandworm

Share this post


Link to post
Share on other sites
40 minutes ago, Sandworm said:

I just downloaded v 3.2.5.  Spacedock said it was 1.1.2 compatible but the EditorExtensionsRedux.version reads that it's meant for KSP1.1.1 (KSP_VERSION_MAX).  It works, but I am getting a notice.

I get a similar error. I downloaded 3.2.5 from SD, which says it's for KSP 1.1.2 (which I now have). When KSPis loading and KSP-AVC is doing its version checks, it shows that I'm not using the most up to date version of EER (which I am). More importantly, when I enter the VAB, I get an error saying that this version of EER is not compatible with the version of KSP I have installed, which does not make any sense. After closing the error box, EER does not load and it performs as if I don't have the mod installed. It doesn't crash my game, but it also doesn't have any of EER's features available.

Windows 7 64bit, KSP 64bit
KSP: 1.1.2
EER: 3.2.5

Edited by KocLobster

Share this post


Link to post
Share on other sites
37 minutes ago, KocLobster said:

I get a similar error. I downloaded 3.2.5 from SD, which says it's for KSP 1.1.2 (which I now have). When KSPis loading and KSP-AVC is doing its version checks, it shows that I'm not using the most up to date version of EER (which I am). More importantly, when I enter the VAB, I get an error saying that this version of EER is not compatible with the version of KSP I have installed, which does not make any sense. After closing the error box, EER does not load and it performs as if I don't have the mod installed. It doesn't crash my game, but it also doesn't have any of EER's features available.

Windows 7 64bit, KSP 64bit
KSP: 1.1.2
EER: 3.2.5

Sorry, I wasn't aware that 1.1.2 had been released.  When I uploaded to SD, I didn't see the 1.1.2, so SD auto-updated the compatibility.

Updated for 1.1.2 and fixed, please download again.

Due to the way this mod works inside the game, I had to add the version check, and if not a compatible version, it doesn't load by design.

Share this post


Link to post
Share on other sites
32 minutes ago, linuxgurugamer said:

Sorry, I wasn't aware that 1.1.2 had been released.  When I uploaded to SD, I didn't see the 1.1.2, so SD auto-updated the compatibility.

Updated for 1.1.2 and fixed, please download again.

Due to the way this mod works inside the game, I had to add the version check, and if not a compatible version, it doesn't load by design.

Thanks, you're awesome :)

Share this post


Link to post
Share on other sites

I've had this idea rolling around in my head for a bit now. Is it possible for EEX to change the rotation and offset snapping when using the gizmos? I think that would be a fantastic feature that will add a lot more to this amazing mod.

Share this post


Link to post
Share on other sites
5 hours ago, VFB1210 said:

I've had this idea rolling around in my head for a bit now. Is it possible for EEX to change the rotation and offset snapping when using the gizmos? I think that would be a fantastic feature that will add a lot more to this amazing mod.

For rotation, use Part Angle Display.

The absolute most useful feature ever would be the ability to actually input world-space rotation and position directly (via a text box or something). It boggles the mind why in 3 years of KSP on one ever thought this useful enough to make a mod for it :rolleyes:

Share this post


Link to post
Share on other sites
On 5/4/2016 at 0:38 PM, MaxRebo said:

The absolute most useful feature ever would be the ability to actually input world-space rotation and position directly (via a text box or something). It boggles the mind why in 3 years of KSP on one ever thought this useful enough to make a mod for it

Agreed, I've been thinking for a while now it would be great to have this.

Also, does anyone else have an issue with this mod where sometimes using the keyboard to change snap angles (particularly between "no-snap" and a snap setting) doesn't "take"?  i.e. The indicator at the bottom left shows the correct snap mode that's desired, but when you adjust the part (rotation / offset) using the gizmos, it still uses the old mode.  Only clicking the actual GUI snap icon manages to fix it.

Edited by Fwiffo

Share this post


Link to post
Share on other sites
13 hours ago, Fwiffo said:

Agreed, I've been thinking for a while now it would be great to have this.

Also, does anyone else have an issue with this mod where sometimes using the keyboard to change snap angles (particularly between "no-snap" and a snap setting) doesn't "take"?  i.e. The indicator at the bottom left shows the correct snap mode that's desired, but when you adjust the part (rotation / offset) using the gizmos, it still uses the old mode.  Only clicking the actual GUI snap icon manages to fix it.

That doesn't make sense.  Could you please remove it (the entire directory) and reinstall it, and let me know if it happens again?

On 5/4/2016 at 0:38 PM, MaxRebo said:

The absolute most useful feature ever would be the ability to actually input world-space rotation and position directly (via a text box or something). It boggles the mind why in 3 years of KSP on one ever thought this useful enough to make a mod for it

I can (possibly) see the reason behind entering an angle (ie:  rotation) directly, but not position.  There is a lot going on when you place an item which makes entering a position more than a bit difficult.

And I guess the reason no one ever made a mod was that no one saw the need for it. :-)

Share this post


Link to post
Share on other sites
36 minutes ago, linuxgurugamer said:

That doesn't make sense.  Could you please remove it (the entire directory) and reinstall it, and let me know if it happens again?

Sorry if I didn't describe it well.  In case it helps you to know, I have been having the problem ever since the 1.0.5 days.  Eventually I just started disabling this add-in when I'm not doing intensive editor work.  Not sure how to reproduce other than to keep mucking around in the editor (hitting keyboard C / Shift-C and 2 / 3 and moving parts with the gizmos) until it happens.  Could be due to a mod conflict (?).  I definitely have cases where I see the "non-snap" icon in the bottom left when parts are snapping, and vice versa.  I do sometimes use ALT+F12 to reload database; I'll try to pay attention to whether it happens without / before doing that.

36 minutes ago, linuxgurugamer said:

I can (possibly) see the reason behind entering an angle (ie:  rotation) directly, but not position.

BTW to chime in on MaxRebo's thought, position (whether absolute or local to parent part) would be useful when trying to exactly align parts that are opposite each other which can't be made symmetric, or when you want to consistently offset multiple joined parts by identical amounts (e.g. I usually do this to space out a series of stack mounted cubic struts slightly to avoid texture map Z-Fighting).  It would also be helpful when you just need to "nudge" a part over slightly (less than the smallest mouse increment) to achieve perfect balance (0 torque) when using RCS Build Aid.  I often find myself zooming WAY into the offset gizmo to try to get precision.

Agreed there's a lot going on with part positions and it may not be straightforward to implement.

Edited by Fwiffo

Share this post


Link to post
Share on other sites
1 hour ago, Fwiffo said:

Sorry if I didn't describe it well.  In case it helps you to know, I have been having the problem ever since the 1.0.5 days.  Eventually I just started disabling this add-in when I'm not doing intensive editor work.  Not sure how to reproduce other than to keep mucking around in the editor (hitting keyboard C / Shift-C and 2 / 3 and moving parts with the gizmos) until it happens.  Could be due to a mod conflict (?).  I definitely have cases where I see the "non-snap" icon in the bottom left when parts are snapping, and vice versa.  I do sometimes use ALT+F12 to reload database; I'll try to pay attention to whether it happens without / before doing that.

Well, reloading the database is not really safe and is never a good thing to do, the reload does things in a different order.   So I'd be interested to know if it only happens after the database has been reloaded.

1 hour ago, Fwiffo said:

BTW to chime in on MaxRebo's thought, position (whether absolute or local to parent part) would be useful when trying to exactly align parts that are opposite each other which can't be made symmetric, or when you want to consistently offset multiple joined parts by identical amounts (e.g. I usually do this to space out a series of stack mounted cubic struts slightly to avoid texture map Z-Fighting).  It would also be helpful when you just need to "nudge" a part over slightly (less than the smallest mouse increment) to achieve perfect balance (0 torque) when using RCS Build Aid.  I often find myself zooming WAY into the offset gizmo to try to get precision.

What about a fine adjustment mode, where you would use the arrow keys to make minor adjustments?

Share this post


Link to post
Share on other sites
9 hours ago, linuxgurugamer said:

So I'd be interested to know if it only happens after the database has been reloaded.

I think it doesn't, but don't want to make too much noise until I confirm.  Will try to figure out the rhyme/reason of when it happens.  Appreciate your help.

9 hours ago, linuxgurugamer said:

What about a fine adjustment mode, where you would use the arrow keys to make minor adjustments?

Sure, better than nothing.  But if you're looking for feedback, this still wouldn't be as good (IMO) as being able to edit raw coordinates.  There are times when you want to do math, set something to absolute 0 (relative to scene / parent part), etc.

If a fine adjustment mode like you suggested is easier, I suggest tying it to the rotation increment setting / C-hotkey, and making the offset gizmo snap affected by it (if possible).  i.e. The rotation amount would also control the nudge amount.  You could switch the icons when in rotation vs. offset gizmo mode.

Edited by Fwiffo
Fix typo does --> doesn't

Share this post


Link to post
Share on other sites
4 hours ago, linuxgurugamer said:

There is a lot going on when you place an item which makes entering a position more than a bit difficult.

When I manually edit the craft file to adjust the position of parts, what am I doing differently then from what a text box handler would be doing in the editor?

Also, I concur with @Fwiffo on pretty much every point. Though the main reason why I'll always prefer manual input is because with floating point, a+b-b != a. When moving things around in the editor to try out different stuff, this error can potentially sum up pretty quickly. Especially with KSP wheels' notorious sensitivity to imbalances, this can become problematic for space planes. Or are there some safeguards against that already built into the stock gizmos?

Whichever variant you want to pursue, don't feel too pressured to come up with something. It was just a thought. At least from me you shouldn't take it as a feature request.

4 hours ago, linuxgurugamer said:

And I guess the reason no one ever made a mod was that no one saw the need for it. :-)

Which is what I don't understand :wink:

Edited by MaxRebo

Share this post


Link to post
Share on other sites
1 hour ago, MaxRebo said:

Which is what I don't understand :wink:

Speaking seriously here - If you really want it bad enough, then there's as good an excuse as any to learn how to code.

Share this post


Link to post
Share on other sites
Just now, Gaiiden said:

Speaking seriously here - If you really want it bad enough, then there's as good an excuse as any to learn how to code.

I know how to code. In fact, I do it for a living. This was intended as I lighthearted remark. Maybe if you weren't so preoccupied with reading entitlement into everything you wouldn't have overlooked

1 hour ago, MaxRebo said:

don't feel too pressured to come up with something. It was just a thought. At least from me you shouldn't take it as a feature request.

I obviously don't want it "bad enough".

Share this post


Link to post
Share on other sites
8 hours ago, Gaiiden said:

Speaking seriously here - If you really want it bad enough, then there's as good an excuse as any to learn how to code.

Please, let's keep it civil.

MaxRebo was making a feature request.  Not unusual, and frankly, an interesting idea which may fit in with the rest of this mod.  Not everyone can code, and those who can, may not have the knowledge or desire to spend time writing code for a game.  It wasn't a demand, it was a request.

Thank you

Share this post


Link to post
Share on other sites
On 5/7/2016 at 8:43 AM, linuxgurugamer said:

So I'd be interested to know if it only happens after the database has been reloaded

I confirmed today it happens even when the "Reload database" function has not been used.  In fact one of the symptoms I'm seeing is easy to reproduce:

  1. Start KSP 1.1.2, x64.  Only mod loaded is fresh install of EditorExtensionsRedux 3.2.7.
  2. Click Yes to prompt allowing the mod to check for updates.
  3. Enter VAB.
  4. Do part search for "tank" and drop an FL-T400 fuel tank into the editor.
  5. Do part search for "ladder", pick the "Pegasus 1 Mobility Enhancer" (small, 3-rung ladder), press "C" until you get 22.5 snap angle, attach it to the fuel tank.
  6. Press "3" for the rotation gizmo, select the ladder, rotate it a couple notches clockwise.
  7. Press "C" to change the snap angle to 30.
  8. Rotate the part counterclockwise and see there is no snapping at all.

Happens with other parts, too.

It almost seems like the game's own shortcut keys for switching between Snap/No-Snap are silently interfering with EditorExtensionsRedux's behavior of changing snap angles, at least as far as the gizmos are concerned.  Maybe a timing issue with an event handler or something?

It can get out of sync in other ways, too.  I've seen cases where I use "C" to change the snap angle to 45 degrees (and the number 45 is visible in the bottom left), but the game is still snapping to a smaller angle (e.g. 22.5?) when I use the rotation gizmo.  The only surefire way I found to fix it is to click the "degrees" GUI indicator with the mouse a couple times to toggle it off and on, then EditorExtensions and the game seem to get back in sync.

Would love to know if anyone else is having this problem.

EDIT: I grabbed the source code to try and troubleshoot, made a build that hardcodes the rotation key, then disabled the toggle rotation keybinding in the game (I figured this would prevent any interference between stock keyhandlers and the mod's).  Still getting a similar issue.  I added some logging and found that although srfAttachAngleSnap is (at least according to the log) getting updated, the active rotation gizmo's SnapDegrees property remains unchanged after AngleSnapCycle executes.  Tried to update this with a hammer but it's a readonly property.

EDIT 2: I think I solved it, with the following code:

Spoiler

// Look for active rotation gizmo and change its snap resolution
var gizmos = HighLogic.FindObjectsOfType<EditorGizmos.GizmoRotate>();
if (gizmos.Length > 0) {
    var gizmo = gizmos[0];
    // Chunk to find the magic variable we need to adjust
    // var fields = gizmo.GetType().GetFields(BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
    // foreach (var f in fields) {
    //     Debug.Log(String.Format("{0}: {1}", f.Name, f.GetValue(gizmo).ToString()));
    // }
    gizmo.useAngleSnap = editor.srfAttachAngleSnap != 0;
    // Unfortunately the SnapDegrees property is read-only; some reflection hackery is needed
    if (editor.srfAttachAngleSnap != 0) {
      var field = gizmo.GetType().GetField("gridSnapInterval", BindingFlags.NonPublic | BindingFlags.Instance);
      field.SetValue(gizmo, editor.srfAttachAngleSnap);
      field = gizmo.GetType().GetField("gridSnapIntervalFine", BindingFlags.NonPublic | BindingFlags.Instance);
      float fine = editor.srfAttachAngleSnap / 3f;
       field.SetValue(gizmo, fine);
       //fine = (float)field.GetValue(gizmo);
       Debug.Log(String.Format("Gizmo SnapDegrees = {0}, fine = {1}", gizmo.SnapDegrees.ToString(), fine.ToString()));
    }
}

 

There still seems to be an issue when the rotation hotkey is handled by the game, but unbinding it and using my hardcoded hotkey is working well for me so far.  It's bulletproof with any existing rotation gizmo on the screen.  I need to find a way to ensure new rotation gizmos get the same treatment I hacked an ugly event handler onto ConstructionEventType.PartRotating to ensure any new gizmos spawned get updated with the new value.

Hopefully you can evolve something cleaner from this and include it in the next release.

EDIT 3: I also implemented a nifty new feature I've wanted for a while which lets you zoom in / out more rapidly by double-tapping the zoom in / out hotkey.  i.e. If you just hold down the "zoom in" hotkey, it works like normal.  But if you double-tap-hold, it zooms in at 5x the speed.  Did it by temporarily increasing EditorDriver.fetch.vabCamera.mouseZoomSensitivity (similar for the SPH) until the hotkey is released.  Let me know if you want the source (or I might eventually turn it into a standalone mod that works on flight / orbit cameras as well).

EDIT 4: There is still a bug where if you change the snap angle (using hotkey) between a snap mode and non-snap one while an offset gizmo is shown, it doesn't use the correct setting until you click elsewhere and spawn a new offset gizmo.  i.e. If I hit "2", click a part, then hit "C" a few times to switch between "grid" vs "smooth" mode, the change doesn't take effect immediately.  Could probably compensate with another event handler hack but curious to see if you have thoughts on this first.

Edited by Fwiffo
Fix code mangled by this terrible forum software which for some reason removed several of the 0's from my snippet

Share this post


Link to post
Share on other sites
4 hours ago, Fwiffo said:
On 5/7/2016 at 8:43 AM, linuxgurugamer said:

So I'd be interested to know if it only happens after the database has been reloaded

I confirmed today it happens even when the "Reload database" function has not been used.  In fact one of the symptoms I'm seeing is easy to reproduce:

  1. Start KSP 1.1.2, x64.  Only mod loaded is fresh install of EditorExtensionsRedux 3.2.7.
  2. Click Yes to prompt allowing the mod to check for updates.
  3. Enter VAB.
  4. Do part search for "tank" and drop an FL-T400 fuel tank into the editor.
  5. Do part search for "ladder", pick the "Pegasus 1 Mobility Enhancer" (small, 3-rung ladder), press "C" until you get 22.5 snap angle, attach it to the fuel tank.
  6. Press "3" for the rotation gizmo, select the ladder, rotate it a couple notches clockwise.
  7. Press "C" to change the snap angle to 30.
  8. Rotate the part counterclockwise and see there is no snapping at all.

Happens with other parts, too.

It almost seems like the game's own shortcut keys for switching between Snap/No-Snap are silently interfering with EditorExtensionsRedux's behavior of changing snap angles, at least as far as the gizmos are concerned.  Maybe a timing issue with an event handler or something?

It can get out of sync in other ways, too.  I've seen cases where I use "C" to change the snap angle to 45 degrees (and the number 45 is visible in the bottom left), but the game is still snapping to a smaller angle (e.g. 22.5?) when I use the rotation gizmo.  The only surefire way I found to fix it is to click the "degrees" GUI indicator with the mouse a couple times to toggle it off and on, then EditorExtensions and the game seem to get back in sync.

Would love to know if anyone else is having this problem.

EDIT: I grabbed the source code to try and troubleshoot, made a build that hardcodes the rotation key, then disabled the toggle rotation keybinding in the game (I figured this would prevent any interference between stock keyhandlers and the mod's).  Still getting a similar issue.  I added some logging and found that although srfAttachAngleSnap is (at least according to the log) getting updated, the active rotation gizmo's SnapDegrees property remains unchanged after AngleSnapCycle executes.  Tried to update this with a hammer but it's a readonly property.

EDIT 2: I think I solved it, with the following code:

I was able to duplicate this.  It was very easy to do so by following your steps.

Reflection code is messy, and your code may not work on Linux or OSX.  I know how to make it work, and will be incorporating this in soon.  As you say, I'll need to make sure that when the game handles the rotation key.

I've added your code, and it works nicely while a part is selected (i didn't disable the key), although there is still a problem when selecting a part to rotate, but I know what to do about that.

It's a real pleasure having this help, thanks.

Once I get it working, I'll get you a copy to try out

4 hours ago, Fwiffo said:

EDIT 3: I also implemented a nifty new feature I've wanted for a while which lets you zoom in / out more rapidly by double-tapping the zoom in / out hotkey.  i.e. If you just hold down the "zoom in" hotkey, it works like normal.  But if you double-tap-hold, it zooms in at 5x the speed.  Did it by temporarily increasing EditorDriver.fetch.vabCamera.mouseZoomSensitivity (similar for the SPH) until the hotkey is released.  Let me know if you want the source (or I might eventually turn it into a standalone mod that works on flight / orbit cameras as well).

Sound like a nice feature, please send me the source and I'll include it in the next version

Share this post


Link to post
Share on other sites

Ok, I've gotten it done, please test this: https://www.dropbox.com/s/1f6eb8avvyxvgsx/EditorExtensionsRedux-3.2.7a.zip?dl=0

It's mostly your changes, but it now should work with all the gizmos (I only tested with the rotation) and doesn't require doing anything to the stock keys.

This is a test version, while compiled as a release, be prepared for it not working.  The reflection code had to be changed so that it would work on Linux (since the field names aren't exposed on Linux, I had to do it via offset)

 

 

Share this post


Link to post
Share on other sites
2 hours ago, linuxgurugamer said:

Sound like a nice feature, please send me the source and I'll include it in the next version

I'm In a rush, but here's my code: http://tinyurl.com/EdExtRdx-3-2-7-1-Fwiffo

If you do a compare against the baseline 3.2.7 you'll see my changes (I suggest Beyond Compare with the "compare contents" option - it's the best visual differ I've come across and will instantly point you to the relevant changes).

Edited by Fwiffo

Share this post


Link to post
Share on other sites
1 minute ago, Fwiffo said:

I'm In a rush, but here's my code: http://tinyurl.com/EdExtRdx-3-2-7-1-Fwiffo

If you do a compare against the baseline 3.2.7 you'll see my changes (I suggest Beyond Compare - it's the best visual differ I've come across and will instantly point you to the relevant changes).

Ok, I'll get to it in a day or so, will not have much time for a while

Share this post


Link to post
Share on other sites

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.