X-Plane / XPlane2Blender

Scenery & Aircraft export addon for Blender and X-Plane
GNU General Public License v3.0
197 stars 67 forks source link

Does XPlaneLayer.lod and XPlaneLayer.cockpit_region need their initializer code in update? #603

Open tngreene opened 3 years ago

tngreene commented 3 years ago

lod and cockpit_region (bad names) have updaters to prevent the need for operators to add and subtract them (kinda wish we had used this pattern elsewhere)

Why was this necissary in the updater? As far as I can see we don't have code that assumes these act like fixed length arrays.

         while len(layer_props.lod) < xplane_constants.MAX_LODS - 1:
            layer_props.lod.add()
        while len(layer_props.cockpit_region) < xplane_constants.MAX_COCKPIT_REGIONS:
            layer_props.cockpit_region.add()
tngreene commented 3 years ago

It appears I have an uncommited unit test for those lines of code. 8510aba081d4d66 is where this is finalized. A custom startup was added but not the test that uses it?

Interesting, I made this. No feature or bug to go with this. 9d9909aeb2f86ae7

I decided I didn't like the add lod buttons and would replace it with this updater idea. So the idea was getting rid of a UI element first. Still doesn't answer my question. Pretty sure the answer is no.