Problems updating a formLayout

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  01 January 2013
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.

	formLayout -edit
		-attachControl 		secondFrame 		"top" 		0 	firstFrame
		-attachForm 		secondFrame 		"left" 		0
		-attachForm 		secondFrame 		"right" 	0		
		-attachControl 		secondFrame 		"bottom" 	0 	lastFrame
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 January 2013 at 08:44 PM.
  01 January 2013
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.
  01 January 2013
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.
  01 January 2013
Yeah, the coders eternal nightmare: confounded by a problem, expecting a complicated bug, solution turns out to be trivial
  01 January 2013
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

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
Society of Digital Artists

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

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

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