Skip to content

Switches are not stored as a number and bit #51

@avan069

Description

@avan069

When attempting to update switch/DOF lists by clearing them from the scene variables and adding a new switch, it appears that any switch in the scene with a number greater than the highest edited switch in the xml gains an incorrect value. This means any saved Blender file that has a switch list stored in scene that does not match the current user's plugin install will break the switch references in the Blender file. If the switch.xml (and DOF/callback XMLs probably) are updated, many switches will have to be individually reassigned.

Switch empties appear to have no underlying reference to an appropriate switch number and bit mask integer. They appear to be saved by their name or an index in the switch.xml file. (And probably same for DOFs.) This is not a good system. The MAX plugin appears to save switch data as a switch number and bit integer, so that even if a user does not have an up-to-date switch list, they can manually assign a switch number and bit rather than solely selecting by name.

To Reproduce
Steps to reproduce the behavior:

  1. Load a blender file with switches of varying number
  2. Edit switch.xml (as if updating) and ensure the edited/added switch.xml block is on a smaller line number than at least one of the switches in the model.
  3. Clear the switch list scene variable from the blender file. (del bpy.context.scene['switch_list'])
  4. Save and reload the scene
  5. Check the switches in scene and note that any switch in scene that corresponds to a position in switch.xml below the user edit will no longer have the correct number/bit

Expected behavior
Ther user requires:

  1. A means to set a switch number and bit independent of the UI switch name list
  2. A means to see the number and bit value of the selected switch empty, rather than just the xml tag
  3. Switch number/bit mask integer saved in scene such that updates to switch.xml in scene variables does not reassign switches inaccurately.

Additionally, if switch list is to be stored in scene, user requires:

  1. A means to clear and update the switch list

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions