NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

global proc createFKControls()
{



if (`window -exists makeFKWindow`)
deleteUI makeFKWindow;

string $text;

$sel = `ls -sl`;
if (`size ($sel)` >= 1)

$text = $sel[0];

window -title "FK YARATICI" makeFKWindow;
columnLayout -adj true makeFKColumn ;



floatSliderGrp
-label "Kontrol Buyuklugu"
-field true
-cw 1 80
-cw 2 40
-cw 3 150
-minValue .01
-maxValue 50.0
-fieldMinValue .1
-fieldMaxValue 50
-value 2
KontrolBuyuklugu;

colorIndexSliderGrp
-cw 1 80
-cw 2 40
-label "Kontrol Rengi"
-min 0
-max 31
-value 5
controlColor;

textFieldGrp
-cw 1 80
-cw 2 200
-label "Kontrol Suffix"
-text ("_CTRL")
controlName;


button
-label "KONTROL YARAT"
-command "makeFKTR"
createFKButton;

$originalSelection = `ls -sl`;


select -r $originalSelection;


showWindow makeFKWindow;
window -edit -wh 310 90 makeFKWindow;

if (`size($sel)` >= 1)
textFieldGrp -e -text "_CTRL" -editable true controlName;

}
createFKControls;

global proc makeFKTR ()
{
// sets up FK controls to a joint chain of any size
// usage: makeFKTRS (requires makeFK UI)

// capturing variables

$selection = `ls -sl`;
int $size = `size ($selection)`;

if ($size == 0)
error "Bir ya da daha fazla obje seçiniz";

float $KontrolBuyuklugu = `floatSliderGrp -q -v KontrolBuyuklugu`;
$color = `colorIndexSliderGrp -q -v controlColor`;
$color = $color - 1;

string $controlSuff;
$controlSuff = `textFieldGrp -q -text controlName`;

for ($i=0; $i<$size; $i++)
{
if (`objExists ($selection[0]+$controlSuff)` == 1)
error "Please enter a unique suffix.";
}

if ($controlSuff == "")
error "Please enter a suffix.";


for ($i=0; $i<$size; $i++)
{

// creating gyro controller object
$circle1 =`circle -nr 1 0 0 -ch 0`;
$circleShape1 = `pickWalk -d down`;
$circle2 =`circle -nr 0 1 0 -ch 0`;
$circleShape2 = `pickWalk -d down`;
$circle3 =`circle -nr 0 0 1 -ch 0`;
$circleShape3 = `pickWalk -d down`;

setAttr ($circleShape1[0] + ".overrideEnabled") 1;
setAttr ($circleShape2[0] + ".overrideEnabled") 1;
setAttr ($circleShape3[0] + ".overrideEnabled") 1;

setAttr ($circleShape1[0] + ".overrideColor") $color ;
setAttr ($circleShape2[0] + ".overrideColor") $color ;
setAttr ($circleShape3[0] + ".overrideColor") $color ;

parent -shape -r $circleShape3 $circleShape2 $circle1[0];
delete $circle2[0];
delete $circle3[0];
rename $circle1[0] ($selection[$i]+ $controlSuff);
select ($selection[$i]+ $controlSuff);
scale -r ($KontrolBuyuklugu *.25) ($KontrolBuyuklugu *.25) ($KontrolBuyuklugu *.25);
makeIdentity -apply true -t 1 -r 1 -s 1 -n 0;

// creating offset node
group -em -n ($selection[$i]+"_offset");
$tempConstraint = `orientConstraint $selection[$i] ($selection[$i]+"_offset")`;
delete $tempConstraint;
$tempConstraint = `pointConstraint $selection[$i] ($selection[$i]+"_offset")`;
delete $tempConstraint;

parent ($selection[$i]+ $controlSuff) ($selection[$i]+"_offset");

// parenting all subsequent controls to the appropriate parent control
if ($i>=1)
parent ($selection[$i]+"_offset") ($selection[$i-1]+$controlSuff);

// setting attributes to zero
setAttr ($selection[$i]+ $controlSuff+".tx") 0;
setAttr ($selection[$i]+ $controlSuff+".ty") 0;
setAttr ($selection[$i]+ $controlSuff+".tz") 0;

setAttr ($selection[$i]+ $controlSuff+".rx") 0;
setAttr ($selection[$i]+ $controlSuff+".ry") 0;
setAttr ($selection[$i]+ $controlSuff+".rz") 0;

// connecting FK controls directly to joint rotations
parentConstraint -mo ($selection[$i]+ $controlSuff) ($selection[$i]) ;


}


// constraining control hierarchy to parent joint (if it exists)

// parent check
string $selectionParent = "noParent";

for ($i=0;$i<$size;$i++)
{
$parent = `listRelatives -parent $selection[$i]`;
if (`size($parent)` > 0)
{
string $parentCheck = $parent[0];
$check = stringArrayContains($parentCheck, $selection);
if ($check == 0)
$selectionParent = $parentCheck;
}

}

if ($selectionParent != "noParent")
parentConstraint -mo $selectionParent ($selection[0]+"_offset");

}





     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.