View Full Version : my new question
NeroBlack 09-22-2009, 12:15 PM hi every one ,i have a new question about MEL.
that is a simple & easy command,i want to snap 2 objs with"point "and"orient" constrains.then i am going to delete those two constrain-nodes.so how can i write?
i tried to write like this:
string $pc[]=`pointConstraint -offset 0 0 0 -weight 1`;
string $oc[]=`orientConstraint -offset 0 0 0 -weight 1`;
delete ($pc[0]);
delete ($oc[0]);
but it didn`t run.:cry:
|
|
jaydru
09-22-2009, 01:09 PM
you can use a parent constant to do translate and rotate at the same time
$constraint = `parentConstraint -weight 1`;
delete $constraint;
NeroBlack
09-22-2009, 01:58 PM
you can use a parent constant to do translate and rotate at the same time
$constraint = `parentConstraint -weight 1`;
delete $constraint;
yeah ! jaydru ~how are you !
thank you for helping me these days:beer:
but , why can`t i get it into a string (or an array[])?
jaydru
09-22-2009, 02:11 PM
but , why can`t i get it into a string (or an array[])?
not sure what you mean there :|
NeroBlack
09-22-2009, 02:45 PM
not sure what you mean there :|
i mean ,i don`t know why i wrote string $sel[] =`pointConstraint -offset 0 0 0 -weight 1`;maya can`t read it.
you wrote $constraint = `parentConstraint -weight 1`; is $constraint a string?
jaydru
09-22-2009, 02:49 PM
yeah if you dont specify what variable your using then maya does it automaticly so parentConstraint returns a string[] so
$varA = `parentConstraint` //returns string array so $varA = string array
$size = size($varA) //size returns an interger so $size = int
make sence, check help docs to find out what comands return values are
NeroBlack
09-22-2009, 02:57 PM
yeah if you dont specify what variable your using then maya does it automaticly so parentConstraint returns a string[] so
$varA = `parentConstraint` //returns string array so $varA = string array
$size = size($varA) //size returns an interger so $size = int
make sence, check help docs to find out what comands return values are
yeah,clear.
thank you jaydru,you`re so patiently.:)
i`ll go to bed now ,it`s 23:00 in my area:wavey:
mlefevre
09-22-2009, 04:01 PM
delete `pointConstraint -offset 0 0 0 -weight 1`;
NeroBlack
09-23-2009, 04:07 AM
delete `pointConstraint -offset 0 0 0 -weight 1`;
yeah! so clever!thank u!
CGTalk Moderation
09-23-2009, 04:07 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.