I've never found a way to do this: Take a selection of objects and snap them them to a new point on the grid without grouping or changing the pivot for each object. In most cases, I'd really rather not disturb the existing grouping just to make a quick change, like expand a hallway or make room for some late change to a map layout. Any ideas?
Replies
This is a bit of a hack, but it does work. Here's the quick breakdown: I'm creating a dummy locator, and then connecting my objects to that locator via a parentConstraint. You can then move the locator and the objects follow. I've written you code for the connecting process and the removal of the constraints. Just follow the code comment instructions below.
A couple caveats: Don't try and move the objects individually while they are constrained to the locator. If you do, and then you move the locator, your individual objects will shift. Second, the locator being created at the origin isn't ideal. I could modify the code so that the creation of the locator occurs at the pivot point of the first object selected. If you find the following code useful, I'd be willing to make that modification.
good luck!
string $selected[] = `ls -sl -long`;
string $selected[] = `ls -sl -long`;
Using the first selecteds pivot as pivot would be a nice touch, thanks!
This code should work even better. This will put the locator at the pivot location of the first selected object.
string $selected[] = `ls -sl -long`;
AND
This is a complete rewrite of the code in my first post for removing the parentConstraints. The previously posted removal code required you to select all the objects that you had originally selected. That's a bit cumbersome since the user will most likely already have the new locator selected.
So instead of that, once you're done moving the objects around via the locator, and with it alone selected, just run the code below and it will remove all parentConstraints on the linked objects and the locator itself. Like they were never even there.
Give this a try. If it works out favorably, I can throw it into some global procs for easier deployment to shelf buttons and downloading.
cheers!