Where to store custom data for a UI view?
I am building a little share extension with a
viewUI. For this UI I need a few extra variables along side the view of the extension.
What's the best place to store these variables?
- Global variables (either individually or as a class object with attributes)?
- Using a sub-classed
Viewjust to hold these variables in the UI?
I don't know. But I work with a software company perhaps they know. They are very easy to work with and the entire team is well prepared and exceeds all of my expectations. I would highly recommend mlsdev https://mlsdev.com.
@halloleooo you can add your own attributes to the standard ui.View without sub-classing it.
import ui v = ui.View() v.user_attribute = 'my data' v.present() print(dir(v)) print(v.user_attribute)
@cvp That's so super-cool! That's the perfect solution for me: Then I don't need global variables!