Hi,
I started looking into some UI example code today, and I was wondering whether there’s a way to make it so that when I enable one of the bool properties, it will cause the rest to be unselected.
I tried doing something like this to see if I could overwrite the values but it was giving me an error in the console.
@classmethod
def poll(self,context):
scene = context.scene
mytool = scene.my_tool
if mytool.my_bool2:
mytool.my_bool2 = False
return context.object is not None
Is there an easy way to get the UI to behave this way, or if not how can I modify property values through code?
Thanks
Use an update callback function on your bool properties? Alternatively based on the limited example shown you could just use an enumerated list and use the expand option in the layout like:
Thank you for providing a sample Nezumi, and Testure for the enum propety suggestion.
Enum property seems to be what I was looking for, after adding the “expand=True” parameter when drawing.