ここから======================
--当たり判定を取ってモーションを変えるサンプル
-- Script for Crowd system
-- Set/unset preferred clips at times
-- flipperdesign
bips = #()
fn PerFrameFn crwd time =
(
IF (time == 1f) then
(
Print "Script active!"
)
--100以内に入ったら1を返す
IF (abs q2[i]< HANTEI)and(abs q[i]< HANTEI)then
(
Print "ATARI"
Print HANTEI
b[i]=1
)else(
b[i]=0
)
-- 複数の命令を回す--
IF (b[i] == 1) then(
format "building biped list\n"
bips = for obj in objects
where (classof obj == Biped_Object and
obj.controller.rootNode == obj) collect obj
for bip in bips do
(
bipCtrl = a[i].controller
biped.addprefclip bipCtrl "Laugh" 100
bipCtrl = a[i].controller
)
--トリガーがONになるとモーションが発動する
-- set action at given frame
IF (testON == 1) then
(
format "building biped list\n"
bips = for obj in objects
where (classof obj == Biped_Object and
obj.controller.rootNode == obj) collect obj
for bip in bips do
(
bipCtrl = bip.controller
biped.addprefclip bipCtrl "Laugh" 100
Print("Frame 400 - addprefclip: Laugh")
)
bipCtrl = $Bip01.controller
Print ("Remaining Clip pref: " +(biped.numPrefClips bipCtrl) as string)
)
-- set action at given frame
IF (testON == 1) then
(
format "building biped list\n"
bips = for obj in objects
where (classof obj == Biped_Object and
obj.controller.rootNode == obj) collect obj
for bip in bips do
(
bipCtrl = bip.controller
biped.deleteprefclip bipCtrl "Laugh"
Print("Frame 700 - deleteprefclip: Laugh")
)
bipCtrl = $Bip01.controller
Print ("Remaining Clip pref: " +(biped.numPrefClips bipCtrl) as string)
)
)
ここまで=========================
このコードで当り判定をとれましたが、、、全部が同じ動きをしてしまいます、、
次は個別に割り当てができるように改造していきます。]]>3ds max の群集について2018-01-07T06:10:08+09:00machieeNINJA BLOGmachiee
http://machiee.blog.shinobi.jp/3ds%20max%20%E3%81%AE%E7%BE%A4%E9%9B%86%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6/3ds%20max%20%E3%81%AE%E7%BE%A4%E9%9B%86%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6%E8%AA%BF%E3%81%B9%E3%81%A6%E3%81%BF%E3%81%9F%E3%80%82%E3%81%9D%E3%81%AE2
3ds max の群集について調べてみた。その2これが海外のサイトで見つけたコードです&darr;
ここから======================
-- Script for Crowd system
-- Set/unset preferred clips at times
-- flipperdesign
bips = #()
fn ...
ここから======================
-- Script for Crowd system
-- Set/unset preferred clips at times
-- flipperdesign
bips = #()
fn PerFrameFn crwd time =
(
IF (time == 1f) then
(
Print "Script active!"
)
-- set action at given frame
IF (time == 400f) then
(
format "building biped list\n"
bips = for obj in objects
where (classof obj == Biped_Object and
obj.controller.rootNode == obj) collect obj
for bip in bips do
(
bipCtrl = bip.controller
biped.addprefclip bipCtrl "Laugh" 100
Print("Frame 400 - addprefclip: Laugh")
)
bipCtrl = $Bip01.controller
Print ("Remaining Clip pref: " +(biped.numPrefClips bipCtrl) as string)
)
-- set action at given frame
IF (time == 700f) then
(
format "building biped list\n"
bips = for obj in objects
where (classof obj == Biped_Object and
obj.controller.rootNode == obj) collect obj
for bip in bips do
(
bipCtrl = bip.controller
biped.deleteprefclip bipCtrl "Laugh"
Print("Frame 700 - deleteprefclip: Laugh")
)
bipCtrl = $Bip01.controller
Print ("Remaining Clip pref: " +(biped.numPrefClips bipCtrl) as string)
)