MEL scripts


#261

adds some extra buttons to timeslider.
what can be more here ? send some useful sugggestions.


DOWNLOAD


#262

hello … thats very nice … but personaly i rarly change the play rate time to duble or half …

but i use alot “play evry frame” … so for me this works better :slight_smile:


#263

but butCherHeLL, after trying your way … i think its much better :slight_smile:

big thanks,


#264

description:

This code is adds two extra menu items to the shelf’s popup that
forces to increase or decrease rows of shelf.

once you setup the row,it maintains current row size for next start

if you are using toggledblShelf:
its strongly recommened to remove it.use this instead.

DOWNLOAD
http://www.ddmel.com/forum/index.php?topic=39.0


#265

Creates a window that moves the pivot point to the last selected vertex position.
Good for rotating around the edge of an object instead of it’s center
or rotating around another object’s center.
Welcome any feedback on whether this is useful or if there’s
an easier way already included in Maya.


/*
Name: acPivot.mel
Author: Allen Curtis
Date: April 2007
Description: 
Moves pivot point to last selected vertex position.

Instructions:
1.Select vertex of an object.
2.Press the Point Position button. Shows xyz position.
3.Switch to object mode.
4.Press the Move Pivot button. Pivot moves to new position.
*/

string $getCurrentSelected[];	
float $positionNow[];
global proc acPivot(){
if(`window -exists acPivotWindow`)
	deleteUI acPivotWindow;
	window -wh 200 200 -title "Move Pivot" acPivotWindow;
	columnLayout -columnOffset "left" 15 -rs 5 ColumnLayout;	
	//Controls for viewing position of current selection.
	text -label "Selection" -m 1 SelectionLabel;
	text -label "x:" -align "left" labelX;
	text -label "y:" -align "left" labelY;
	text -label "z:" -align "left" labelZ;
	text -label "Point Position" -align "left" labelPointMessage;
	button -label "Point Position" -command "updateSelection" CurrentSelButton;
	button -label "Move Pivot" -command "acMovePivot" MovePivotButton;

	//These floatFieldGrp's are invisible. Their only purpose here is
	//to use their precision flag as a round-off function for text labels.
	//-m/manage flag used for invisibility.
	floatFieldGrp -v1 0.0 -precision 6 -m 0 RoundOffX;
	floatFieldGrp -v1 0.0 -precision 6 -m 0 RoundOffY;
	floatFieldGrp -v1 0.0 -precision 6 -m 0 RoundOffZ;
	showWindow acPivotWindow;
	}

//Moves pivot point to same position as last Point Position setting.
//Switch to object mode before pressing the Move Pivot button.	
global proc acMovePivot(){
	string $sel[] =`ls -sl`;
	string $alignxToPt[];
	string $alignyToPt[];
	string $alignzToPt[];
	float $x;
	float $y;
	float $z;

	string $xvalue = `text -q -label labelX`;
	//Tokenize separates the string into an array.
	string $tokenX = `tokenize $xvalue ":" $alignxToPt`;
	//Could have made an extra float variable here, but string automatically casts (converts) to
	//a float value. 
	$x = $alignxToPt[1];
	
	string $yvalue = `text -q -label labelY`;
	string $tokenY = `tokenize $yvalue ":" $alignyToPt`; 
	$y = $alignyToPt[1];
	
	string $zvalue = `text -q -label labelZ`;
	string $tokenZ = `tokenize $zvalue ":" $alignzToPt`; 
	$z = $alignzToPt[1];
	float $pos[3] = `xform -ws -rp $x $y $z`;
	
	for ($current in $sel)
	{
	setAttr ($current + ".displayRotatePivot") 1;
	};
	}


#266

I would like to have a mel which would snap UVs together. I couldn’t not find it anywhere so I decided to post it here and see if someone who knows how to write a Mel could create this to help to make a better world ; ) for those who work with UVs.

Here what I have in mind: I have maya 7.0

If I select one UV - in UV Texture Editor window go to Select - Converte selection to Edges - (right the way) Select selection to UVs - like that all the UVs that are related will be selected. From here I think the deal would be to have a command which would save each of the original index # and the original position (U,V). I visualized a FloatSlider where we could control the distance just like “Merge Vertex Options”. Also a right and left arrow which would have the function of select the UVs clockwise. Is it possible or it is just a dream?
Thanks.


#267

This is the parent shape trick for selecting a joint by way of a control curve(s). You can also use objects with shape nodes.


{
	$win = `window -title "ParentShape v1.1"`;

global proc pS()
	{
	string $curveJoint[] = `ls -sl`;
	for($i=1;$i<size($curveJoint);++$i)
		{
		parent $curveJoint[$i] $curveJoint[0];
		makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 $curveJoint[$i];
		$curveShape=`listRelatives -shapes $curveJoint[$i]`;
		parent -r -s $curveShape $curveJoint[0];
		delete $curveJoint[$i];
		}
	}

	columnLayout;
	frameLayout -w 250 -cll true PARENTSHAPE;
	columnLayout;

	text - l "1. Select Joint";
	text - l "2. Select Curve(s)";
	button -c pS -l "ParentShape";

showWindow;
}


#268

Probably this is a really simple one:
I want a button with a really long label so it would be nice to have 2 lines
of text. Is it possible? "
" doesn’t work.

Another one: is there a way to set individual spacing for checkboxes in a vertical checkBoxGrp?


#269

Dialog box for proportional scaling to a specific size.


//Name: acScaler.mel
 
//Author: Allen Curtis
 
//Email: allenatl@allen3d.com
 
//Date: May 20, 2007
 
//Revised: May 23, 2007
 
//Description: Dialog box for proportional scaling.
 
//Details:
 
//Proportional button scales x, y, and z values.
 
//Use in object mode. Select an object before opening window.
 
 
 
//Proportional Scale changes do not take effect until the Apply button is pressed.
 
//Reset Scale button resets scale to 1.0. Reset before entering a Desired Size.
 
//Freeze button makes the current size the new 1.0 scale.
 
//Check the Centimeters checkbox to scale to desired size in centimeters.
 
//Uncheck the Centimeters checkbox to scale to desired size in inches.
 
//Press the Prop. Scale button to preview proportional size change in the Inches
 
//or Centimeters textfields.
 
//Press the Apply button to apply the scale to the selected object.
 
//The selected object is scaled on the axis selected and the other two axes are scaled proportionately.
 
//Update button shows what is selected in a label at top of the acScaler window.
 
//Press the Update button to verify the current selection.
 
