I’ve created a menu which displays three bool properties. These properties are settings later used for an operator which exists as a button for users to click on. When one of these three properties is clicked I need it to toggle the other two off before the user ever clicks on the operator. Here’s what the properties look like set up in a property group.
class myProperties(bpy.types.PropertyGroup): wm = bpy.types.WindowManager wm.mySetting1 = bpy.props.BoolProperty() wm.mySetting2 = bpy.props.BoolProperty() wm.mySetting3 = bpy.props.BoolProperty()
First I tried creating an update function for the properties to use so that when you chose one setting it would automatically turn the other two.
def settingsSwitch(self, context): wm = bpy.context.window_manager if wm.mySetting1: wm.mySetting2 = False wm.mySetting3 = False if wm.mySetting2: wm.mySetting1 = False wm.mySetting3 = False if wm.mySetting3: wm.mySetting1 = False wm.mySetting2 = False class myProperties(bpy.types.PropertyGroup): wm = bpy.types.WindowManager wm.mySetting1 = bpy.props.BoolProperty(update = settingsSwitch) wm.mySetting2 = bpy.props.BoolProperty(update = settingsSwitch) wm.mySetting3 = bpy.props.BoolProperty(update = settingsSwitch)
But this caused Blender to crash every time. Then I investigated BoolVectorProperty thinking I could use it to toggle between the three states but I can’t get the BoolVectorProperty to show up in a menu? And even when I use attr: “toggle” on the BoolVectorProperty it does not seem to automatically change the other two states to False when one is changed to True via the console (since I can’t even get the BoolVectorProperty to display in the user interface).
What’s the easiest way to display three bools in a menu which when you click on one, it automatically switches the other two off? If anyone is confused by my ramblings, please let me know I’ll try to explain better if you think you can help. THANKS!