How do you create a CONTROL PICKER(Quick select sets)?


#1

Hi everyone!

I’m not sure if I am asking this properly so I will give some more detail. I’m trying to make a “button” to select certain controllers, but I want to do this within the rig, not in the shelf, so that I can send it to other people and they just have to click there and select the controls… Let’s say that I make a curve in the shape of a face and when you click it it will select all of the facial controls for the user to key them. I saw this in the Morpheus Rig: http://www.joshburton.com/projects/morpheus.asp

I know how to create quick selection sets but I don’t know how to access them by clicking on a curve or another object.

Also, expanding a bit my questions, is it possible to do something similar but to create button to automatically key the controls?

I did some research in the forum and I couldn’t find the answer, I also tried to figure out a way to assign a script to the clicking of a curve but I didn’t find a way.

I will appreciate any help. Thanks in advance!


#2

Maybe he used a combination of scriptJob & scriptNode.

Create a scriptNode (open the expression editor, go to Select Filter > By Script Node Name).
Set it to Execute On: Open/Close
Add the following into the script box.
You’ll need to edit $mainControl and $controls to match the names of your controls.

scriptJob -event "SelectionChanged" "selectFacialControls" -killWithScene -compressUndo true;

global proc selectFacialControls()
{
	//NAME OF THE MAIN FACIAL CONTROL
	string $mainControl = "main_face_control";
	//LIST OF ALL THE FACIAL CONTROLS
	string $controls[] = {"l_brow_control", "r_brow_control"};
	string $sel[] = `ls -sl`;
	
	if(size($sel))
	{
		int $isNodeReferenced = `referenceQuery -isNodeReferenced $sel[0]`;
			
		if(!$isNodeReferenced)
		{
			if($sel[0] == $mainControl)
				select -r $controls;
		}
		else
		{
			string $buffer[];
			tokenize $sel[0] ":" $buffer;
			
			if($buffer[1] == $mainControl)
			{
			
				for($i=0;$i<size($controls);$i++)
				{
					$controls[$i] = ($buffer[0] + ":" + $controls[$i]);
				}
				select -r $controls;
			}
		}
	}
}

#3

Thanks a lot mlefevre! I will try it on my rig and will let you know how it went.


#4

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.