//Edit Sliders button adjusts sliders maximum, minimum, and step values.
 
//Undoing doesn't update bounding box fields. Click the update button after undoing.
 
 
 
global string $getSelected[];
 
global proc acScaler(){
 
$getSelected=`ls -sl`;
 
if(size(`filterExpand -sm 9 -sm 10 -sm 12 -sm 68 -sm 72`)>0){
 
if(`window -exists acScaleWindow`)
 
deleteUI acScaleWindow;
 
window -widthHeight 300 200 -title "acScaler" -rtf true acScaleWindow;
 
 
 
//This outer formLayout was only added for better alignment of bottom and top elements
 
//Using attachForm with a larger offset centered the upper ColumnLayout better. 
 
string $outerLayout = `formLayout -numberOfDivisions 100`;
 
 
 
columnLayout -columnAttach "left" 10 -columnOffset "both" 5 -rs 5 ColumnLayout;
 
//Controls for viewing position of current selection.
 
text -label "Selection" SelectionLabel;
 
text -edit 
 
-label ("Selection: " + $getSelected[0] + " :1 of " + size($getSelected) + " selected") 
 
SelectionLabel;
 
floatFieldGrp -numberOfFields 3 -label "Size in Centimeters:" -v1 1.0 -v2 1.0 -v3 1.0 
 
-pre 6 -en false boxCtField;
 
floatFieldGrp -numberOfFields 3 -label "Size in Inches:" -v1 1.0 -v2 1.0 -v3 1.0 
 
-pre 6 -en true boxInchField;
 
floatFieldGrp -numberOfFields 3 -label "BoundingBoxMin:" -v1 0.0 -v2 0.0 -v3 0.0 
 
-pre 6 -en false boxMinField;
 
floatFieldGrp -numberOfFields 3 -label "BoundingBoxMax:" -v1 0.0 -v2 0.0 -v3 0.0 
 
-pre 6 -en false boxMaxField;
 
//The -at flag determines what attributes are affected by sliders.
 
attrFieldSliderGrp -min .01 -max 100 -step 0.01 -pre 6 
 
-at ($getSelected[0] +".sx")-cc "showBBox" xSlider;
 
attrFieldSliderGrp -min .01 -max 100 -step 0.01 -pre 6 
 
-at ($getSelected[0] + ".sy")-cc "showBBox" ySlider; 
 
attrFieldSliderGrp -min .01 -max 100 -step 0.01 -pre 6
 
-at ($getSelected[0] + ".sz") -cc "showBBox" zSlider;
 
floatFieldGrp -nf 1 -l "Proportional Scale:" -v1 1.0 -pre 6 propScaleField;
 
 
 
//Layout nested inside another layout.
 
rowLayout -numberOfColumns 7 MainRowLayout;
 
columnLayout -columnAttach "both" 5 -rowSpacing 10 -parent MainRowLayout Column1;//Spacing
 
columnLayout -columnAttach "both" 5 -rowSpacing 10 -parent MainRowLayout Column2;
 
button -label "Update" -c "showBBox" UpdateButton;
 
columnLayout -columnAttach "both" 5 -rowSpacing 10 -parent MainRowLayout Column3;
 
button -label "Apply" -c "acPropScale" PropButton;
 
columnLayout -columnAttach "both" 5 -rowSpacing 10 -parent MainRowLayout Column4;
 
button -label "Close" -c "deleteUI acScaleWindow" ExitButton;
 
columnLayout -columnAttach "both" 5 -rowSpacing 10 -parent MainRowLayout Column5;//Spacing
 
 
 
columnLayout -columnAttach "both" 5 -rowSpacing 10 -parent ColumnLayout CheckBoxColumn;
 
checkBox -label "Centimeters" -value 0 checkCentimeters;
 
 
 
string $form = `formLayout -numberOfDivisions 100 -parent $outerLayout`;
 
 
 
columnLayout -adjustableColumn false -parent $form ScaledColumnLayout;
 
floatFieldGrp -nf 1 -l "Desired Size:" -v1 1.0 -pre 6 scaledSizeField;
 
 
 
columnLayout -adjustableColumn false -parent $form SizeButtonColumnLayout;
 
button -label "Prop. Scale" -align "center" -width 80 -c "desiredScaleSize" SizeButton;
 
 
 
columnLayout -adjustableColumn false -parent $form ResetButtonColumnLayout;
 
button -label "Reset Scale" -align "center" -width 80 -c "resetScaleToOne" ResetButton;
 
 
 
columnLayout -adjustableColumn false -parent $form FreezeButtonColumnLayout;
 
button -label "Freeze Scale" -align "center" -width 80
 
-c "makeIdentity -apply true -t 0 -r 0 -s 1 -n 0" FreezeButton; 
 
 
 
columnLayout -adjustableColumn false -parent $form AxisColumnLayout;
 
radioButtonGrp -numberOfRadioButtons 3 -columnAlign 1 "left"
 
-columnWidth 1 60 -columnWidth 2 80 -label "Axis:"
 
-labelArray3 "x" "y" "z" -sl 2 radioScaledSize;
 
columnLayout -adjustableColumn false -parent $form EditSliderLayout;
 
floatFieldGrp -nf 3 -l "Sliders Min/Max/Step:" -v1 .01 -v2 100 -v3 .01 -pre 6 editSlidersField;
 
columnLayout -adjustableColumn false -parent $form SliderButtonLayout;
 
button -label "Edit Sliders" -c "editSliders" SliderButton;
 
 
 
 
 
formLayout -edit
 
-attachForm ScaledColumnLayout "top" 5
 
-attachForm ScaledColumnLayout "left" 5
 
-attachControl ScaledColumnLayout "bottom" 10 AxisColumnLayout
 
 
 
-attachOppositeControl SizeButtonColumnLayout "top" 5 ScaledColumnLayout
 
-attachControl SizeButtonColumnLayout "left" 10 ScaledColumnLayout
 
-attachControl SizeButtonColumnLayout "bottom" 10 AxisColumnLayout
 
 
 
 
 
-attachOppositeControl ResetButtonColumnLayout "top" 5 ScaledColumnLayout
 
-attachControl ResetButtonColumnLayout "left" 5 SizeButtonColumnLayout
 
-attachControl ResetButtonColumnLayout "bottom" 10 AxisColumnLayout
 
 
 
-attachOppositeControl FreezeButtonColumnLayout "top" 5 ScaledColumnLayout
 
-attachControl FreezeButtonColumnLayout "left" 5 ResetButtonColumnLayout
 
-attachControl FreezeButtonColumnLayout "bottom" 10 AxisColumnLayout
 
 
 
-attachNone AxisColumnLayout "top"
 
-attachForm AxisColumnLayout "right" 15
 
-attachControl AxisColumnLayout "bottom" 10 EditSliderLayout
 
-attachNone EditSliderLayout "top"
 
-attachForm EditSliderLayout "left" 5
 
-attachForm EditSliderLayout "bottom" 10
 
-attachNone SliderButtonLayout "top"
 
-attachForm SliderButtonLayout "right" 5
 
-attachForm SliderButtonLayout "bottom" 10
 
 
 
 
 
$form;
 
 
 
 
 
formLayout -edit
 
-attachForm ColumnLayout "top" 5
 
-attachForm ColumnLayout "left" 28
 
 
 
-attachForm $form "bottom" 5
 
-attachForm $form "left" 5 
 
 
 
$outerLayout;
 
window -edit -widthHeight 538 524 acScaleWindow;
 
showWindow acScaleWindow;
 
}else{
 
confirmDialog -title "acScaler: Selection Type" 
 
-message "Select a Polygon, Subdiv, or NURBS Object before opening acScaler." 
 
-button "OK";
 
}//end else
 
}
 
