I understand also that for this to work, the tabs themselves should be dictionaries, in order to get the dynamic creation happening.
I get the logic, but unfortunately the Python syntax still eludes me somewhat.
Here's the link to the code:
Much appreciated!
Did you mean to keep the second half of your layout code indented in the for loop or is that a typo? Starting with
self.mainForm=mc.formLayout()
That happens once for every loop, replacing the references from the last iteration.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/81b82071-9f42-4c72-9517-92e10f068844%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/e1e5838d-f7c9-494a-82b6-dbf0013c1a73%40googlegroups.com.
For this specific example, I'm writing a script to create mechanical parts (gears, springs, pistons). Each tab will represent one of the parts. Obviously, each part will have it's own unique functionality (which will be created in the custom buttons), but all have a Create and Cancel button.
In addition, springs and pistons are interconnected (pistons will have the option to have a spring between the shafts).
Here's the pseudo-build:
I'm not sure what you mean, but you could just create a couple different functions that take the parent layout as an argument. Or whatever is needed for each function to build its dynamic layout for its type.
Then your main layout can loop over a list and create each custom tab using each custom function. The main UI doesn't really have to know about the contents of the tab as each function sets itself up.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/e56f4fdc-04f2-4478-b79e-f81bee9be242%40googlegroups.com.