Scripts
Bake object transforms
Copy and paste
Emailer
Flush
Implode explode
Instantiate
Make names unique
Poly counter
Print selection
Reset viewport
Selector
Instantiate 2.1
Takes your current selection and make them all instances of a picked object. This is also class independant, and you can for example replace a light with an instance of a sphere.
- Version: 1.0 - Original classic.
- Version: 1.1 - Simpler script and rubber band selector and overwrite options
- Version: 2.1 - Same thing but awesomer
--Author: Ben Bryan --Created: 05/06/07 --Updated: 07/04/11 --Email: ben@benbryan.net --Web: http://www.benbryan.net/ -- | Instantiate | -- -- Takes your current selection and makes them all instances of the picked object. -- It is also class independant (ie. you can replace a light with an instance of a sphere.) --Version: 1.0 - Original classic. --Version: 1.1 - Simpler script and rubber band selector and overwrite options --Version: 2.1 - Same thing but awesomer macroScript Instantiate category:"MaxPack" toolTip:"Instantiate" icon:#("instantiate", 1) ( on isEnabled do ( return selection.count != 0 ) on execute do ( --clearlistener() --real_ins_count = 0 --fake_ins_count = 0 fn ins_filter obj = not obj.isSelected rollout rll_instantiate "Instantiate - options" width:250 ( group "Type" ( radiobuttons copy_type labels:#("Copy", "Instance", "Reference") default:2 columns:3 ) group "Retain on replaced objects" ( checkbox chk_materials "Materials" checked:true checkbox chk_display "Display properties" checked:true checkbox chk_Render "Render properties" checked:true checkbox chk_Modifiers "Modifiers" checked:false enabled:false checkbox chk_Position "Position" checked:true checkbox chk_Rotation "Rotation" checked:true checkbox chk_Scale "Scale" checked:true checkbox chk_Children "Children" checked:true enabled:false checkbox chk_Parent "Parent" checked:true checkbox chk_Name "Name" checked:true checkbox chk_Wirecolour "Wire colour" checked:true ) button btn_replace "Replace objects" fn object_process src trgs = ( del_array = #() for trg in trgs do ( trg_copy = copy trg if copy_type.state == 1 then ( instanceReplace trg src nodes = #(trg, src) InstanceMgr.MakeObjectsUnique &nodes #individual --real_ins_count += 1 ) if copy_type.state == 2 then ( instanceReplace trg src --real_ins_count += 1 ) if not chk_materials.checked then ( trg.material = src.material ) if not chk_display.checked then ( trg.isfrozen= src.isfrozen trg.ishidden= src.ishidden trg.boxmode= src.boxmode ) if not chk_Render.checked then ( trg.renderable = src.renderable ) if chk_Modifiers.checked and copy_type.state == 1 then ( for m in trg_copy.modifiers do ( addModifier trg m ) ) if not chk_Position.checked then ( trg.position.controller = copy src.position.controller ) if not chk_Rotation.checked then ( trg.rotation.controller = copy src.rotation.controller ) if not chk_Scale.checked then ( trg.scale.controller = copy src.scale.controller ) if chk_Children.checked then ( /* new_obj.parent = des_obj.parent new_obj.transform.controller = copy des_obj.transform.controller for c in des_obj.children do ( c.parent = new_obj ) */ ) if not chk_Parent.checked then ( trg.parent = src.parent ) if not chk_Name.checked then ( trg.name = src.name ) if not chk_Wirecolour.checked then ( trg.wirecolor = src.wirecolor ) delete trg_copy ) ) on copy_type changed val do ( if copy_type.state == 1 then chk_Modifiers.enabled = true else chk_Modifiers.enabled = false ) on btn_replace pressed do ( object_process ::src_obj selection --messageBox (real_ins_count as string +" actual instances created\n"+ fake_ins_count as string + " cross-class instances created.") title:"Instantiate" destroyDialog rll_instantiate ) ) src_obj = pickObject message:"Pick source object to instance" rubberBand:selection.center --filter:ins_filter if IsValidNode(src_obj) do ( createDialog rll_instantiate ) ) )