global proc acPropScale(){ 
 
float $getValue = `floatFieldGrp -q -v1 propScaleField`;
 
scale $getValue $getValue $getValue ;
 
showBBox;
 
}
 
global proc showBBox(){
 
$getSelected =`ls -sl`;
 
if(size(`filterExpand -sm 9 -sm 10 -sm 12 -sm 68 -sm 72`)>0){
 
string $attr = $getSelected[0] + ".boundingBoxSize";
 
float $value[]= `getAttr $attr`;
 
float $selNumber = size($getSelected);
 
if ($selNumber>1){
 
text -edit 
 
-label 
 
("Multiple selections: " + $getSelected[0] + " :1 of " + $selNumber +
 
". Unexpected results possible.") 
 
SelectionLabel;
 
}else{
 
text -edit 
 
-label ("Selection: " + $getSelected[0] + " :1 of " + $selNumber + " selected") 
 
SelectionLabel;
 
}
 
floatFieldGrp -edit -v1 $value[0] boxCtField;
 
floatFieldGrp -edit -v2 $value[1] boxCtField;
 
floatFieldGrp -edit -v3 $value[2] boxCtField;
 
$attr = $getSelected[0] + ".boundingBoxMax";
 
float $conversion = 0.3937;
 
float $inch= $value[0] * $conversion;
 
floatFieldGrp -edit -v1 $inch boxInchField;
 
$inch= $value[1] * $conversion;
 
floatFieldGrp -edit -v2 $inch boxInchField;
 
$inch= $value[2] * $conversion;
 
floatFieldGrp -edit -v3 $inch boxInchField;
 
$attr = $getSelected[0] + ".boundingBoxMin";
 
$value = `getAttr $attr`;
 
floatFieldGrp -edit -v1 $value[0] boxMinField;
 
floatFieldGrp -edit -v2 $value[1] boxMinField;
 
floatFieldGrp -edit -v3 $value[2] boxMinField;
 
$attr = $getSelected[0] + ".boundingBoxMax";
 
$value = `getAttr $attr`;
 
floatFieldGrp -edit -v1 $value[0] boxMaxField;
 
floatFieldGrp -edit -v2 $value[1] boxMaxField;
 
floatFieldGrp -edit -v3 $value[2] boxMaxField;
 
 
 
float $editMin = `floatFieldGrp -q -v1 editSlidersField`;
 
float $editMax = `floatFieldGrp -q -v2 editSlidersField`;
 
float $editStep = `floatFieldGrp -q -v3 editSlidersField`;
 
//Update sliders when a new selection is made.
 
attrFieldSliderGrp -edit -min $editMin -max $editMax -step $editStep 
 
-at ($getSelected[0] +".sx") xSlider;
 
attrFieldSliderGrp -edit -min $editMin -max $editMax -step $editStep 
 
-at ($getSelected[0] + ".sy") ySlider;
 
attrFieldSliderGrp -edit -min $editMin -max $editMax -step $editStep
 
-at ($getSelected[0] + ".sz") zSlider;
 
}else{
 
confirmDialog -title "acScaler: Selection Type" 
 
-message "Select Polygon, Subdiv, or NURBS Object Type." 
 
-button "OK";
 
}//end else
 
}//end proc
 
 
 
global proc editSliders(){
 
$getSelected =`ls -sl`;
 
if(size(`filterExpand -sm 9 -sm 10 -sm 12 -sm 68 -sm 72`)>0){
 
float $editMin = `floatFieldGrp -q -v1 editSlidersField`;
 
float $editMax = `floatFieldGrp -q -v2 editSlidersField`;
 
float $editStep = `floatFieldGrp -q -v3 editSlidersField`;
 
 
 
attrFieldSliderGrp -edit -min $editMin -max $editMax -step $editStep 
 
-at ($getSelected[0] +".sx") xSlider;
 
attrFieldSliderGrp -edit -min $editMin -max $editMax -step $editStep 
 
-at ($getSelected[0] + ".sy") ySlider;
 
attrFieldSliderGrp -edit -min $editMin -max $editMax -step $editStep
 
-at ($getSelected[0] + ".sz") zSlider;
 
}else{
 
confirmDialog -title "acScaler: Selection Type" 
 
-message "Select Polygon, Subdiv, or NURBS Object Type." 
 
-button "OK";
 
}//end else
 
} 
 
 
 
