PDA

View Full Version : Automate constrain object to cluster?


Ordibble-Plop
03-22-2006, 04:16 AM
Is there a way or a script that will automate constraining instances of an object to clusters?

What I want to do is create a town of identical buildings (like British terraced housing) and then have a quick and easy way to manipulate the height of the terrain under the buildings, thus affecting how high they are relative to each other. I would like to do it this way to aid in working out the composition of my image.

To do this I thought I would:
-Create a grid large enough for the town
-Instantiate the building model the appropriate number of times
-Constrain each instance to a separate point on the grid using constrain object to cluster
-Use proportional modelling to move points on the grid in the y-axis

I would be needing hundreds of instances and the tedious part of this would be constraining each one separately, so I wondered if the process could be automated?

Or maybe there is an easier way to do this? For it to work:
-Each building would need to be able to move up and down independently of the others
-There should be no deformation of the building mesh at all
-There should be no movement in the x and z axes

Many thanks

ntmonkey
03-23-2006, 04:14 AM
I thought I'd toss up this hack job for anyone that might have the same issue. Feel free to make it better if ya wish to do so. If anyone knows how I can randomly place the objects but not have them ever constrain to the same cluster, that'd be great.


//Jscript mlu
//Select the objects you want to constrain to the grid and run.

for (i = 0; i < Selection.Count; i++){

CreateClusterFromSubComponent("grid.pnt[" + i + "]", "Point" + i);
ApplyCns("ObjectToCluster", Selection(i), "grid.polymsh.cls.Point" + i, null);

}


-Lu

CGTalk Moderation
03-23-2006, 04:14 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.