View Full Version : How To Access Weighted Node Of Cluster

S. J. Tubbrit
06 June 2007, 02:42 PM
How do I access the Weighted Node of a clustershape in melscript, so that I can replace it with my control ?

I've tried to echo all commands, and see what the script editor is doing, but can't make head nor tail of it.

06 June 2007, 06:22 PM
You can connect your control to $value:

setAttr "skinCluster1.envelope" $value;


S. J. Tubbrit
06 June 2007, 06:59 PM

My control is a Nurbs Object named


So, I've tried something like this : -

string $SpineControl_ClusterName = "Spine_Bottom_Control1";

setAttr "Spine_Bottom_ClusterShape.weightedNode" $SpineControl_ClusterName;

This doesn't work though, any ideas ?


06 June 2007, 08:39 PM
weightedNode is not an attribute.
If you want to manipulate this you have to use the percent command:

percent -v $floatValue cluster1;

S. J. Tubbrit
06 June 2007, 08:45 PM

I don't want to manipulate it's value

In terms of what I'm trying to achieve, I have a cluster on a spline, one of many, I want to replace that cluster with a more meaningful representation that I have created as a nurbs object, for example, this has been called Spine_Bottom_Control1, if I open the clusters attributes and then select it's shape node, under the weighted node, I can replace the text there with my Spine_Bottom_Control1, now I have control of the cluster through my Spine_Bottom_Control1 control, the cluster itself now does nothing if selected, whereas I can do all this manually, none of it is echo'd through the script editor in such a way that I can replicate it through script. I don't know mel script well enough to dig deeper and achieve this manually, so hoping that someone may know how to do this through script ?


S. J. Tubbrit
06 June 2007, 02:28 PM
This is about as much info as I could find on the net : -

'To get rid of the default “C” handle the cluster creates, create a
nurbsSphere and make it the weighted node of the cluster (many text
describe this process, it’s just a matter inputting the .worldMatrix[
0] of your control objects (nurbs sphere) into the .matrix attribute of
your cluster node, and setting the “weighted node” attribute to be the
name of the control object).'

If that helps anyone ?

I've tried the first step of what it says above, but the connection editor tells me it can't connect those two types, more hair pulling ensues..... :(


S. J. Tubbrit
06 June 2007, 02:49 PM
Aha! No worries, it's a hack, but I managed to figure something out ! :)

connectAttr -f Spine_Bottom_Control1.matrix Spine_Bottom_ClusterShape.weightedNode;
setAttr "Spine_Bottom_ClusterCluster.relative" 0;
parent Spine_Bottom_Cluster Spine_Bottom_Control1;
select -cl ;
select -r Spine_Bottom_Cluster ;
setAttr "Spine_Bottom_ClusterShape.visibility" 0;
select -cl ;


CGTalk Moderation
06 June 2007, 02:49 PM
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.