global proc desiredScaleSize(){ 
 
float $getXValue;
 
float $getYValue;
 
float $getZValue;
 
 
 
float $setDesiredValue = `floatFieldGrp -q -v1 scaledSizeField`;
 
float $getProp = `floatFieldGrp -q -v1 propScaleField`;
 
 
 
int $inchOrMetric=`checkBox -query -value checkCentimeters`;
 
 
 
if($inchOrMetric==0){
 
floatFieldGrp -edit -en false boxCtField;
 
floatFieldGrp -edit -en true boxInchField;
 
$getXValue = `floatFieldGrp -q -v1 boxInchField`;
 
$getYValue = `floatFieldGrp -q -v2 boxInchField`;
 
$getZValue = `floatFieldGrp -q -v3 boxInchField`;
 
}else if($inchOrMetric==1){
 
floatFieldGrp -edit -en true boxCtField;
 
floatFieldGrp -edit -en false boxInchField;
 
$getXValue = `floatFieldGrp -q -v1 boxCtField`;
 
$getYValue = `floatFieldGrp -q -v2 boxCtField`;
 
$getZValue = `floatFieldGrp -q -v3 boxCtField`;
 
}
 
 
 
int $radioAxis = `radioButtonGrp -q -sl radioScaledSize`;
 
float $percent;
 
float $setXSize;
 
float $setYSize;
 
float $setZSize;
 
 
 
//x axis selected
 
if(($radioAxis==1) && ($getProp==1.0)){
 
 
 
if($getXValue==0){//inner if else
 
confirmDialog -title "acScaler: Scaling Message" 
 
-message "Size on X axis is 0. Select another axis for desired size." 
 
-button "OK";}else{
 
 
 
$percent = $setDesiredValue/$getXValue;
 
$setYSize = $getYValue * $percent;
 
$setZSize = $getZValue * $percent;
 
string $changePercent = `floatFieldGrp -edit -v1 $percent propScaleField`;
 
if($inchOrMetric==0){ //nested if
 
floatFieldGrp -edit -v1 $setDesiredValue boxInchField;
 
floatFieldGrp -edit -v2 $setYSize boxInchField; 
 
floatFieldGrp -edit -v3 $setZSize boxInchField;
 
}else if($inchOrMetric==1){
 
floatFieldGrp -edit -v1 $setDesiredValue boxCtField;
 
floatFieldGrp -edit -v2 $setYSize boxCtField; 
 
floatFieldGrp -edit -v3 $setZSize boxCtField;
 
}//nested if ends
 
}//inner if else ends
 
 
 
//y axix selected
 
}else if(($radioAxis==2) && ($getProp==1.0)){
 
 
 
if($getYValue==0){//inner if else
 
confirmDialog -title "acScaler: Scaling Message" 
 
-message "Size on Y axis is 0. Select another axis for desired size." 
 
-button "OK";}else{
 
 
 
$percent = $setDesiredValue/$getYValue;
 
$setXSize = $getXValue * $percent;
 
$setZSize = $getZValue * $percent;
 
string $changePercent = `floatFieldGrp -edit -v1 $percent propScaleField`;
 
if($inchOrMetric==0){//nested if
 
floatFieldGrp -edit -v1 $setXSize boxInchField;
 
floatFieldGrp -edit -v2 $setDesiredValue boxInchField; 
 
floatFieldGrp -edit -v3 $setZSize boxInchField;
 
}else if($inchOrMetric==1){
 
floatFieldGrp -edit -v1 $setXSize boxCtField;
 
floatFieldGrp -edit -v2 $setDesiredValue boxCtField; 
 
floatFieldGrp -edit -v3 $setZSize boxCtField;
 
}//nested if ends
 
 
 
}//inner if else ends 
 
 
 
//z axis selected
 
}else if(($radioAxis==3) && ($getProp==1.0)){
 
 
 
if($getZValue==0){//inner if else
 
confirmDialog -title "acScaler: Scaling Message" 
 
-message "Size on Z axis is 0. Select another axis for desired size." 
 
-button "OK";}else{
 
$percent = $setDesiredValue/$getZValue;
 
$setXSize = $getXValue * $percent;
 
$setYSize = $getYValue * $percent; 
 
string $changePercent = `floatFieldGrp -edit -v1 $percent propScaleField`;
 
if($inchOrMetric==0){//nested if
 
floatFieldGrp -edit -v1 $setXSize boxInchField;
 
floatFieldGrp -edit -v2 $setYSize boxInchField; 
 
floatFieldGrp -edit -v3 $setDesiredValue boxInchField;
 
}else if($inchOrMetric==1){
 
floatFieldGrp -edit -v1 $setXSize boxCtField;
 
floatFieldGrp -edit -v2 $setYSize boxCtField; 
 
floatFieldGrp -edit -v3 $setDesiredValue boxCtField;
 
}//nested if ends
 
}//inner if else ends 
 
}else{
 
confirmDialog -title "acScaler: Scaling Message" 
 
-message "Reset Scale before entering desired size." 
 
-button "OK";
 
}
 
}
 
 
 
global proc resetScaleToOne(){ 
 
floatFieldGrp -edit -v1 1.0 propScaleField;
 
acPropScale;
 
} 
 
 
 


#270

hi everyone!
i’m newibe in MEL, therefore dont judge me too much, please :slight_smile:

there’s some script i’ve written foк easier tuning of DOF in Maya. It works both in maya software & mental ray renderers (the only difference that in mental you should decrease Fstop attribute approximately 50 %).
this script creates camera and two locators, one of which (the biggest) has attributes DOFdepth (for determining which focus distance you need) and Lscale (for comfort).
!dont translate it with moveTool!
examples:
locator along with first sphere:

locator along with second sphere:

locator along with third sphere:

script:

//// eraDOFcamera //// created by eranicle <Artur Kamalov>

//// creating camera

camera -n “eraDOFcam1”
-depthOfField true
-displayResolution true
-displaySafeAction true
-displayFilmPivot true;
setAttr “eraDOFcam1Shape1.overscan” 1.3;
setAttr “eraDOFcam1Shape1.fStop” 2;

//// creating distance dimension

spaceLocator -n “DOFlocator1” -p 0 0 0;
spaceLocator -n “DOFlocator2” -p 0 0 -7;
addAttr -keyable true -ln “lScaleX” -at “float” DOFlocator2;
connectAttr DOFlocator2.lScaleX DOFlocator2Shape.localScaleX;
addAttr -keyable true -ln “lScaleY” -at “float” DOFlocator2;
connectAttr DOFlocator2.lScaleY DOFlocator2Shape.localScaleY;
addAttr -keyable true -ln “lScaleZ” -at “float” DOFlocator2;
connectAttr DOFlocator2.lScaleZ DOFlocator2Shape.localScaleZ;

setAttr DOFlocator2.lScaleX 5;
setAttr DOFlocator2.lScaleY 5;
setAttr DOFlocator2.lScaleZ 5;

distanceDimension -sp 0 0 0 -ep 0 0 -7;

//// parenting first DOFlocator to cam

select -r eraDOFcam1;
select -tgl DOFlocator1 ;
pointConstraint -offset 0 0 0 -weight 1;

//// parenting second DOFlocator to cam

select -r eraDOFcam1;
select -tgl DOFlocator2 ;
parentConstraint -mo -weight 1;

//// adding new “depth” attribute to DOFlocator

