1. 程式人生 > >Max裡批量轉換sliding key

Max裡批量轉換sliding key

最近在給遊戲部門寫一些小工具,他們要求的是將普通關鍵幀轉化成sliding key,基本等同於Maya裡的IK效果,自己查了寫資料很快就弄好了,他們的反饋也還可以,用的Max的自帶語言Maxscript。

----------------------------------------------------------------------------------------
-- Script Name:		SetSlidingKey.ms
-- Started:      	2018-10-10 15:11:43
-- Code by:			lulongfei
---------------
------------------------------------------------------------------------- function setSlidingKey = ( start = animationRange.start.frame end = animationRange.end.frame for j=start to end do ( slidertime = j at time j ( if selection.count > 0 then ( for i = 1 to selection.count do (
try ( biped.setSlidingKey selection[i] ) catch() try ( biped.setSlidingKey selection[i] true true true ) catch() ) ) ) ) print "{finish}" ) try destroyDialog ::setSlidingKeyUI catch() rollout setSlidingKeyUI "Set Sliding Key" ( button execute_btn "Set Sliding Key"
pos:[35,20] width:80 height:30 align:#left on execute_btn pressed do ( setSlidingKey() ) ) createdialog setSlidingKeyUI 160 70