[HOME] [MEL] [API]

Mel Script - Attribute Controls

 

 

 

There are a set of user interface controls that are designed to directly manipulate attributes contained within nodes. This means that you don't have to provide callbacks for them to update your attribute values.

 

 

 

 

 

Example

This simply creates three common attribute controls.

 

 


	
  {	
		// create a sphere and a shading node
		$sphere = `sphere`;
		$phong = `shadingNode -asShader phong`;
		
		// create a window to hold the controls		
		window -title "Attribute Controls";
			columnLayout;
			
			// attach a colour control to the phong colour
			attrColorSliderGrp -at ($phong+".color");
			
			// attach a field group to the scale attribute
 			attrFieldGrp -attribute ($sphere[0] + ".scale");
			
			// attach a float slider to the translate X of the sphere
			attrFieldSliderGrp -min -10.0 -max 10.0 -at ($sphere[0]+".tx");
		showWindow;
  }
			

 

 

 

Related Documents

Windows & A quick GUI overview

Layouts

Controls

Menus

Common Dialogs

 

 

[HOME] [MEL] [API]