david | mel script | Friday, April 18th, 2008

In my last post I wrote about two methods for getting the manipulator handle to change automatically when you select an object. Then, thanks to Brad Clark's post on cgtalk I discovered yet another way (actually the same technique as zooTriggered, but doesnt require the zooToolbox to be installed).

I thought it would be useful to put Brad's whichTool() proc into an easy to use mel script. I've called it djSwitchManipOnSelection.mel to stick with my usual naming, but really the guts of this are Brad's code and a bit from Hamish - thanks guys.

You need to source djSwitchManipOnSelection.mel, probably by adding a line to your userSetup.mel. Then you have a few commands you can use. Here is a basic work flow.

Select some objects. Then in the cmd window type djCreateDefaultToolAttr 0 to flag those objects for worldspace move (substitute 1 for object move, 2 for rotate, 3 for scale). An attribute called defaultTool is added to the objects and specifies the manipulator type, which you can change later if you wish.

djSwitchManipOnSelection 1 activates the manipulator switching scriptJob. Now a change of selection will check for the defaultTool attribute and change manipulator accordingly.

djSwitchManipOnSelection 0 deactivates manipulator switching.

djRemoveDefaultToolAttr removes the defaultTool attribute from selected objects.

These commands will be easier to use if you assign them to shelf buttons or marking menus.

Download djSwitchManipOnSelection.rar here.

1 Comment »

  1. nice work, glad to see it all scripted out:) great updates to the zoo tools as well, and just a really nice site. I had made my own quick select by type script and then found yours for picking joints only in the hiearchy. so thanks for putting your time and effort in to the site its a great help.

    Comment by bclark — April 18, 2008 @ 5:43 pm

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.

Powered by WordPress | Based on a theme by Roy Tanck