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

Added new parameter: updateSymmetry #134

Closed linuxgurugamer closed 5 years ago

linuxgurugamer commented 5 years ago

Added new parameter for the module:

 updateSymmetry

Defaults to true If set to false, then it does NOT update any parts in symmetry

This is needed to be able to fully replace FSmeshSwitch

blowfishpro commented 5 years ago

This generally seems fine. Can I ask what the use case is, just so that I understand though?

linuxgurugamer commented 5 years ago

Sure. I'm reviving an old mod B9 Shuttle Style Wings. It has a control surface in it which is textured differently top and bottom and is not an even shape. The old mod used FSmeshSwitcher to flip between two different meshes (transforms???) in the file. It had an option to disable the symmetry for that update, which is what this needs.

There is one other thing I'd like to do with this, and that would be to have a setting to not reverse the motion of a mirrored part on a specific subtype. I haven't yet had time to find that, would be awesome if it can be done.

I may get some time this evening to look at it. Feel free to merge this, and I'll do another PR if I can get it working. Thanks

blowfishpro commented 5 years ago

So this is specifically so support left/right variants with mirror symmetry?

linuxgurugamer commented 5 years ago

Yes.

blowfishpro commented 5 years ago

I wonder if there might be a way to handle that more automatically rather than force the user to configure it every time. It should be possible to detect the symmetry mode. Maybe each subtype could have a mirrorSymmetrySubtype =, and then if mirror symmetry is active set that as the active subtype on its symmetry counterpart.

linuxgurugamer commented 5 years ago

That would be nice. This is now getting a bit beyond a small change. So right now, there is the Subtype. If I am understanding you properly, you would have a new optional line: mirrorSymmetrySubtype = and if specified AND mirror symmetry is active AND this is not the part the value is being changed, THEN use the mirrirSymmetrySubtype for this mirrored part

Did I get that right?

linuxgurugamer commented 5 years ago

Just an FYI, I'm not comfortable doing much more than what I did. While it seems that it isn't a lot of work, I don't know the code well enough to be sure about it

jsolson commented 5 years ago

Wouldn't the PART field mirrorRefAxis = 0, 0, -1 (insert appropriate values) handle parts like this?

linuxgurugamer commented 5 years ago

Wouldn't the PART field mirrorRefAxis = 0, 0, -1 (insert appropriate values) handle parts like this?

Nope, because that also mirrors the animation. So if a control surface will go up when on the left, using that line it will go down when on the right

blowfishpro commented 5 years ago

Symmetry subtypes are handled in #136