DeadlyNightshade
01-13-2013, 07:40 PM
The UI of my script is created when the script is run, and what it does is that it creates a list of objects, using a for-loop that runs through an object array, creating a new iconTextButton per object. Later on in the script, I want to be able to rebuild this UI-part and "repopulate" the list and I was looking into doing this by first deleting the old UI, then call on a rebuild-procedure and last but not least update the formLayout.
All of this is working except for the final part: updating the formLayout.
formLayout -edit
-attachControl secondFrame "top" 0 firstFrame
-attachForm secondFrame "left" 0
-attachForm secondFrame "right" 0
-attachControl secondFrame "bottom" 0 lastFrame
myLayout; Generates this error:
Error: line 8: Object 'secondFrame' not found.
...which is a lie because running "deleteUI secondFrame" deletes the UI object. If the object didn't exist I wouldn't be able to run that command, so why is Maya complaining?
The reason I need to do that edit to this formLayout is that I need to re-attach the secondFrame UI-object to the lastFrame UI-object. Right now everything in my script is working except for this final part (as I wrote above), and I end up with a large gap between the second and third frame.
All of this is working except for the final part: updating the formLayout.
formLayout -edit
-attachControl secondFrame "top" 0 firstFrame
-attachForm secondFrame "left" 0
-attachForm secondFrame "right" 0
-attachControl secondFrame "bottom" 0 lastFrame
myLayout; Generates this error:
Error: line 8: Object 'secondFrame' not found.
...which is a lie because running "deleteUI secondFrame" deletes the UI object. If the object didn't exist I wouldn't be able to run that command, so why is Maya complaining?
The reason I need to do that edit to this formLayout is that I need to re-attach the secondFrame UI-object to the lastFrame UI-object. Right now everything in my script is working except for this final part (as I wrote above), and I end up with a large gap between the second and third frame.
