Skip to content

Instantly share code, notes, and snippets.

@Hoikohroh
Created December 12, 2014 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hoikohroh/8a804c698a9a1da20aa8 to your computer and use it in GitHub Desktop.
Save Hoikohroh/8a804c698a9a1da20aa8 to your computer and use it in GitHub Desktop.
Maxscript:MrAreaLightGuid
/*
MrAreaLightGuid_v20131117
スクリプト概要
・MrAreaLightのライトエリアを表示するシェイプを作成
*/
(
Fn Fn_Expression obj Name Target = (
obj.controller = Float_Expression()
obj.controller.AddScalarTarget Name Target
obj.controller.SetExpression Name
)
Temp = selection as array
if Temp.count == 1 and classof Temp[1] == miAreaLight then
(
Mr_Light = Temp[1]
case Mr_Light.Area_Type of
(
1:(
Mr_Area = (Rectangle name:"miAreaPlane"steps:0)
Mr_Area.transform = Mr_Light.transform
Mr_Area.parent = Mr_Light
Fn_Expression Mr_Area.baseobject[#length] "length" Mr_Light.baseobject[#Rectangle_Height]
Fn_Expression Mr_Area.baseobject[#width] "width" Mr_Light.baseobject[#Rectangle_Width]
)
2:(
Mr_Area = (circle name:"miAreaCircle" steps:3)
Mr_Area.transform = Mr_Light.transform
Mr_Area.parent = Mr_Light
Fn_Expression Mr_Area.baseobject[#radius] "Radius" Mr_Light.baseobject[#disc_Radius]
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment