記錄控制器-路徑約束部分的腳本寫法
特性
a = teapot radius:6 --創建茶壺 半徑爲6
h1 = helix radius1:50 radius2:0 height:0 turns:2 --創建螺旋線 半徑1 半徑2 高度 圈數
a.position.controller = path_constraint() --將物體a的控制器更改爲 路徑約束控制器
返回值:Controller:Path_Constraint
a.position.controller.follow = on --開啓物體的位置約束中的跟隨選項
返回值:true
c = a.position.controller --書寫方便,將長語句賦值爲短語句調用
返回值:Controller:Path_Constraint
c.percent = 0.5 --設置%沿路徑微調器
返回值:Value
c.follow = off --關閉跟隨
返回值:false
c.path = h1 --增加樣條線helix001爲路徑約束曲線
c.deletetarget 1 --刪除路徑約束曲線目標1---》helix001
屬性 - Properties:
c.bank = on --開啓傾斜
c.bankamount = 1 --傾斜量
c.smoothness = --光滑值
c.loop = on --循環
c.relative = on --相對
c.axis = 1\2\3 --軸向x\y\z
c.axisflip = off --關閉翻轉
方法 - Methods:
h2 = helix() --新建螺旋線h2
<boolean>appendTarget <node>target<float>weight
c.appendTarget h2 30 --附加該螺旋線到茶壺的路徑約束中去
<integer>getNumTargets ()
c.getnumtargets() --返回 theTarget 列表中目標節點 (路徑) 數。
<node>getNode <index>targetNumber
c.getnode 2 --從列表中的路徑返回索引2的節點
<float>getWeight <index>targetNumber
c.getweight 1 --獲取第一個節點的 權重值
<float>setWeight <index>targetNumber
c.setweight 1 60 --設置第一個節點權重值爲60
<boolean>deleteTarget <index>targetNumber
c.deletetarget 1 --刪除列表中第一個約束目標
附加:
- 動態修改%沿路徑微調器
animate on at time 0 c.percent = 20 --0幀修改爲%20
animate on at time 100 c.percent = 100 --100幀修改爲%100