//---Formation Light--- //---Machinery Contents--- //---Create by Praying Spider--- //---Release 2008/05/03---- //---Optimization Fales---- //ライト配置 global proc makeFormationlight() { float $defINT = 0.1; string $a[]; string $b; string $selFormType; int $i; float $defINT1,$defINT2,$defINT3,$defINT4; float $lowLightTY,$midLightTY,$highLightTY; int $lowLightSc,$midLightSc,$highLightSc; float $lowlocTY,$midlocTY,$highlocTY; //既存のライトグループが存在するか確認 if(`objExists "Formation_Light_GP"`) { delete "Formation_Light_GP"; } //エディターウィンドウを調べ存在した場合、指定フォーメーションパラメータ取得 if(`window -q -ex formationLightEditer`) { $selFormType = `radioCollection -q -select LightEnvMenuSel`; //parameterType(フォーメーション毎のライト自身のパラメータ) switch($selFormType) { case "LightEnvCav": $defINT1 = 0.0; $defINT2 = 0.1; $defINT3 = 0.2; $defINT4 = 0.1; $lowLightTY = -70; $midLightTY = 0.0; $highLightTY = 65.0; $lowLightSc = 20; $midLightSc = 20; $highLightSc = 20; $lowlocTY = 5.0; $midlocTY = 5.0; $highlocTY = 5.0; break; case "LightEnvFin": $defINT1 = 0.3; $defINT2 = 0.2; $defINT3 = 0.2; $defINT4 = 0.1; $lowLightTY = 23.0; $midLightTY = 67.5; $highLightTY = 90.0; $lowLightSc = 18; $midLightSc = 19; $highLightSc = 22; $lowlocTY = 5.0; $midlocTY = 5.0; $highlocTY = 5.0; break; case "LightEnvRin": $defINT1 = 0.2; $defINT2 = 0.1; $defINT3 = 0.1; $defINT4 = 0.1; $lowLightTY = -50.0; $midLightTY = 26.0; $highLightTY = 89.0; $lowLightSc = 23; $midLightSc = 25; $highLightSc = 27; $lowlocTY = 5.0; $midlocTY = -1.2; $highlocTY = -1.2; break; case "LightEnvDef": $defINT1 = 0.1; $defINT2 = 0.1; $defINT3 = 0.1; $defINT4 = 0.1; $lowLightTY = 5.0; $midLightTY = 45.0; $highLightTY = 65.0; $lowLightSc = 20; $midLightSc = 20; $highLightSc = 20; $lowlocTY = 5.0; $midlocTY = 5.0; $highlocTY = 5.0; break; } } //存在しなかった場合デフォルトパラメータ適用 else { $defINT1 = 0.1; $defINT2 = 0.1; $defINT3 = 0.1; $defINT4 = 0.1; $lowLightTY = 5.0; $midLightTY = 45.0; $highLightTY = 65.0; $lowLightSc = 20; $midLightSc = 20; $highLightSc = 20; $lowlocTY = 5.0; $midlocTY = 5.0; $highlocTY = 5.0; } //構成オブジェ作成 //コンストレインロケーター for($i = 1; $i < 4; $i++ ) { spaceLocator -position 0 0 0 ; $a = `ls -sl`; $b = "Light_Locator" + $i; rename $a $b; move 0 5 0 $b; } //低階層ライト for($i = 1; $i < 11; $i++ ) { CreateAreaLight; $a = `ls -sl`; $b = "Light_Low" + $i; rename $a $b; scale -relative $lowLightSc $lowLightSc $lowLightSc; move -r 0 5 75; select -r Light_Locator3 ; select -tgl $b ; aimConstraint -mo -weight 1 -aimVector 1 0 0 -upVector 0 1 0 -worldUpType "vector" -worldUpVector 0 1 0; } //中階層ライト for($i = 11; $i < 17; $i++ ) { CreateAreaLight; $a = `ls -sl`; $b = "Light_Midle" + $i; rename $a $b; scale -relative $midLightSc $midLightSc $midLightSc; move -r 0 5 60; select -r Light_Locator2 ; select -tgl $b; aimConstraint -mo -weight 1 -aimVector 1 0 0 -upVector 0 1 0 -worldUpType "vector" -worldUpVector 0 1 0; } //低階層のライト配置 select -r Light_Low1 ; move 0 $lowLightTY 75; select -r Light_Low2 ; move -44.084 $lowLightTY 60.676; rotate 0 -36 0; select -r Light_Low3 ; move -71.329 $lowLightTY 23.176; rotate 0 -72 0; select -r Light_Low4 ; move -71.329 $lowLightTY -23.176; rotate 0 -108 0; select -r Light_Low5 ; move -44.084 $lowLightTY -60.676; rotate 0 -144 0; select -r Light_Low6 ; move 0 $lowLightTY -75; rotate 0 -180 0; select -r Light_Low7 ; move 44.084 $lowLightTY -60.676; rotate 0 144 0; select -r Light_Low8 ; move 71.329 $lowLightTY -23.176; rotate 0 108 0; select -r Light_Low9 ; move 71.329 $lowLightTY 23.176; rotate 0 72 0; select -r Light_Low10 ; move 44.084 $lowLightTY 60.676; rotate 0 36 0; //中階層のライト配置 select -r Light_Midle11 ; move 0 $midLightTY 60; select -r Light_Midle12 ; move -51.962 $midLightTY 30; rotate 0 -60 0; select -r Light_Midle13 ; move -51.962 $midLightTY -30; rotate 0 -120 0; select -r Light_Midle14 ; move 0 $midLightTY -60; rotate 0 -180 0; select -r Light_Midle15 ; move 51.962 $midLightTY -30; rotate 0 -240 0; select -r Light_Midle16 ; move 51.962 $midLightTY 30; rotate 0 -300 0; //上階層のライト配置 CreateAreaLight; string $LightCol[0] = `ls -sl`; rename $LightCol[0] "Light_High17"; scale -relative $highLightSc $highLightSc $highLightSc; move -r 0 $highLightTY 0; rotate -r -os -90 0 0; select -r Light_Locator1 ; select -tgl Light_High17 ; aimConstraint -mo -weight 1 -aimVector 1 0 0 -upVector 0 1 0 -worldUpType "vector" -worldUpVector 0 1 0; select -r Light_High17 ; //アンビエントライト配置 defaultAmbientLight(1, 0.45, 1,1,1, "0", 0,0,0, "1"); string $LightCol[0] = `ls -sl`; rename $LightCol[0] "Light_Ambient"; move -r 0 -60 0 ; //ライトの基本設定を指定 //アンビエントの強さを決める setAttr Light_AmbientShape.intensity $defINT4; //高階層のライトの強さを決める setAttr Light_HighShape17.intensity $defINT1; //中階層のライトの強さを決める setAttr Light_MidleShape11.intensity $defINT2; setAttr Light_MidleShape12.intensity $defINT2; setAttr Light_MidleShape13.intensity $defINT2; setAttr Light_MidleShape14.intensity $defINT2; setAttr Light_MidleShape15.intensity $defINT2; setAttr Light_MidleShape16.intensity $defINT2; //低階層のライトの強さを決める setAttr Light_LowShape1.intensity $defINT3; setAttr Light_LowShape2.intensity $defINT3; setAttr Light_LowShape3.intensity $defINT3; setAttr Light_LowShape4.intensity $defINT3; setAttr Light_LowShape5.intensity $defINT3; setAttr Light_LowShape6.intensity $defINT3; setAttr Light_LowShape7.intensity $defINT3; setAttr Light_LowShape8.intensity $defINT3; setAttr Light_LowShape9.intensity $defINT3; setAttr Light_LowShape10.intensity $defINT3; select -r Light_Locator3 ; rename "Light_Locator3" "Lowlight"; select -r Light_Locator2 ; rename "Light_Locator2" "Midlelight"; select -r Light_Locator1 ; rename "Light_Locator1" "Highlight"; //グループ化 select -r Light_Ambient Light_High17 Light_Midle16 Light_Midle15 Light_Midle14 Light_Midle13 Light_Midle12 Light_Midle11 Light_Low10 Light_Low9 Light_Low8 Light_Low7 Light_Low6 Light_Low5 Light_Low4 Light_Low3 Light_Low2 Light_Low1 Lowlight Midlelight Highlight ; group -name "Formation_Light_GP" ; select -cl ; } makeFormationlight(); //////////////////////////////////////////////////////////////////////////////// //エディターウィンドウ(フォーメーションを編集するGUI作成) global proc makeControlWindow() { if(`window -q -ex formationLightEditer`) { deleteUI formationLightEditer; } window -rtf true -t "FORMATION EDITER"formationLightEditer; //menuSizeParam int $hensuu1 = 32; int $hensuu2 = 32; int $hensuu3 = 32; int $hensuu4 = 32; int $wide1 = 65; int $wide2 = 35; int $wide3 = 110; int $wide4 = 20; float $defradius1; columnLayout LightParamSet; //ライトの輝度パラメータ text -w 260 -label "LIGHT INTENSITY" -align "left" -font "smallBoldLabelFont" -backgroundColor 0.6 0.6 0.7; separator -width 263 -height 1; attrFieldSliderGrp -label "Highlight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min 0.00 -max 5.00 -at Light_HighShape17.intensity ; attrFieldSliderGrp -label "Midlelight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min 0.00 -max 5.00 -at Light_MidleShape11.intensity -cc "MidlelightsetINT()" ; attrFieldSliderGrp -label "Lowlight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min 0.00 -max 5.00 -at Light_LowShape1.intensity -cc "LowlightsetINT()" ; attrFieldSliderGrp -label "Ambientlight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min 0.00 -max 5.00 -at Light_AmbientShape.intensity ; separator -width 263 -height 1; //ライトの半径パラメータ text -w 260 -label "RADIUS FORMATION" -align "left" -font "smallBoldLabelFont" -backgroundColor 0.6 0.6 0.7; separator -width 263 -height 1; floatSliderGrp -label "Midlelight" -cw3 $wide1 $wide2 $wide3 -pre 1 -step 0.1 -min 0.5 -max 1.5 -value 1.0 -adj 3 -field true -cc "MidleRadiusVec()" radius1; floatSliderGrp -label "Lowlight" -cw3 $wide1 $wide2 $wide3 -pre 1 -step 0.1 -min 0.5 -max 1.5 -value 1.0 -adj 3 -field true -cc "LowRadiusVec()" radius2; separator -width 263 -height 1; //ライトの高度パラメータ text -w 260 -label "HEIGHT FORMATION" -align "left" -font "smallBoldLabelFont" -backgroundColor 0.6 0.6 0.7; separator -width 263 -height 1; attrFieldSliderGrp -label "Highlight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min 20.00 -max 150.00 -at Light_High17.ty ; attrFieldSliderGrp -label "Midlelight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min 0.00 -max 95.0 -at Light_Midle11.ty -cc "MidlelightsetTY()"; attrFieldSliderGrp -label "Lowlight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min -70.0 -max 30.0 -at Light_Low1.ty -cc "LowlightsetTY()"; attrFieldSliderGrp -label "Ambientlight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min -100.00 -max 30.00 -at Light_Ambient.ty ; separator -width 263 -height 1; //ライトのスケールパラメータ text -w 260 -label "LIGHT SCALE" -align "left" -font "smallBoldLabelFont" -backgroundColor 0.6 0.6 0.7; separator -width 263 -height 1; attrFieldSliderGrp -label "Highlight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min 1.00 -max 70.00 -at Light_High17.sx -cc "HighlightsetSX()"; attrFieldSliderGrp -label "Midlelight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min 1.00 -max 60.00 -at Light_Midle11.sx -cc "MidlelightsetSX()" ; attrFieldSliderGrp -label "Lowlight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min 1.00 -max 60.00 -at Light_Low1.sx -cc "LowlightsetSX()"; separator -width 263 -height 1; //ライトの照射角パラメータ text -w 260 -label "VERTICAL CONSTRAINT LOCATOR" -align "left" -font "smallBoldLabelFont" -backgroundColor 0.6 0.6 0.7; separator -width 263 -height 1; attrFieldSliderGrp -label "Highlight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min -100.00 -max 100.00 -at Highlight.ty ; attrFieldSliderGrp -label "Midlelight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min -100.00 -max 100.00 -at Midlelight.ty ; attrFieldSliderGrp -label "Lowlight" -cw4 $wide1 $wide2 $wide3 $wide4 -pre 1 -step 0.1 -min -100.00 -max 100.00 -at Lowlight.ty ; separator -width 263 -height 1; //オートフォーメーションパターン選択メニュー text -w 260 -label "Auto Formation" -align "left" -font "smallBoldLabelFont" -backgroundColor 0.6 0.6 0.7; separator -width 263 -height 1; rowLayout -numberOfColumns 4 -columnWidth4 60 60 60 60 LightEnvMenu; radioCollection LightEnvMenuSel; radioButton -label "Default" -select LightEnvDef; radioButton -label "Fine" LightEnvFin; radioButton -label "Rain" LightEnvRin; radioButton -label "Cave" LightEnvCav; setParent..; button -w 240 -h 20 -label "Set Formation" -c ("makeFormationlight();autoLightFormation();makeControlWindow()") ; //オプション機能メニュー separator -width 263 -height 4 -st "double"; button -w 240 -h 20 -label "Test Bake" -c ("polyGeoSampler -ids -sf 1 -su -cdo -colorBlend overwrite -alphaBlend overwrite"); button -w 240 -h 20 -label "Create Light" -c ("makeFormationlight() ;autoLightFormation();makeControlWindow()") ; button -w 240 -h 20 -label "Delete Light" -c ("delLightGP()") ; setParent..; showWindow formationLightEditer; window -e -wh 246 585 formationLightEditer; } makeControlWindow(); //////////////////////////////////////////////////////////////////////////////// //オートフォーメーションパターン用の半径設定パラメータ global proc autoLightFormation() { string $selFormType; float $radius1,$radius2; vector $vec1,$vec2,$vec3,$vec4,$vec5,$vec6,$vec7,$vec8,$vec9,$vec10, $vec11,$vec12,$vec13,$vec14,$vec15,$vec16; vector $vec1Txz,$vec2Txz,$vec3Txz,$vec4Txz,$vec5Txz,$vec6Txz,$vec7Txz, $vec8Txz,$vec9Txz,$vec10Txz,$vec11Txz,$vec12Txz,$vec13Txz,$vec14Txz,$vec15Txz,$vec16Txz; //選択されたパラメータタイプを確認 $selFormType = `radioCollection -q -select LightEnvMenuSel`; //ライトの現在地を取得 $vec1 = `getAttr Light_Low1.translate`; $vec2 = `getAttr Light_Low2.translate`; $vec3 = `getAttr Light_Low3.translate`; $vec4 = `getAttr Light_Low4.translate`; $vec5 = `getAttr Light_Low5.translate`; $vec6 = `getAttr Light_Low6.translate`; $vec7 = `getAttr Light_Low7.translate`; $vec8 = `getAttr Light_Low8.translate`; $vec9 = `getAttr Light_Low9.translate`; $vec10 = `getAttr Light_Low10.translate`; $vec11 = `getAttr Light_Midle11.translate`; $vec12 = `getAttr Light_Midle12.translate`; $vec13 = `getAttr Light_Midle13.translate`; $vec14 = `getAttr Light_Midle14.translate`; $vec15 = `getAttr Light_Midle15.translate`; $vec16 = `getAttr Light_Midle16.translate`; //エディターで選択されているフォーメーションパターンを確認 //フォーメーションによって指定半径値を設定 //$radius1(中階層半径)$radius2(低階層半径) switch($selFormType) { case "LightEnvDef": $radius1 = 1.0; $radius2 = 1.0; break; case "LightEnvCav": $radius1 = 1.4; $radius2 = 1.0; break; case "LightEnvFin": $radius1 = 1.1; $radius2 = 1.2; break; case "LightEnvRin": $radius1 = 1.3; $radius2 = 1.3; break; } //半径のフォーメーション設定 $vec1Txz = $vec1 * $radius2; $vec2Txz = $vec2 * $radius2; $vec3Txz = $vec3 * $radius2; $vec4Txz = $vec4 * $radius2; $vec5Txz = $vec5 * $radius2; $vec6Txz = $vec6 * $radius2; $vec7Txz = $vec7 * $radius2; $vec8Txz = $vec8 * $radius2; $vec9Txz = $vec9 * $radius2; $vec10Txz = $vec10 * $radius2; $vec11Txz = $vec11 * $radius1; $vec12Txz = $vec12 * $radius1; $vec13Txz = $vec13 * $radius1; $vec14Txz = $vec14 * $radius1; $vec15Txz = $vec15 * $radius1; $vec16Txz = $vec16 * $radius1; setAttr Light_Low1.tx ($vec1Txz.x); setAttr Light_Low1.tz ($vec1Txz.z); setAttr Light_Low2.tx ($vec2Txz.x); setAttr Light_Low2.tz ($vec2Txz.z); setAttr Light_Low3.tx ($vec3Txz.x); setAttr Light_Low3.tz ($vec3Txz.z); setAttr Light_Low4.tx ($vec4Txz.x); setAttr Light_Low4.tz ($vec4Txz.z); setAttr Light_Low5.tx ($vec5Txz.x); setAttr Light_Low5.tz ($vec5Txz.z); setAttr Light_Low6.tx ($vec6Txz.x); setAttr Light_Low6.tz ($vec6Txz.z); setAttr Light_Low7.tx ($vec7Txz.x); setAttr Light_Low7.tz ($vec7Txz.z); setAttr Light_Low8.tx ($vec8Txz.x); setAttr Light_Low8.tz ($vec8Txz.z); setAttr Light_Low9.tx ($vec9Txz.x); setAttr Light_Low9.tz ($vec9Txz.z); setAttr Light_Low10.tx ($vec10Txz.x); setAttr Light_Low10.tz ($vec10Txz.z); setAttr Light_Midle11.tx ($vec11Txz.x); setAttr Light_Midle11.tz ($vec11Txz.z); setAttr Light_Midle12.tx ($vec12Txz.x); setAttr Light_Midle12.tz ($vec12Txz.z); setAttr Light_Midle13.tx ($vec13Txz.x); setAttr Light_Midle13.tz ($vec13Txz.z); setAttr Light_Midle14.tx ($vec14Txz.x); setAttr Light_Midle14.tz ($vec14Txz.z); setAttr Light_Midle15.tx ($vec15Txz.x); setAttr Light_Midle15.tz ($vec15Txz.z); setAttr Light_Midle16.tx ($vec16Txz.x); setAttr Light_Midle16.tz ($vec16Txz.z); //パターンがレインの場合のみコンストレインローケータ(照射角)変更 if($selFormType == "LightEnvRin") { select -r Lowlight ; move 0 5 0 ; select -r Midlelight ; move 0 -1.2 0 ; select -r Highlight ; move 0 -1.2 0 ; select -cl; } } //////////////////////////////////////////////////////////////////////////////// //フォーメーションのスライダー対応プロシージャ(スライダー値をフォーメーションに反映) //低階層の高度フォーメーション global proc LowlightsetTY() { float $LowTY = `getAttr Light_Low1.ty`; setAttr Light_Low2.ty $LowTY; setAttr Light_Low3.ty $LowTY; setAttr Light_Low4.ty $LowTY; setAttr Light_Low5.ty $LowTY; setAttr Light_Low6.ty $LowTY; setAttr Light_Low7.ty $LowTY; setAttr Light_Low8.ty $LowTY; setAttr Light_Low9.ty $LowTY; setAttr Light_Low10.ty $LowTY; } //中階層の高度フォーメーション global proc MidlelightsetTY() { float $MidleTY = `getAttr Light_Midle11.ty`; setAttr Light_Midle12.ty $MidleTY; setAttr Light_Midle13.ty $MidleTY; setAttr Light_Midle14.ty $MidleTY; setAttr Light_Midle15.ty $MidleTY; setAttr Light_Midle16.ty $MidleTY; } //上階層のスケールフォーメーション global proc HighlightsetSX() { float $HighSX = `getAttr Light_High17.sx`; setAttr Light_High17.sy $HighSX; } //中階層のスケールフォーメーション global proc MidlelightsetSX() { float $MidleSX = `getAttr Light_Midle11.sx`; setAttr Light_Midle11.sy $MidleSX; setAttr Light_Midle12.sy $MidleSX; setAttr Light_Midle13.sy $MidleSX; setAttr Light_Midle14.sy $MidleSX; setAttr Light_Midle15.sy $MidleSX; setAttr Light_Midle16.sy $MidleSX; setAttr Light_Midle12.sx $MidleSX; setAttr Light_Midle13.sx $MidleSX; setAttr Light_Midle14.sx $MidleSX; setAttr Light_Midle15.sx $MidleSX; setAttr Light_Midle16.sx $MidleSX; } //低階層のスケールフォーメーション global proc LowlightsetSX() { float $LowSX = `getAttr Light_Low1.sx`; setAttr Light_Low1.sy $LowSX; setAttr Light_Low2.sy $LowSX; setAttr Light_Low3.sy $LowSX; setAttr Light_Low4.sy $LowSX; setAttr Light_Low5.sy $LowSX; setAttr Light_Low6.sy $LowSX; setAttr Light_Low7.sy $LowSX; setAttr Light_Low8.sy $LowSX; setAttr Light_Low9.sy $LowSX; setAttr Light_Low10.sy $LowSX; setAttr Light_Low2.sx $LowSX; setAttr Light_Low3.sx $LowSX; setAttr Light_Low4.sx $LowSX; setAttr Light_Low5.sx $LowSX; setAttr Light_Low6.sx $LowSX; setAttr Light_Low7.sx $LowSX; setAttr Light_Low8.sx $LowSX; setAttr Light_Low9.sx $LowSX; setAttr Light_Low10.sx $LowSX; } //中階層のライトの輝度 global proc MidlelightsetINT() { float $MidleINT = `getAttr Light_MidleShape11.intensity`; setAttr Light_Midle12.intensity $MidleINT; setAttr Light_Midle13.intensity $MidleINT; setAttr Light_Midle14.intensity $MidleINT; setAttr Light_Midle15.intensity $MidleINT; setAttr Light_Midle16.intensity $MidleINT; } //低階層のライトの輝度 global proc LowlightsetINT() { float $LowINT = `getAttr Light_LowShape1.intensity`; setAttr Light_Low2.intensity $LowINT; setAttr Light_Low3.intensity $LowINT; setAttr Light_Low4.intensity $LowINT; setAttr Light_Low5.intensity $LowINT; setAttr Light_Low6.intensity $LowINT; setAttr Light_Low7.intensity $LowINT; setAttr Light_Low8.intensity $LowINT; setAttr Light_Low9.intensity $LowINT; setAttr Light_Low10.intensity $LowINT; } //中階層の直径のフォーメーション global proc MidleRadiusVec() { float $radius1; vector $vec11,$vec12,$vec13,$vec14,$vec15,$vec16; vector $vec11Txz,$vec12Txz,$vec13Txz,$vec14Txz,$vec15Txz,$vec16Txz; //現在の座標を取得 $vec11 = `getAttr Light_Midle11.translate`; $vec12 = `getAttr Light_Midle12.translate`; $vec13 = `getAttr Light_Midle13.translate`; $vec14 = `getAttr Light_Midle14.translate`; $vec15 = `getAttr Light_Midle15.translate`; $vec16 = `getAttr Light_Midle16.translate`; $radius1 = `floatSliderGrp -q -value radius1`; //スライダー設定値と現在地のXZで目標値決定 $vec11Txz = $vec11 * $radius1; $vec12Txz = $vec12 * $radius1; $vec13Txz = $vec13 * $radius1; $vec14Txz = $vec14 * $radius1; $vec15Txz = $vec15 * $radius1; $vec16Txz = $vec16 * $radius1; setAttr Light_Midle11.tx ($vec11Txz.x); setAttr Light_Midle11.tz ($vec11Txz.z); setAttr Light_Midle12.tx ($vec12Txz.x); setAttr Light_Midle12.tz ($vec12Txz.z); setAttr Light_Midle13.tx ($vec13Txz.x); setAttr Light_Midle13.tz ($vec13Txz.z); setAttr Light_Midle14.tx ($vec14Txz.x); setAttr Light_Midle14.tz ($vec14Txz.z); setAttr Light_Midle15.tx ($vec15Txz.x); setAttr Light_Midle15.tz ($vec15Txz.z); setAttr Light_Midle16.tx ($vec16Txz.x); setAttr Light_Midle16.tz ($vec16Txz.z); } //低階層の直径のフォーメーション global proc LowRadiusVec() { float $radius2; vector $vec1,$vec2,$vec3,$vec4,$vec5,$vec6,$vec7,$vec8,$vec9,$vec10; vector $vec1Txz,$vec2Txz,$vec3Txz,$vec4Txz,$vec5Txz,$vec6Txz,$vec7Txz,$vec8Txz,$vec9Txz,$vec10Txz; //現在の座標を取得 $vec1 = `getAttr Light_Low1.translate`; $vec2 = `getAttr Light_Low2.translate`; $vec3 = `getAttr Light_Low3.translate`; $vec4 = `getAttr Light_Low4.translate`; $vec5 = `getAttr Light_Low5.translate`; $vec6 = `getAttr Light_Low6.translate`; $vec7 = `getAttr Light_Low7.translate`; $vec8 = `getAttr Light_Low8.translate`; $vec9 = `getAttr Light_Low9.translate`; $vec10 = `getAttr Light_Low10.translate`; $radius2 = `floatSliderGrp -q -value radius2`; //スライダー設定値と現在地のXZで目標値決定 $vec1Txz = $vec1 * $radius2; $vec2Txz = $vec2 * $radius2; $vec3Txz = $vec3 * $radius2; $vec4Txz = $vec4 * $radius2; $vec5Txz = $vec5 * $radius2; $vec6Txz = $vec6 * $radius2; $vec7Txz = $vec7 * $radius2; $vec8Txz = $vec8 * $radius2; $vec9Txz = $vec9 * $radius2; $vec10Txz = $vec10 * $radius2; setAttr Light_Low1.tx ($vec1Txz.x); setAttr Light_Low1.tz ($vec1Txz.z); setAttr Light_Low2.tx ($vec2Txz.x); setAttr Light_Low2.tz ($vec2Txz.z); setAttr Light_Low3.tx ($vec3Txz.x); setAttr Light_Low3.tz ($vec3Txz.z); setAttr Light_Low4.tx ($vec4Txz.x); setAttr Light_Low4.tz ($vec4Txz.z); setAttr Light_Low5.tx ($vec5Txz.x); setAttr Light_Low5.tz ($vec5Txz.z); setAttr Light_Low6.tx ($vec6Txz.x); setAttr Light_Low6.tz ($vec6Txz.z); setAttr Light_Low7.tx ($vec7Txz.x); setAttr Light_Low7.tz ($vec7Txz.z); setAttr Light_Low8.tx ($vec8Txz.x); setAttr Light_Low8.tz ($vec8Txz.z); setAttr Light_Low9.tx ($vec9Txz.x); setAttr Light_Low9.tz ($vec9Txz.z); setAttr Light_Low10.tx ($vec10Txz.x); setAttr Light_Low10.tz ($vec10Txz.z); } //////////////////////////////////////////////////////////////////////////////// global proc delLightGP() { //既存のライトグループが存在するか確認 if(`objExists "Formation_Light_GP"`) { delete "Formation_Light_GP"; } }