Skip to content

Conversation

@Connor-Russell
Copy link
Contributor

Summary:

Added the "blended" option to non-draped layer groups, for glass scenery objects in X-Plane 12.21+.

Detailed Changes:

xplane_props.py

  • Modified the XPlaneLayer property group's layer_group and layer_group_draped properties to get their enum items from callbacks (defined locally in the property group class). This allows for the "blended" layer group to be available only for non-draped layer groups and when the scene's xplane.version property is >= 12.21.
  • Cleared the default value for layer_group/layer_group_draped as a string cannot be used with dynamic enums (default is automatically the first item).
  • Added version 12.21 to the XPlaneSceneSettings property group's version property, and made 12.21 default.
  • Added an update callback to XPlaneSceneSettings.version, this function iterates over every collection, checks for xplane.layer.layer_group property, and if it is an empty string, sets it to LAYER_GROUP_NONE.
    • When the user sets the layer group to blended, then downgrades the X-Plane version to < 12.21, Blender sets the layer_group property to an empty string rather than defaulting to the first value (seemingly a bug in Blender?). The update callback detects this and resets it to LAYER_GROUP_NONE.

xplane_config.py:

  • The data model version has been incremented as there are new values for layer_group and xplane.version
    • This may be unnecessary since there are no properties added or removed. I leave this choice to the reviewing author who will know more about this repo than myself.

xplane_constants.py

  • Added VERSION_1221 and LAYER_GROUP_BLENDED constants

Testing:

No unit tests were run, however I have verified that .obj exports correctly reflect layer_group changes across version transitions, including fallback behavior when ‘blended’ becomes invalid.

…date properties upon scene xplane.version being changed, added BLENDED layer group for the non-draped layer group, available only for XP version 12.21+
Changed layer_group Enum property options to come from a callback, and draped_layer_group to a different callback (allowing only version appropriate options).
Added Version 12.21 option (and set as default).
Added update function to X-Plane version property, which fixes layer_group properties being reset to an empty string when their value is invalidated by a change in xplane.version.
Copy link

@6639835 6639835 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants