[Closed] Python/Pyside noob question
Python/Pyside noob question
So… it is time for me to start a journey to Python/Pyside
My goal is…
- Build UI for multiple DCC with Python/Pyside
- Hookup 3dsMax portion to UI
Here is some questions
- How can I detect which program I’m in?
- What is the proper(?) way of building UI?
I only have used Maxscript and dotnet UI.
I have not build UI with struct. - Should I hand code UI or use QtDesigner?
- I guess I need t make a module per DCC and import per DCC?
Is it abstraction?
If someone could show me a simple code, that would be great.
Something like version up button for all DCCs.
I’m using 3dsMax 2018.
Thanks in advance!
All of your goals are possible though non-trivial.
[ul]
[li] For Qt and Max, I’d suggest looking through the examples in the Max 2018 folder located here (assuming a standard installation of 3dsMax) C:\Program Files\Autodesk\3ds Max 2018\scripts\Python
[/li][li] For UI styling, this is a good reference, https://doc.qt.io/archives/qt-4.8/stylesheet-examples.html
[/li][li] The most “proper” way, IMO, when building a potentially complex tool is some variant of MVVM (WPF) or for Qt, probably MVC ( https://en.wikipedia.org/wiki/Model–view–controller )
[/li][li] For coding standards and organization, I’d suggest reading https://www.python.org/dev/peps/pep-0008/
[/li][li] For abstraction, that’s a fairly broad subject, but the main goal is to create reusable and maintainable piece of code, with good interfaces between various pieces
[/li][li] I’d suggest just doing everything in code rather than using a designer, so you’ll understand more of what is going on, and end up with a more compact script/tool
[/li][li] For knowing what program you’re in, you may wind up with a small script per DCC that hosts the core of the tool, so you would implicitly know what program you’re in
[/li][/ul]
Thanks!
My journey has been started.
I have not even figure out how to put multiple QToolButton in QDockWidget :(.