agentclipsample
float agentclipsample(<geometry>geometry, int prim, string clipname, float time, int channel_index)
float agentclipsample(<geometry>geometry, int prim, string clipname, float time, string channel)
float agentclipsample(<geometry>geometry, int prim, int clipindex, float time, int channel_index)
float agentclipsample(<geometry>geometry, int prim, int clipindex, float time, string channel)
在给定时间评估动画片段并返回指定通道的值。
如果clipname
不是代理的动画片段之一、prim
超出范围、prim
不是代理图元、channel_index
超出范围或channel
不存在,则返回零。
要采样动画片段的变换通道,请改用agentclipsamplelocal或agentclipsampleworld。
<geometry>
在节点上下文(如wrangle SOP)中运行时,此参数可以是表示输入编号(从0开始)的整数,用于读取几何体。
或者,该参数可以是指定要读取的几何文件(例如.bgeo
)的字符串。在Houdini内部运行时,可以是op:/path/to/sop
引用。
prim
图元编号。
clipname
动画片段的名称。
clipindex
代理定义中动画片段的索引。 可通过agentfindclip获取片段的索引。
time
评估动画片段的时间(以秒为单位)。如果该时间大于片段长度,将会循环播放。
channel_index
动画片段中通道的索引,由agentclipchannel返回。
channel
动画片段中通道的名称。
示例
在1.2秒后采样”walk”片段的通道。
float value = agentclipsample(0, @primnum, "walk", 1.2, "latch_leftfoot");