Looking at your code im not so sure you understood what you ended up doing. You really dont want to do the putIconOnJoint_Impl part.
See maya works like this each shape is a child of a transform now the transform is jut a 4*4 matrix what your doing is takeing the shape from 1 matrix and moving it to another. Now since your interested in the difference the natural way would be to:
parent the transform of your control shape to your bone.freeze that trasform in essence bringing it to identity matrix ans making the joints transform the original transforms mother.then parent shape to trasform.delete the source.Now the problem with your code isn't that it dont work, it does howvere it also does have a certain quite nasty side effect, it flushes all your history wich may or may not be an issue. But it also makes maya double bookkeep, with points of the original shape and the points you moved to will be added t array called as tweak wich contains what it is after manual edit. Also you have a very bad habit of listing transforms, wich is bad since joints are transforms too.
so your entire code can be distilled as:
CODE
{
$curves=ls -sl -dag -et "nurbsCurve"
;
$joints=ls -sl -type joint
;
if(size($joints)){
for ($crv in $curves){
$parent=listRelatives -p $crv
;
catchQuiet(parent $parent $joints[0]
);
makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 $parent;
parent -add -shape $crv $joints[0];
delete $parent;
}
}
}
The underlying disadvantage here that you fail to see is that it may actually be easier to place the selectors if you dont do steps 1 or 2, but rather rely on your own brain to sort the local space this way you save time creating the same shape and placing it to multiple joints since the operation itself has a orientation function built in. So the hardness is jut a nother way of thinking about your workflow than i choose to. (your too visually constrained in your task here)
Suppose i want to place the same circle on many joints, then i'd just draw the icon x up maybe offset slightly in x, now my code would simply be:
CODE
{
$curves=ls -sl -dag -et "nurbsCurve"
;
$joints=ls -sl -type joint
;
for ($joint in $joints){
for ($crv in $curves){
parent -add -shape $crv $joint;
}
}
}
so just by thinking of object and placement differentky i goit more effect out of maya and my workflow, and thinking this way around what i said is all you needed to know inorder to get things to work out. You dont even need to worrry about placing the circles individually.
Few secondary comments nodeType should not be used ist a bit unreliable and it quite frankly will never be needed.