• 表情动画控制器


    /*
    Creates an on screen control for facial animation.
    facialControl()
    */
    fn facialControl=
    (
     rec=Rectangle length:10 10 name:(uniqueName "FaceControl") wireColor:[0,0,200] displayRenderMesh:false
     cir=circle radius:1 name:(uniqueName "FaceControlHandle") wireColor:[200,0,0] displayRenderMesh:false
     cir.parent=rec
     setTransformLockFlags cir #{3..9}
     conName=text text:"Control" size:2 wireColor:[0,150,0] pos:[0,5.5,0] alignment:2 displayRenderMesh:false
     conName.parent=rec
     addModifier conName (meshSelect())
     setTransformLockFlags conName #{1..9}
     rec.rotation.x_rotation=90
     
     listCon=cir.pos.controller=position_list()
     scCon=listCon.available.controller=position_script()
     
     def=attributes clamp
     (
      parameters clampP
      (
       l type:#float
       w type:#float
       x type:#float
       y type:#float
      )
     )
     custAttributes.add scCon def
     
     scCon.l.controller=rec.length.controller=bezier_float()
     scCon.l=10
     scCon.w.controller=rec.width.controller=bezier_float()
     scCon.w=10
     scCon.x.controller=listCon[1].x_position.controller=bezier_float()
     scCon.y.controller=listCon[1].y_position.controller=bezier_float()
     
     script="
     x=0
     y=0
     w=this.w/2
     l=this.l/2
     if this.x>w then (x=-this.x+w;this.x=w)
     if this.x<-w then (x=-this.x-w;this.x=-w)
     if this.y>l then (y=-this.y+l;this.y=l)
     if this.y<-l then (y=-this.y-l;this.y=-l)
     
     [x, y, 0]
     "
     scCon.script=script
    )


    facialControl()

  • 相关阅读:
    LR--用栈实现移进--归约分析(demo)
    阿里云ECS服务器socket无法连接的问题
    select客户端模型封装——回调方式快速建立客户端
    select服务器端模型封装——回调方式快速建立服务端
    python实现的ocr接口
    汉字字典树
    linux下简易端口扫描器
    Linux下cs简单通讯(socket)
    POj 1321 棋盘问题 DFS 回溯
    HDU 1097 快速幂
  • 原文地址:https://www.cnblogs.com/softimagewht/p/1834592.html
Copyright © 2020-2023  润新知