View Full Version : Query clusters and CVs
Shredder 02-01-2005, 06:43 PM Does anyone know how to find out what cluster is deforming a curve?
I have some splines with just one cluster per CV and I want to query the CV to find out what cluster is deforming it.
OR if I could find out the reverse.. select the cluster and find out what CV is being deformed would work also.
|
|
brubin
02-01-2005, 07:10 PM
assuming your cluster is called "cluster1"
find out what set it is connected to:
listConnections -type objectSet cluster1;
then query the member of the set:
sets -q cluster1Set ;
// Result: curve1.cv[2] //
// ...which is the CV i clustered as an example!
check the docs of "listConnections", "cluster" and "sets" for further information on the topic.
HIH
s.
Shredder
02-03-2005, 05:31 PM
That was totally helpfull! thanks!!
here is the first one I came up with
global proc string[] cvfromcluster()
{
string $selClust[] = `ls -sl`;
string $cvAsoc[], $clusterQy[], $scC;
for ($sc in $selClust)
{
$scC = ($sc+"Cluster");
$clusterQy = `listConnections -type objectSet $scC`;
$cvAsoc = `sets -q $clusterQy` ;
}
return $cvAsoc;
}
Now to get it switched around and get a cluster from a CV!!
Shredder
02-03-2005, 08:56 PM
check the docs of "listConnections", "cluster" and "sets" for further information on the topic.
HIH
s.
I have been reading thru those in the docs and cant seem to get it to work with a CV
listConnections curve1.cv[2]
that returns nothing. listSets returns nothing.. I cant find anything that will tell you what set a CV is connected to..
Shredder
02-03-2005, 11:20 PM
Well here is what I came up with!!
Seems a bit much just to find out what cluster is deforming a CV.
ir could probably be cleaned up a lot.. but it works for now :D
global proc string[] clusterfromcv( string $cvIn )
{
string $clusterTo, $clustAsoc[], $clustTransAsoc[], $wsCmd, $whatSet[], $cAe, $cTAe;
$whatSet = `listSets -object ($cvIn)`;
if (`gmatch $whatSet[0] "cluster*"`)
{$clusterTo = $whatSet[0];}
else if (`gmatch $whatSet[1] "cluster*"`)
{$clusterTo = $whatSet[1];}
$clustAsoc = `listConnections -type cluster ($clusterTo)`;
$clustTransAsoc = `listConnections -type transform ($clustAsoc[0])`;
return $clustTransAsoc;
};
CGTalk Moderation
02-04-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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.