addAttr -ln “DOFdepth” -keyable true DOFlocator2;
connectAttr DOFlocator2.DOFdepth DOFlocator2Shape.localPositionZ;

//// some improvements

setAttr DOFlocator2.DOFdepth -7;
setAttr -lock true “DOFlocator2.sx”;
setAttr -lock true “DOFlocator2.sy”;
setAttr -lock true “DOFlocator2.sz”;
setAttr -keyable false “DOFlocator2.sx”;
setAttr -keyable false “DOFlocator2.sy”;
setAttr -keyable false “DOFlocator2.sz”;
setAttr -keyable false “DOFlocator2.rx”;
setAttr -keyable false “DOFlocator2.ry”;
setAttr -keyable false “DOFlocator2.rz”;
setAttr -keyable false “DOFlocator2.tx”;
setAttr -keyable false “DOFlocator2.ty”;
setAttr -keyable false “DOFlocator2.tz”;

//// connecting loator’s DOFdepth to camera focusDistance

connectAttr -f distanceDimensionShape1.distance eraDOFcam1Shape1.focusDistance;

//// for comfort work

TwoSideBySideViewArrangement;
lookThroughModelPanel persp modelPanel1;
lookThroughModelPanel eraDOFcam1 modelPanel4;

//// end


#271

Add many attributes at one time… There’s also “vector Int” and Vector Float…

You can also do soft Min and Max…

Download from :
http://puppetTD.com —> Downloads

Download from : http://puppetTD.com ----> Downloads


#272

hi, im looking for a script that allows me to change the color attribute for multiple shaders at one time. or possibly just setting the color attribute to black. i have a big scene with many shaders and im trying to get a reflection pass and i do not want to lose any of my reflection attributes.

thanks


#273

dgCopyKeys.mel is nice little script that is copying keys from the first select object to all others… It offset the keys for every object (from the previous one) by the specified values

http://puppettd.com/ ->> Downloads


#274
 global proc TransferShaders() 

{

//we need to select the first object

string $Opt_Obj[]=`ls - selection`;

//select the first object

select $Opt_Obj[0];

//get list of shaders assigned to it

hyperShade -smn "";

//now select the first shader and do select object with materils

string $Opt_Shd[]=`ls - selection`;

int $no_Shd = `size $Opt_Shd`;

int $input = 0;
////////////////////////////////////////////////////////////////////////////////////
while ( $input <= $no_Shd-1)

{

int $r = $input++;

print $r;

select $Opt_Shd[$r];

//we havr selected particular shader in the row let us now 

//select the faces through that shaders 

hyperShade -objects "";

//lets list the selection

string $Opt_Face[]=`ls -selection`;

///Replace the name from 1st to 2nd object/////////////////////////////////

string $Opt_Name1[]={$Opt_Obj[0]};

string $Opt_Name2[]={$Opt_Obj[1]};

//////////////////////////////////////////////////////////////////////////////

int $Opt_F_Siz= `size $Opt_Face`;

int $input_Shd = 0;

//get the name of the slected current face

while ( $input_Shd <= $Opt_F_Siz-1)

{
int $t = $input_Shd++;

print $t;

select $Opt_Face[$t];
string $Opt_Face_S=`fileExtension ($Opt_Face[$t])`;

//rename with new object///////////////////////////////////////////

string $Opt_Arrange[]={$Opt_Name2[0] +"."+ $Opt_Face_S};

///////// Assign shaders ////////////////////////////////////////////

select $Opt_Arrange[0];

hyperShade -assign $Opt_Shd[$r];

}

}

};
 
 
 


#275
 select the vertex and execute ... 
 
 
//#############################################################################//
 
///////////////////// { Create Sprite on Selected Vertce }///////////////////////
 
//#############################################################################//
 
 
 
//////////////////////( Procedure is declared )/////////////////////////////////
 
 
global proc createSprite()
 
 
{
 
 
string $MySel[]= `ls -selection`;
 
int $siz = `size ( $MySel )`;
 
if ($siz >= 2 )
 
{
 
warning "there are more than one vertice or object selected / Select one vertice at a Time ";
 
 
}
 
else
 
{
 
 
string $h[]={ $MySel[0]};
vector $ror = `xform -q -wd -t ($h)`;
string $fgh[0] = 
`polyPlane 
-n "Sprite" 
-w .1 
-h .1 
-sx 1 
-sy 1 
-ax 0 0 1 
-tx 1 
-ch 0`;
//////////move the pivot down and sprite up///////////////////////
move 
-r 0 -0.05 0 $fgh.scalePivot $fgh.rotatePivot ;
move ($ror.x,$ror.y,$ror.z);
move -r 0 0.05 0 ;
/////////////////////////////////////////////////////////////////////
 
}
 
;
 
}


#276
 //########################################################################################// 
 
////////////////////////////////////////////////////////////////////////////////////////////
 
////////////////////////////////////////////////////////////////////////////////////////////
 
/* This file was created for the Use of all 3D Artist for managing thier files to work 
 
effeciently
 
 
 
'' Script Name: MAYA_PROJECT_MANAGER
 
'' Author: Swapnil Halarnkar ( OPTIK ) 
 
'' 
 
'' Please do not alter any information above this line
 
*/
 
///////////////////////////////////////////////////////////////////////////////////////////
 
///////////////////////////////////////////////////////////////////////////////////////////
 
/// ///
 
/// Procedure Name : MAYA_PROJECT_MANAGER ///
 
/// Created : january 23 2007 ///
 
/// Last Updated: ///
 
/// ///
 
/// Author : Swapnil Halarnkar ///
 
/// Contact : [email="http://forums.cgsociety.org/swapnil_artist@yahoo.co.in"]swapnil_artist@yahoo.co.in[/email] ///
 
/// ///
 
/// Description : ///
 
/// 1) This procedure will set all the camera renderable to "0" ///
 
/// 2) Also your desire camera to be renderable ///
 
/// 3)*NOTE : only the active camera will become renderable or ///
 
/// remain renderable ///
 
/// 5) the total folder need to be copied to D:/ sky_Tools ///
 
/// or scripts wont excute
 
/// 4) This is my Second script Job , to preserve it its my 
 
/// first step ///
 
/// ///
 
/// How to use : ///
 
/// ///
 
/// Put the script in your scripts folder then type and execute ///
 
/// "CamRenderActive" in the command line or Script Editor, ///
 
/// an UI window will appear. Then follow the help in the UI ///
 
/// window to finish your job. ///
 
/// ///
 
/// Inputs : None ///
 
