------------------------------------------------------------------------------- -- PointParent.ms -- By Sergo Pogosyan (sergo.pogosyan@gmail.com) -- v 1.0 -- Created: 2007-08-21 -- tested using Max 8.0 ------------------------------------------------------------------------------- -- Description: -- This tool helps you create point helper object which will be parent of all selected object. -- Existing hierarchies will not be destroyed, e.g. only objects that are parented to world will -- be linked to the point. -- If whole hierarchy was selected only hierarchy's parent object will be linked to the point. -- If group object was selected only group head object will be linked to the point. ------------------------------------------------------------------------------- -- Usage: -- Select objects then click tool button on the toolbar and create point object as usual. -- Previosly selected objects will be parented to the new point objects. -- You could also define a shorcut to the script instead of tool button ------------------------------------------------------------------------------- -- TO DO list: -- check hierarchy preservation. -- if nothing is selected create standard point helper. -- after creating show window to give point a name. With default "Point##" name in it. ------------------------------------------------------------------------------- -- history -- macroScript ParentPoint category:"Sergo Pogosyan" toolTip:"Create point that will be parent of previously selected objects" buttonText:"Parent Point" Icon:#("sergoIcons",12) ( if selection.count != 0 then ( selectedObjects = selection as array undo "ParentPoint" on ( parentPointArr = startObjectCreation point returnNewNodes:#first parentPointObj = parentPointArr[1] for i=1 to selectedObjects.count do ( if (selectedObjects[i].parent == undefined) and (isGroupMember selectedObjects[i] != true) then ( selectedObjects[i].parent = parentPointObj ) ) ) ) else (MessageBox "Please Select at least one object." title:"ParentPoint") )