CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 01-13-2013, 08:40 PM   #1
DeadlyNightshade
Plz...
 
DeadlyNightshade's Avatar
portfolio
Martin Dahlin
Jr. Technical Artist
King
Stockholm, Sweden
 
Join Date: Jul 2012
Posts: 922
Problems updating a formLayout

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.

Code:
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.
__________________
Nightshade UV Editor (script for Maya) - Extends Maya's default UV Texture Editor with additional tools.

Last edited by DeadlyNightshade : 01-13-2013 at 08:44 PM.
 
Old 01-13-2013, 10:29 PM   #2
Nyro
Lurking
 
Nyro's Avatar
portfolio
A. D.
Vertex Slinger
Munich, Germany
 
Join Date: Dec 2006
Posts: 1,436
Without seeing the whole code, this is the only thing that comes to mind:

is 'secondFrame' a direct child of the formLayout? It must be in order for the formLayout to consider it a valid control.
 
Old 01-13-2013, 11:08 PM   #3
DeadlyNightshade
Plz...
 
DeadlyNightshade's Avatar
portfolio
Martin Dahlin
Jr. Technical Artist
King
Stockholm, Sweden
 
Join Date: Jul 2012
Posts: 922
Spot on Nyro - that did the trick!
I had parented it to the firstFrame instead of parenting it to myLayout as you suggested.
__________________
Nightshade UV Editor (script for Maya) - Extends Maya's default UV Texture Editor with additional tools.
 
Old 01-14-2013, 12:26 AM   #4
Nyro
Lurking
 
Nyro's Avatar
portfolio
A. D.
Vertex Slinger
Munich, Germany
 
Join Date: Dec 2006
Posts: 1,436
Yeah, the coders eternal nightmare: confounded by a problem, expecting a complicated bug, solution turns out to be trivial
 
Old 01-14-2013, 12:26 AM   #5
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:08 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.