Tip and Tech/Max script 2009/02/12 10:11
(
global std_set_mat_wire
local std_default_mat_name = "Std_Default_mat"
fn std_set_mat_wire = (
obj = for i in selection collect i
if obj.count == 1 then (
if (superclassof obj[1]) == GeometryClass and (classof obj[1]) != BoneGeometry and (classof obj[1]) != Biped_Object and (classof obj[1]) != PF_Source and (classof obj[1]) != Spray and (classof obj[1]) != Snow and (classof obj[1]) != Blizzard and (classof obj[1]) != PArray and (classof obj[1]) != PCloud and (classof obj[1]) != SuperSpray and (classof obj[1]) != ParticleGroup and (classof obj[1]) != mr_Proxy and (classof obj[1]) != dummy and (classof obj[1]) != Targetobject then (
if obj[1].wirecolor != black and obj[1].material == undefined then (
if (sceneMaterials [std_default_mat_name]) == undefined then (
std_set_sceneMaterials = Standardmaterial ()
std_set_sceneMaterials.name = std_default_mat_name
obj[1].material = std_set_sceneMaterials
obj[1].wirecolor = black
)
if (sceneMaterials [std_default_mat_name]) != undefined then (
obj[1].material = sceneMaterials [std_default_mat_name]
obj[1].wirecolor = black
)
)
)
)
)
callbacks.removeScripts #selectionSetChanged
callbacks.addScript #selectionSetChanged "std_set_mat_wire ()" id:#mz_smw
)마야에 익숙해 있던 친구의 부탁으로 만들었던 스크립트 입니다.
기본적으로 오브젝트 생성시 Standardmaterial 머트리얼을 적용합니다.(뷰포트 그레이용) 그리고 와이어컬러를 블랙으로 놓습니다.(와이어 컬러가 블랙이아니며 머트리얼이 없는 경우에만 동작 합니다.)
selectionSetChanged callback 를 이용해서 오브젝트를 선택할때마다 스크립트는 활동(?)합니다.
기본적으로 지오메트리의 오브젝트들만 델수 있게 되어 있습니다..^^
http://studio2k.teamnop.com/tt/trackback/277
std_default_mat.ms





0