PDA

View Full Version : simple problem which is driving me crazy "no object matches name: delete"


Binxx
11-20-2012, 04:50 AM
global proc cmPrimCreate()
{
string $name = `textField -q -tx "myField"`;
int $radio = `radioButtonGrp -q -sl "myRadios"`;
int $check = `checkBox -q -v "myCheck"`;
string $names[];
string $type;
if ($radio == 3)
{
$type = "Cone";
$names = `cone -n $name -p 0 0 0 -ax 0 1 0 -sww 0 -esw 360 -r 1 -hr 2 -d 3 -s 8 -nsp 1 -ch 1`;
}
else if ($radio == 2)
{
$type = "Cube";
$names = `polyCube -n $name -w 2 -h 2 -d 2 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1`;
}
else
{
$type = "Sphere";
$names = `sphere -n $name -p 0 0 0 -ax 0 1 0 -ssw 0 -esw 360 -r 1 -d 3 -s 8 -nsp 4 -ch 1`;
}

vector $vals;
if ($check == 1)
{
$vals = `rand <<-10.0,-10.0,-10.0>> <<10.0, 10.0, 10.0>>`;
$vals = <<`floor(($vals.x) + .5)`, `floor(($vals.y) + .5)`, `floor(($vals.z) + .5)`>>;
setAttr($names[0] + ".t") ($vals.x) ($vals.y) ($vals.z);
}
else
{
$vals = <<0.0, 0.0, 0.0>>;
setAttr ($names[0] + ".t") ($vals.x) ($vals.y) ($vals.z);
}
select -cl
delete -ch $names[0];
makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 $names[0];
string $print = ("//Result: " + $type + " named " + $names[0] + " created at " + $vals + "\n");
print $print;
text -e -l $print "myText";
}

string $winName = "myWindow";
string $fieldName = "myField";
string $radioName = "myRadios";
string $checkName = "myCheck";
string $textName = "myText";
if (`window -ex $winName`) deleteUI $winName;
window -t "Primitive Creator" $winName;
columnLayout;
text -l "1. Type a name for your primitive:";
textField -w 150 -tx "Name" $fieldName;
text -l "2. Choose a primitive type:";
radioButtonGrp -sl 1 -nrb 3 -l "Types:" -cal 1 "left"
-cw4 50 70 70 70 -la3 "Sphere" "Cube" "Cone" $radioName;
text -l "3. Check to randomly move primitive:";
checkBox -l "Move" -v 0 $checkName;
text -l "4. Click to create primitive:";
button -w 100 -l "Create" -c "cmPrimCreate";
text -l " " $textName;

window -e -wh 300 200 $winName;
showWindow $winName;



currently having problems with this line.

delete -ch $names[0];
which is suppose to delete the history of the created object, however it decides to search for delete for some odd reason... Really confused on whats going on... or if it will persist to the next line which freezes transformations. Help would be greatly apperciated

djx
11-20-2012, 06:14 AM
Missing semi-colon on the line before it.
Don't you hate that? :D

David

Binxx
11-20-2012, 07:57 AM
head on table ... LOL thanks!

CGTalk Moderation
11-20-2012, 07:57 AM
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.