/// script : Script 2 ( Automation + Effeciency ) ///
 
/// Return : None ///
 
/// Credits : /// ///
 
/// All Rights Reserved . ///
 
///////////////////////////////////////////////////////////////////////////////////////////
 
///////////////////////////////////////////////////////////////////////////////////////////
 
//########################################################################################//
 
////////////////
 
// MEL Starts //
 
////////////////
 
 
 
 
 
///////////////////////////////////////////////////////////////////////////////////////////
 
///////////////////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
//########################################################################################//
 
////////////////////////////////////////////////////////////////////////////////////////////
 
////////////////// {THE PROCEDURE MAYA PROJECT MANAGER DECLARED}////////////////////////////
 
////////////////////////////////////////////////////////////////////////////////////////////
 
//########################################################################################//
 
 
 
 
 
 
 
 
 
global proc MAYA_PROJECT_MANAGER()
 
 
 
{
 
 
 
 
 
 
 
 
 
 
 
 
 
////////////////// {THE WINDOW AND LAYOUT DECLARED}/////////////////////////////////////////
 
////////////////////////////////////////////////////////////////////////////////////////////
 
//########################################################################################//
 
 
 
string $MPM = `window 
 
-t "MAYA_PROJECT_MANAGER ® Scripting by: OPTIK " 
 
//########################################################################################//
 
- wh 520 500`;
 
scrollLayout;setParent;
 
 
 
 
 
 
 
 
 
////////////////// {THE FIRST SECTION OF SHADERS} //////////////////////////////////////////
 
/////////////////////////////{Fabric}///////////////////////////////////////////////////////
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Fabric/"`;
 
string $PM[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Fabric/"`;
 
int $Pic_No = `size $PF`;
 
int $inputNo = 0 ;
 
 
 
 
 
 
 
 
 
string $tabs = `tabLayout -innerMarginWidth 5 -innerMarginHeight 5 -childResizable 1`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
 
 
 
 
string $child1 = `columnLayout -adjustableColumn 1 `;
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440 
 
-label "Fabric " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
 
 
 
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] 
 
-c "file -import $PM[$r]"; ;
 
}
 
setParent ..; setParent ..;
 
 
 
 
 
////////////////// {THE SECOND SECTION OF SHADERS} /////////////////////////////////////////
 
///////////////////////////{ Furs }//////////////////////////////////////////////////////////
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Furs/"`;
 
int $Pic_No = `size $PF`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
 
 
int $inputNo = 0 ;
 
 
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440
 
-label "Furs " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] 
 
-c ("file -import $PF[$r]");
 
}
 
setParent ..; setParent ..;
 
////////////////// {THE THIRD SECTION OF SHADERS} /////////////////////////////////////////
 
////////////////////////{ GLASS }/////////////////////////////////////////////////////////
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Glass/"`;
 
int $Pic_No = `size $PF`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
int $inputNo = 0 ;
 
 
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440
 
-label "Glass " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] ;
 
}
 
setParent ..; setParent ..;
 
////////////////// {THE FOURTH SECTION OF SHADERS} /////////////////////////////////////////
 
//////////////////////////{ LIQUID }////////////////////////////////////////////////////////
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Liquid/"`;
 
int $Pic_No = `size $PF`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
int $inputNo = 0 ;
 
 
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440
 
-label "Liquid " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] ;
 
}
 
setParent ..; setParent ..;
 
 
 
////////////////// {THE FIFTH SECTION OF SHADERS} /////////////////////////////////////////
 
//////////////////////////{ METALS }///////////////////////////////////////////////////////
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Metals/"`;
 
int $Pic_No = `size $PF`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
int $inputNo = 0 ;
 
 
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440
 
-label "Metals " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] ;
 
}
 
setParent ..; setParent ..;
 
 
 
////////////////// {THE SIXTH SECTION OF SHADERS} /////////////////////////////////////////
 
////////////////////////{ ORGANIC }////////////////////////////////////////////////////////
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Organic/"`;
 
int $Pic_No = `size $PF`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
int $inputNo = 0 ;
 
 
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440 
 
-label "Organic " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] ;
 
}
 
setParent ..; setParent ..;
 
 
 
////////////////// {THE SEVENTH SECTION OF SHADERS} /////////////////////////////////////////
 
/////////////////////////{ ROCKS }///////////////////////////////////////////////////////////
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Rocks/"`;
 
int $Pic_No = `size $PF`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
int $inputNo = 0 ;
 
 
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440
 
-label "Rocks " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] ;
 
}
 
setParent ..; setParent ..;
 
 
 
////////////////// {THE EIGHTTH SECTION OF SHADERS} /////////////////////////////////////////
 
///////////////////////////{ VELVET }////////////////////////////////////////////////////////
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Velvet/"`;
 
int $Pic_No = `size $PF`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
int $inputNo = 0 ;
 
 
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440
 
-label "Velvet " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] ;
 
}
 
setParent ..; setParent ..;
 
////////////////// {THE NINTH SECTION OF SHADERS} /////////////////////////////////////////
 
/////////////////////////////{ WOODS }/////////////////////////////////////////////////////
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Woods/"`;
 
int $Pic_No = `size $PF`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
int $inputNo = 0 ;
 
 
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440 
 
-label "Woods " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] ;
 
}
 
setParent ..; setParent ..;
 
////////////////// {THE TENTH SECTION OF SHADERS} //////////////////////////////////////////
 
////////////////////////////{ GENERIC }/////////////////////////////////////////////////////
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Generic/"`;
 
int $Pic_No = `size $PF`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
int $inputNo = 0 ;
 
 
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440
 
-label "Generic " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] ;
 
}
 
setParent ..; setParent ..;
 
////////////////// {THE ELEVENTH SECTION OF SHADERS} /////////////////////////////////////////
 
////////////////////////////////////////////////////////////////////////////////////////////
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Generic/"`;
 
int $Pic_No = `size $PF`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
int $inputNo = 0 ;
 
 
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440 
 
-label " " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] ;
 
}
 
setParent ..; setParent ..;
 
////////////////// {THE TWELTH SECTION OF SHADERS} /////////////////////////////////////////
 
////////////////////////////////////////////////////////////////////////////////////////////
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Generic/"`;
 
int $Pic_No = `size $PF`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
int $inputNo = 0 ;
 
 
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440
 
-label " " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] ;
 
}
 
setParent ..; setParent ..;
 
 
 
////////////////// {THE THIRTEENTH SECTION OF SHADERS} /////////////////////////////////////
 
