blowfishpro / B9PartSwitch

A Kerbal Space Program plugin designed to implement switching of part meshes, resources, and nodes
GNU Lesser General Public License v3.0
50 stars 33 forks source link

Texture switches are reset when procedural drag cubes are rendered #71

Closed blowfishpro closed 6 years ago

blowfishpro commented 6 years ago

In the editor, rendering drag cubes for a part or any part above it in the hierarchy will cause its texture switches to get reset. It doesn't change the subtype, and switching to a different subtype and back corrects it.

Reason is that we reset texture switches before the part is cloned, and the part is cloned to produce drag cubes. When the part is cloned normally in the editor, KSP calls OnCopy which then tells the original to re-apply its texture switches, but this doesn't happen when rendering drag cubes.