View Full Version : CBdeleteConnection probs & Nurbscurve selection!?

04-25-2003, 07:44 PM
Ho, i have following problem ... i have a Script in Work .. and it has following Command inside ..

CBdeleteConnection ("motionPath_"+$name+"_"+$lauf+".u");

$name and $lauf is an variable that gets declarated some lines above .. but thats not the problem .. the problem is that when i launch maya .. and then launch the script i get always ..

Cannot find procedure "CBdeleteConnection".
Start of trace: (file: C:\Dokumente und Einstellungen\X-Tender.FUCHTEL\Desktop\MEL Scripts\xt_script.mel, line 49).
CBdeleteConnection (file: C:\Dokumente und Einstellungen\X-Tender.FUCHTEL\Desktop\MEL Scripts\xt_script.mel, line 49).
xt_maketread (command window: line 1).

BUT! .. when i delete the connection 1 Time Manualy then the script work (also when i make a new scene ect. ) only ehn i start maya new it cry.

did someone has a hint? ...

Antother question .. how did i can check if i have an nurbscurve inside my selection .. without looking at the name ..

04-25-2003, 07:57 PM
If you source generateChannelMenu.mel in your script it should work. (this is the script that CbdeleteConnection is defined in).

As for the nurbs curve...

you will want to find the shape node and then you can do something like:

if(`nodeType $shapeNode` == "nurbsCurve")
// do stuff


04-25-2003, 08:06 PM
tahnx for the first hint .. it works .. but the second one i dont understand .. ;/ ... e.g. if i select a nurbscurve or a cycle and a polygonobject .. then i want to put all nurbscurve / cycles ect in one array ..

04-25-2003, 09:39 PM
I'm not sure I understand what you want to do...
If you have a selection and you want to go through it and put
all of the nurbsCurve into an array, you can do that like this:

string $selection[]=`ls -sl`;
string $myArray[];
// do we have a transform or the shape node?
if(`nodeType $selection[$i]` == "transform")
string $shapeNode[]=`listRelatives -s $selection[$i]`;
if(`nodeType $shapeNode[0]` == "nurbsCurve")
else if (`nodeType $selection[$i]` == "nurbsCurve")

This is not tested, but it should be fairly close.


04-25-2003, 10:03 PM
k, i got it .. i used

$curve = `listTransforms "-type nurbsCurve"`;
$selcurve = `ls -sl $curve`;

now an another question =) .. how i can get the name of the motionpath of an selected curve? ...

/e: k. i got it .. i used

$motionPath = `listConnections -t motionPath`;


CGTalk Moderation
01-15-2006, 12:00 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.