zoukankan      html  css  js  c++  java
  • 表情动画控制器

    /*
    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()

  • 相关阅读:
    Maven:mvn 命令的基本使用
    Java:SPI机制
    Bootstrap3 排版-内联文本元素
    Bootstrap3 排版-页面主体
    Bootstrap3 排版-标题
    Bootstrap3 栅格系统-Less mixin 和变量
    Bootstrap3 栅格系统-列排序
    Bootstrap3 栅格系统-嵌套列
    Bootstrap3 栅格系统-列偏移
    Bootstrap3 栅格系统-实例:响应列重置(Responsive column resets)
  • 原文地址:https://www.cnblogs.com/softimagewht/p/1834592.html
Copyright © 2011-2022 走看看