Advertisement
Guest User

Untitled

a guest
Mar 5th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 2.32 KB | None | 0 0
  1. (PropAnim
  2.     (description "Animate any properties on target object")
  3.     (ext anim)
  4.     (superclasses Anim)
  5.     (editor (loop
  6.             bool
  7.             (help "Do I self loop on SetFrame")))
  8.     (types
  9.         (song_anim (song TRUE))
  10.         (vignette_lipsync
  11.             (editor
  12.                 (clip
  13.                     object
  14.                     (class CharClip)
  15.                     (help "The clip that this propanim goes along with"))
  16.                 (lip_sync
  17.                     object
  18.                     (class CharLipSync)
  19.                     (help "The lipsync object to set from this propanim"))
  20.                 (setup_from_clip
  21.                     script
  22.                     (script {$this setup_from_clip})))
  23.             (clip )
  24.             (lip_sync )
  25.             (setup_from_clip {do
  26.                     {set
  27.                         $target
  28.                         [lip_sync]}
  29.                     {set
  30.                         $num_frames
  31.                         {*
  32.                             {[clip]
  33.                                 get
  34.                                 length_seconds}
  35.                             30}}
  36.                     {foreach
  37.                         $viseme
  38.                         {$target
  39.                             get
  40.                             viseme_list}
  41.                         {set
  42.                             $temp
  43.                             {array 0}}
  44.                         {push_back
  45.                             $temp
  46.                             $viseme}
  47.                         {if
  48.                             {! {$this
  49.                                     has_keys
  50.                                     $target
  51.                                     $temp}}
  52.                             {$this
  53.                                 add_keys
  54.                                 $target
  55.                                 $temp
  56.                                 kPropFloat}
  57.                             {$this
  58.                                 set_key_val
  59.                                 $target
  60.                                 $temp
  61.                                 0
  62.                                 0.00}
  63.                             {$this
  64.                                 set_key_val
  65.                                 $target
  66.                                 $temp
  67.                                 $num_frames
  68.                                 0.00}}}}))
  69.         (song_facial_exp
  70.             (song TRUE)
  71.             (editor (lip_sync
  72.                     object
  73.                     (class CharLipSync)
  74.                     (help "The lipsync object to set from this propanim")))
  75.             (lip_sync )
  76.             (setup {if_else
  77.                     {$tool_song song_name}
  78.                     {do
  79.                         {set
  80.                             $target
  81.                             [lip_sync]}
  82.                         {set
  83.                             $num_frames
  84.                             {*
  85.                                 {$tool_song
  86.                                     get
  87.                                     song_end_frame}
  88.                                 30}}
  89.                         {foreach
  90.                             $viseme
  91.                             {$target
  92.                                 get
  93.                                 viseme_list}
  94.                             {set
  95.                                 $temp
  96.                                 {array 0}}
  97.                             {push_back
  98.                                 $temp
  99.                                 $viseme}
  100.                             {if
  101.                                 {! {$this
  102.                                         has_keys
  103.                                         $target
  104.                                         $temp}}
  105.                                 {$this
  106.                                     add_keys
  107.                                     $target
  108.                                     $temp
  109.                                     kPropFloat}
  110.                                 {$this
  111.                                     set_key_val
  112.                                     $target
  113.                                     $temp
  114.                                     0
  115.                                     0.00}
  116.                                 {$this
  117.                                     set_key_val
  118.                                     $target
  119.                                     $temp
  120.                                     $num_frames
  121.                                     0.00}}}}
  122.                     {notify "No song selected in anim bar- can't set up lip sync.  Please select the song and try again."}}))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement