Ganeesya

Live2D ペンタブ制御 Lua スクリプト

Feb 16th, 2016
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. if not ganepaint then
  2.     ganepaint = {speetiEnd = time,mouselvl = 0,speakTime = 10000,FaceUp = 0}
  3. end
  4. setPos(id,-2.3,1.4)
  5. setScale(id,0.0025,-0.0025)
  6.  
  7. if sound then
  8.     if sound.lvl > 25 then
  9.         ganepaint.speetiEnd = time
  10.     end
  11.     if ganepaint.speetiEnd + ganepaint.speakTime > time then
  12.         ganepaint.FaceUp = ganepaint.FaceUp + 0.03
  13.         if ganepaint.FaceUp > 1 then ganepaint.FaceUp = 1 end
  14.     else
  15.         ganepaint.FaceUp = ganepaint.FaceUp * 0.95
  16.     end
  17. end
  18.  
  19. if wacom then
  20.     addParam(id,"PARAM_Pen_X",(50-wacom.X)/50,1)
  21.     addParam(id,"PARAM_Pen_Y",(50-wacom.Y)/50,1)
  22.     addParam(id,"PARAM_EYE_BALL_X",(50-wacom.X)/50*(1-ganepaint.FaceUp),1)
  23.     addParam(id,"PARAM_EYE_BALL_Y",(ganepaint.FaceUp-1),1)
  24.     addParam(id,"PARAM_Pen_R",-wacom.Roll/100,1)
  25.     addParam(id,"PARAM_Pen_E",wacom.Ele/100,1)
  26.     addParam(id,"PARAM_ANGLE_Y",(ganepaint.FaceUp-1)*30,1)
  27.     addParam(id,"PARAM_ANGLE_Z",(50-wacom.X)*6/50*(1-ganepaint.FaceUp),1)
  28.     addParam(id,"PARAM_ANGLE_X",-(50-wacom.X)*6/50*(1-ganepaint.FaceUp),1)
  29. end
  30.  
  31. addParam(id,"PARAM_MOUTH_OPEN_Y",sound.lvl/100,1)
Add Comment
Please, Sign In to add comment