View Full Version : creating PFXToon node using MEL creates unknown1 node any help
sanfx
03-18-2009, 02:45 AM
Hi i am trying to create pfx toon node like this
createNode PfxToon;
but everytime i create using this method i get a node name unknown1..
so can anyone tell me how can i create pfxtoon node and give it a name.. at creation time ?
filmgrain
03-18-2009, 04:06 AM
Mel is case sensitive. It's not PfxToon but pfxtoon.
sanfx
03-18-2009, 10:30 AM
yea it is but doesnt get me the right result
i am talking about this node http://download.autodesk.com/us/maya/2009help/Nodes/pfxToon.html
but if i do it this way createNode pfxToon; i get an node with nothing in it...
sunder
03-18-2009, 02:42 PM
Actually this needs to be applied to an object. Be sure to have one selected when you run the script. For more details and techniques on outlines, check out our dedicated Maya Toon training product. Enjoy :)
sanfx
03-18-2009, 02:58 PM
yea you are right sunder, i got it and now i was trying to accomplish this with it.
setAttr ($nodeName+".creaseColor -type double3 1 1 1");
// Error: No object matches name: .creaseColor -type double3 1 1 1 //
sunder
03-18-2009, 03:01 PM
I've got a feeling you want your line of code to look like this -
setAttr ($nodeName+".creaseColor") -type double3 1 1 1;
sanfx
03-18-2009, 03:31 PM
thanks man, did u made Python tutorial. ?
sunder
03-18-2009, 03:54 PM
I was the instructor for the Python Scripting in Maya training product. Some assets and animation were provided by my team members.
sanfx
03-18-2009, 07:37 PM
i went over the python tutorials that had one used to make gear..
sanfx
03-19-2009, 03:53 AM
i got it working now but i don't understand when i create shape node with $myName why the transformation node has the name like pfxToon1 pfxToon2....
sunder
03-19-2009, 09:04 AM
What does your code look like? The proper command should look like this
string $myName = "Custom";
string $nodeName = `createNode pfxToon -name $myName`;
Edit: Scratch that. I see what you're saying. Try something like this. Here you rename the transform to overcome the naming issue
string $myShape = "customShape";
string $myTransform = "custom";
string $nodeName = `createNode pfxToon -name $myShape`;
rename `listTransforms $nodeName` $myTransform;
sanfx
03-19-2009, 12:20 PM
ok, in code
rename `listTransforms $nodeName` $myTransform; you list the trasform node of the $nodeName and the used rename command to rename its transform to the string stored in $myTransform variable.
gotcha..
sanfx
03-20-2009, 03:27 PM
string $sel[]=`ls -selection`;
//string $nodeName;
int $counter;
$counter=$counter+1;
string $nodeName = "toonShape"+$counter;
print $nodeName;
print "\n";
string $nodeName =`createNode pfxToon -n $nodeName`;
print $nodeName;
string $toonTransform = "toon";
rename `listTransforms $nodeName` $toonTransform;
setAttr ($nodeName +".creaseColor") -type double3 1 1 1;
if i append any name of obj in selection or counter like i did above i get error.
// Error: No object matches name: toonShape1.creaseColor //
even though the $nodeName stores the value as toonShape1 the shape node created is toonshape actually..
i dont understand why i am getting this error