We all know about devkit example geometrySurfaceConstraint. This node plugin can be used as below with a MEL script, to constrain one cylinder to a polyplane. the MEL part is creating the Polyplane and the Cylinder and then selecting both geometry and then constrain them. I want to do the same thing in c++ API. is it possible? Normally I know how to connect nodes inside API. But for this particular case, specially for constrain I am very confused.
I want to constrain a sphere with a curve and do not want to write it in MEL. Can I constrain a sphere with a curve within c++ API code? Because first I need to create the curve and the sphere automated and then I will need to pass the sphere and the curve into the constrain node within same API. selecting the objects and passing them through the "geometrySurfaceConstraint" Node, need to be done within same API. Is it possible? Please give me some clue, will be a big help. I am working in Maya 2011 and 2012.
Hope I could explain my question. If you find my question is confusing then please ask me back, I will explain again. Many many thanks!
file -f -new;
polyPlane -w 1 -h 1 -sx 10 -sy 10 -ax 0 1 0 -cuv 2 -ch 1;
scale -r 15 15 15;
polyCylinder -r 1 -h 2 -sx 20 -sy 1 -sz 1 -ax 0 1 0 -rcp 0 -cuv 3 -ch 1;
select -cl;
select -r pPlane1 pCylinder1;
geometrySurfaceConstraint -weight 1;