////////////////////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Shaders/icons/Generic/"`;
 
int $Pic_No = `size $PF`;
 
string $AnT[]= {"There are " + $Pic_No + " Shaders" }; 
 
int $inputNo = 0 ;
 
frameLayout 
 
-ann $AnT
 
-bgc 0 0 0.363 
 
-w 440 
 
-label " " 
 
-cll true 
 
-cl 1 
 
-bs "etchedOut";
 
rowColumnLayout 
 
-nc 5 
 
-cw 1 80 
 
-cw 2 80 
 
-cw 3 80 
 
-cw 4 80 
 
-cw 5 80;
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
int $r = $inputNo++;
 
symbolButton
 
-image $PF[$r]
 
-bgc 0 0 0
 
-ann $PF[$r] ;
 
}
 
 
 
setParent ..; setParent ..; setParent ..;
 
///////////////////////////edit the tab /////////////////////////////////////////////////
 
tabLayout -edit
 
-tabLabel $child1 "Shaders" 
 
$tabs;
 
 
 
 
 
//########################################################################################//
 
//////////////////////////////// {TAB THIRD} ///////////////////////////////////////////////
 
//////////////////////////////{FILES TO IMPORT//////////////////////////////////////////////
 
 
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/Library/Import/"`;
 
int $Pic_No = `size $PF`;
 
int $inputNo = 0 ;
 
 
 
string $child2 = `columnLayout -adjustableColumn true`;
 
frameLayout 
 
-bgc 0 0 0.363 
 
-w 440
 
-label " Import File " 
 
-cll true 
 
-cl false 
 
-bs "etchedOut";
 
 
 
 
 
rowColumnLayout -nc 1 -cw 1 400 ;
 
 
 
while ( $inputNo <= $Pic_No-1 )
 
 
 
{
 
 
 
int $r = $inputNo++;
 
string $j[]= `getFileList - folder "D:/Project_Manager/Library/import/"`;
 
string $path[] = {"D:/Project_Manager/mel/" +$j[0] };
 
string $fe = `encodeString $path[0]`;
 
string $qoute[]= {"\""};
 
 
 
 
 
 
 
string $icmm[] = {"file -import "+ $qoute[0] + "D:/Project_Manager/Library/import/" +$j[$r] + $qoute[0] };
 
button
 
-w 400 
 
-h 20
 
-align "center"
 
-label $PF[$r]
 
-c $icmm;
 
}
 
setParent ..; setParent ..; setParent ..;
 
////////////////////////////////////////edit the tab ////////////////////////////////////////
 
tabLayout -edit
 
-tabLabel $child2 "Import" 
 
$tabs;
 
////////////////////////////////////////////////////////////////////////////////////////////
 
 
 
//########################################################################################//
 
//////////////////////////////// {THE TAB THIRD } //////////////////////////////////////////
 
////////////////////////////////////{SCRIPTS }//////////////////////////////////////////////
 
 
 
string $PF[]= `getFileList -folder "D:/Project_Manager/mel/"`;
 
int $Pic_No = `size $PF`;
 
int $inputNo = 0 ;
 
 
 
string $child3 = `columnLayout -adjustableColumn true`;
 
frameLayout 
 
-bgc 0 0 0.363 
 
-w 440
 
-label "Scripts " 
 
-cll true 
 
-cl false 
 
-bs "etchedOut";
 
 
 
 
 
rowColumnLayout 
 
-nc 1 
 
-cw 1 400 ;
 
 
 
///////////////////////////////////////////////////////////////////////////////////////////
 
///////////////////////MEL FOR SCRIPT EXECUTION ON BUTTON PRESS////////////////////////////
 
///////////////////////////////////////////////////////////////////////////////////////////
 
//GMP : GET MEL PATH
 
//GP : GOT PATH
 
//MSF : MEL SCRIPT FILE
 
//NMSF : NO MEL SCRIPT FILE
 
//KIT : ULTIMATE PROCEDURE NAME
 
//////////////////////////////////////////////////////////////////////////////////////////
 
$input2No=0;
 
string $GMP[]= `getFileList - folder "D:/Project_Manager/mel/" -filespec "*.mel"`;
 
//////////////////////////////////////////////////////////////////////////////////////////
 
 
 
//////////////////////////////////////////////////////////////////////////////////////////
 
int $NMSF = `size $GMP`;
 
//////////////////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
while ( $input2No <= $NMSF-1 )
 
{
 
 
 
string $j[]= `getFileList - folder "D:/Project_Manager/mel/" -filespec "*.mel"`;
 
string $path[] = {"D:/Project_Manager/mel/" +$j[0] };
 
int $r= $input2No++;
 
string $f = $j[$r];
 
string $f = $j[$r];
 
string $gotj = `basenameEx $f`;
 
print $gotj;
 
button
 
-label $gotj
 
-align "center"
 
-ann $gotj
 
-c $gotj;
 
 
 
}
 
 
 
 
 
 
 
setParent ..; setParent ..; setParent ..;
 
////////////////////////////////////////edit the tab ///////////////////////////////////////
 
tabLayout -edit
 
-tabLabel $child3 "Scripts" 
 
$tabs;
 
 
 
 
 
 
 
//########################################################################################//
 
//////////////////////////////// {THE TAB FIFTH} //////////////////////////////////////////
 
/////////////////////////////////{MY COMPUTER }//////////////////////////////////////////////
 
 
 
string $child12 = `columnLayout`;
 
//lets declare some procedures
 
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
 
 
 
columnLayout 
 
-w 440 -h 500;
 
 
 
 
 
button
 
-l "My Computer"
 
-c MFT;
 
 
 
 
 
button
 
-l " Local D:/ "
 
-c DFT;
 
 
 
button
 
-l " PROJECT "
 
-c PFT;
 
button
 
-l " Local C:/ "
 
-c CFT;
 
 
 
 
 
$browser = `webBrowser -width 800 -height 600 -url "file:///D:/Project_Manager/"`;
 
setParent ..; setParent ..; 
 
////////////////////////////////////////edit the tab ///////////////////////////////////////
 
tabLayout -edit
 
-tabLabel $child12 "Computer " 
 
$tabs;
 
////////////////////////////////////////////////////// /////////////////////////////////////
 
//########################################################################################//
 
//////////////////////////////// {THE TAB FOURTH} //////////////////////////////////////////
 
////////////////////////////////////{ HELP }////////////////////////////////////////////////
 
// lets source the procedure
 
source "D:/Project_Manager/Library/Support scripts/DFT.mel";
 
