Jump to content

[1.0.x] Part Icon Fixer & Tweaks


xEvilReeperx

Recommended Posts

This is a little mod to fix a problem with the way KSP creates certain part icons:

[table=width: 300, class: outer_border, align: center]

[tr]

[td]0c9e0242bc.jpg[/td]

[td]a90bc72fb3.jpg[/td]

[/tr]

[/table]

It automatically rescales any part with SkinnedMeshRenderers, plus any that define any special tweak options in their part configs or ModuleManager patches.

These are new options you can specify in your part configs:

iconMultiplier = float

You can use this to fine-tune the size of your icon should it appear too small or large.

iconPivot = TransformName

Editor icons normally rotate around their center of mass when moused over. In some cases this can look strange, so you can define a new transform to serve as the center point by naming it here.

iconRotation = x_degrees, y_degrees, z_degrees

This will change the default orientation of the part icon. If you want the player to look at a particular side of the part when it's not spinning in the editor, you might change the y rotation here.


License: MIT

Source

Download

Let me know if you have any questions or encounter problems

Changelog:

Version 1.2

  • fixed an issue that could prevent PartIconFixer from finding the right config for a part

  • if a specific pivot isn't specified, it will be set to zero. This should make them rotate more consistently

  • fixed an issue that could cause old versions to take priority over new versions in certain circumstances

Version 1.1

  • Fixed a bug that caused the loading screen to hang if a part's name is duplicated

  • Improved error handling so other bugs (if any *fingers crossed*) shouldn't cause KSP to stall

Version 1.0.0

  • Initial release

Edited by xEvilReeperx
Link to comment
Share on other sites

Alright, I've got a little tidbit here that totally stalled KSP load. Far as I can tell, it's related to this mod, but I've included the previous few lines just to be sure.

[LOG 16:14:17.574] PartLoader: Compiling Internal Space 'Squad/Spaces/mk1PodCockpit/internal/mk1PodCockpit'
[LOG 16:14:17.590] PartLoader: Compiling Internal Space 'Squad/Spaces/PodCockpit/internal/PodCockpit'
[LOG 16:14:17.627] PartLoader: Compiling Internal Space 'Squad/SPP/Mk2CockpitStandardInternal/internal/mk2CockpitStandardInternals'
[LOG 16:14:17.696] PartLoader: Compiling Internal Space 'UmbraSpaceIndustries/ExpPack/AES/Spaces/internal/AESInternal'
[WRN 16:14:20.087] PartIconFixer, Didn't find a ConfigNode for oxiac.IAGM2; skipping
[EXC 16:14:20.147] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[UrlConfig] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.SingleOrDefault[UrlConfig] (IEnumerable`1 source, System.Func`2 predicate)
PartIconFixer.PartIconFixer+<>c__DisplayClass5.<StartLoad>b__3 (.AvailablePart ap)
System.Collections.Generic.List`1[AvailablePart].ForEach (System.Action`1 action)
PartIconFixer.PartIconFixer.StartLoad ()
LoadingScreen+.MoveNext ()

I have no idea what it means but, considering it showed up right after a warning from your mod, it seems a little suspicious to me.

Link to comment
Share on other sites

Alright, I've got a little tidbit here that totally stalled KSP load. Far as I can tell, it's related to this mod, but I've included the previous few lines just to be sure.

[LOG 16:14:17.574] PartLoader: Compiling Internal Space 'Squad/Spaces/mk1PodCockpit/internal/mk1PodCockpit'
[LOG 16:14:17.590] PartLoader: Compiling Internal Space 'Squad/Spaces/PodCockpit/internal/PodCockpit'
[LOG 16:14:17.627] PartLoader: Compiling Internal Space 'Squad/SPP/Mk2CockpitStandardInternal/internal/mk2CockpitStandardInternals'
[LOG 16:14:17.696] PartLoader: Compiling Internal Space 'UmbraSpaceIndustries/ExpPack/AES/Spaces/internal/AESInternal'
[WRN 16:14:20.087] PartIconFixer, Didn't find a ConfigNode for oxiac.IAGM2; skipping
[EXC 16:14:20.147] InvalidOperationException: Operation is not valid due to the current state of the object
System.Linq.Enumerable.Single[UrlConfig] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback)
System.Linq.Enumerable.SingleOrDefault[UrlConfig] (IEnumerable`1 source, System.Func`2 predicate)
PartIconFixer.PartIconFixer+<>c__DisplayClass5.<StartLoad>b__3 (.AvailablePart ap)
System.Collections.Generic.List`1[AvailablePart].ForEach (System.Action`1 action)
PartIconFixer.PartIconFixer.StartLoad ()
LoadingScreen+.MoveNext ()

I have no idea what it means but, considering it showed up right after a warning from your mod, it seems a little suspicious to me.

I had the same issue.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

I'm just noticing that the filename still says 0.25 on it. Just saying, that's all.

I simply tossed the whole part icon fixer folder that got downloaded, into the gamedata folder..... which doesn't actually do anything, apparently.

EDOOT: Silly me, I put the ZIP folder in there, lol.

Link to comment
Share on other sites

  • 1 month later...

Hello!

Any chance you can bump this to 1.x please? Also, is it maybe possible to extend the trick to redo the bounding box with the part in game? We're getting issues now with SPH and runway sizes, as well as aero, shielding and heating problems because KSP thinks the tracks are far bigger than they actually are. I'll have a thumb through the code myself, but I'm a little out of my depth here.

Thanks, as ever!

Lo-Fi

Link to comment
Share on other sites

Also, is it maybe possible to extend the trick to redo the bounding box with the part in game? We're getting issues now with SPH and runway sizes, as well as aero, shielding and heating problems because KSP thinks the tracks are far bigger than they actually are.

Probably not the same trick. On a cursory glance, I'm seeing a very interesting new interface called IPartSizeModifier. That might be an excellent candidate for shameless abuse if it can be made to accept negative values

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 2 weeks later...

Hey Evil -- potentially dumb question, but how would you want mod authors to handle your plugin's distribution? Is bundling it with the add-on itself (like Module Manager) the way to go, or should they direct users to this thread for the plugin?

Thanks in advance.

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