source "D:/Project_Manager/Library/Support scripts/CFT.mel";
 
source "D:/Project_Manager/Library/Support scripts/MFT.mel";
 
source "D:/Project_Manager/Library/Support scripts/PFT.mel";
 
source "D:/Project_Manager/Library/Support scripts/credit.mel";
 
string $child15 = `columnLayout -adjustableColumn true `;
 
 
 
//adding some text matter for Help section
 
//made it into a Array and calling it with
 
//escape character to get into new line...
 
 
 
 
 
//-----------------------------TEXT MATTER STARTS---------------------------------------------//
 
 
 
 
 
string $line1[] = 
 
 
 
{ " MAYA_PROJECT_MANAGER® Scripting by: OPTIK " ,
 
"---------------------- Author: Swapnil Halarnkar", 
 
" DQ Entertainment PVT. LTD. ",
 
" --------------------------",
 
"",
 
"",
 
" *{ Maya Project Manager is designed for User Friendly ",
 
" acess , while the only limitation it offers is the ",
 
" path to where it needs to be set and ristricted to ",
 
" given folder Hirechy } ",
 
"",
 
"",
 
" Features : 1) important feature of this UI is its dynamic ",
 
" Usage. ",
 
" 2) copy whatever shaders and its respective BMP",
 
" with specified size in respective folders to",
 
" view and import on a click. ",
 
" 3) while Import section implies same features, ",
 
" the Script section shows and executes the ",
 
" script removing the necessity to source a ",
 
" Script. ",
 
" 4) Computer tab is kind of a browser from where ",
 
" U can acess drives on the system and also ",
 
" added features of Web Browser ",
 
" 5) MAYA Help section are for those who really ",
 
" thier careers seriously. ",
 
"",
 
"",
 
" How to Use : 1) Copy Project_Manager folder to D drive. ",
 
" 2) load shelf my shelf from the folder. ",
 
" 3) set Project to Project Manager folder. "};
 
 
 
scrollField -w 440 -h 450 
 
 
 
-text ( $line1[0]+"
"+ $line1[1]+"
"+ $line1[2]+"
"
 
+"
"+$line1[3]+"
"+ $line1[4]+"
"+ $line1[5]
 
+"
"+$line1[6]+"
"+ $line1[7]+"
"+ $line1[8]
 
+"
"+ $line1[9]+"
"+ $line1[10]+"
"+ $line1[11]
 
+"
"+ $line1[12]+"
"+ $line1[13]+"
"+ $line1[14]
 
+"
"+ $line1[15]+"
"+ $line1[16]+"
"+ $line1[17]
 
+"
"+ $line1[18]+"
"+ $line1[19]+"
"+ $line1[20]
 
+"
"+ $line1[21]+"
"+ $line1[22]+"
"+ $line1[23]
 
+"
"+ $line1[24]+"
"+ $line1[25]+"
"+ $line1[26]
 
+"
"+ $line1[27]+"
"+ $line1[28]+"
"+ $line1[29]
 
+"
"+ $line1[30]+"
"+ $line1[31]+"
"+ $line1[32])
 
 
 
//-----------------------------TEXT MATTER ENDS---------------------------------------------//
 
 
 
 
 
 
 
-editable false ;
 
separator 
 
-hr 1 
 
-w 440
 
-style "in";
 
button 
 
-align "right"
 
-label " CREDITS "
 
-c credit;
 
 
 
 
 
 
 
scrollLayout;
 
 
 
setParent ..; setParent ..; 
 
////////////////////////////////////////edit the tab ///////////////////////////////////////
 
tabLayout -edit
 
-tabLabel $child15 "Help " 
 
 
 
$tabs;
 
////////////////////////////////////////////////////// /////////////////////////////////////
 
//////////////////////////////// {THE TAB FOURTH} //////////////////////////////////////////
 
////////////////////////////////////{MAYA HELP }//////////////////////////////////////////////
 
 
 
string $child14 = `columnLayout`;
 
 
 
$browser = `webBrowser -width 1280 -height 1024 -url "http://localhost:4449/Maya7.0/en_US/"`;
 
setParent ..; setParent ..; 
 
////////////////////////////////////////edit the tab ///////////////////////////////////////
 
tabLayout -edit
 
-tabLabel $child14 "Maya Help " 
 
$tabs;
 
////////////////////////////////////////////////////// /////////////////////////////////////
 
 
 
////////////////////////////////////////////////////// /////////////////////////////////////
 
 
 
 
 
////////////////////////////////////// {THE WINDOW IS SHOWN} ////////////////////////////////////
 
/////////////////////////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 
showWindow $MPM;
 
 
 
 
 
 
 
}
 
 
 
 
 
/////////////////////////////////////////////////////////////////////////////////////////////////
 
/////////////////////////////////////////////////////////////////////////////////////////////////
 
////////////////
 
// MEL ENDS ////
 
////////////////
 
//////////////////////////////////////////////////////////////////////////////////////////////////
 
//////////////////////////////////////////////////////////////////////////////////////////////////
 
 
 
 
 
 
 
 
 


#277

hai

i have attached a script that can be used to retain the target shapes even if you alter the base shape. Works on poly.

Useage:

select the base mesh and execute the script, it will prompt for a name of the shape (ex. sad, happt, eyb_blink_left…) , once u enter the name, a shape is created, now just sculpt the shape you want. Now when u alter the base mesh the target also changes accordingly.

plz try and let me know if it helped you someway.

NOTE: i have attached as txt file, plz change the extension to .mel,

thanks


#278

Hi guys,

I’m doing a project work & i need a mel script for dual resolution gate like i need both HD 1080 & PAL 768 shown at the same time. Here is an example in this image

With that red mark being a PAL 768 (768x576) standard. Can anyone please tell me the script for this, please.


#279

Hi guys,

I’m doing a project work & i need a mel script for dual resolution gate like i need both HD 1080 & PAL 768 shown at the same time. Here is an example in this image

With that red mark being a PAL 768 (768x576) standard. Can anyone give me script for this please?


#280

Hey all,

 I have started compiling all of my scripts into a single area on my website.  I wanted to post a link here to provide them to everyone who has already been so generous to me.

Some are more useful than others, but I have found them to be big time savers myself.

If you find problems with them or would like other features, please let me know and I will see what I can do.

http://www.swardson.com/melScripts

I am going to be updating the site regularly, so if you want to subscribe to the RSS you will get automatic updates as to when new scripts come available.

Thanks,

Brad