SHARE
TWEET

auto cfx build rnd

yaotungyu Jun 3rd, 2020 (edited) 1,044 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def checker_start_build():
  2.     cmds.file(new=1,f=1)
  3.     import checker
  4.     starttasks = checker.get_tasks(task_type='start')
  5.     for t in starttasks:
  6.         t.run()
  7.        
  8.     buildtasks = checker.get_tasks(task_type='build')
  9.     for t in buildtasks:
  10.         t.run()
  11.         if t.name=='Import Ornatrix Groom Products':
  12.             groom_prod = t._groom_path.split('/')[-1]
  13.        
  14.     for r in cmds.file(q=1,r=1):
  15.         if '/rig' in r:
  16.             rig_prod = r.split('/')[-1]
  17.     return groom_prod,rig_prod
  18.  
  19. def exe_cfx_script_latest():
  20.     import fileTools as ft
  21.     cfx_script_path = ft.ez.path('elems')+'/'+'CFX_Script'
  22.     script_files = os.listdir(cfx_script_path)
  23.     script_files.sort()
  24.     execfile(cfx_script_path+'/'+script_files[-1])
  25.     print cfx_script_path+'/'+script_files[-1]
  26.     return script_files[-1]
  27.  
  28.  
  29. build = checker_start_build()
  30. cfxscr = exe_cfx_script_latest()
  31.  
  32.  
  33.  
  34. #stress_testing
  35. rig_ns = cmds.referenceQuery(cmds.file(q=1,r=1)[0],ns=1).split(':')[-1]
  36. cmds.setKeyframe(rig_ns+':Root_Ctrl.ry',t=1)
  37. cmds.setKeyframe(rig_ns+':Root_Ctrl.ry',v=360,t=120)
  38.  
  39. cmds.setKeyframe(rig_ns+':C_Upr_Head_Squash_Ctrl.tz',t=1)
  40. cmds.setKeyframe(rig_ns+':C_Upr_Head_Squash_Ctrl.tz',t=120)
  41. cmds.setKeyframe(rig_ns+':C_Upr_Head_Squash_Ctrl.tz',t=60,v=25)
  42.  
  43. cmds.setKeyframe(rig_ns+':C_Mid_Head_Squash_Ctrl.tz',t=1)
  44. cmds.setKeyframe(rig_ns+':C_Mid_Head_Squash_Ctrl.tz',t=120)
  45. cmds.setKeyframe(rig_ns+':C_Mid_Head_Squash_Ctrl.tz',t=60,v=-25)
  46.  
  47. cmds.setKeyframe(rig_ns+':C_Lwr_Head_Squash_Ctrl.tz',t=1)
  48. cmds.setKeyframe(rig_ns+':C_Lwr_Head_Squash_Ctrl.tz',t=120)
  49. cmds.setKeyframe(rig_ns+':C_Lwr_Head_Squash_Ctrl.tz',t=60,v=25)
  50.  
  51.  
  52.  
  53. cmds.select('Groom_Grp')
  54. cmds.viewFit(['persp'])
  55. cam = cmds.camera(n='RENDER')
  56. cmds.rename(cam[0],'RENDER')
  57. cmds.parentConstraint('persp','RENDER')
  58. cmds.setAttr('RENDER.renderable',1)
  59. from tech_render_utils import alter_cache_playblaster
  60.  
  61. playblaster = alter_cache_playblaster.animationPlayblaster()
  62. playblaster._set_display_elements()
  63. playblaster._apply_render_preset()
  64. playblaster._anm_display_elem_override()
  65. playblaster._prepare_for_render()
  66. cmds.select('Groom_Grp')
  67. playblaster._render_timeline(start_from_zero = True,do_color_correction=False,center_stamp_text = os.environ['TT_ENTNAME']+' '+os.environ['TT_STEPCODE']+' Groom Stress Test')
  68.  
  69.  
  70.  
  71.  
  72. #########################
  73. ##querying versions
  74.  
  75. from aronado import _sg_query_util
  76. reload(_sg_query_util)
  77. cfx_query = _sg_query_util.sg_list_assets(task_type='cfx',status_list=['rev'],return_dict=True)
  78.  
  79. cfx_pubs = [v for v in cfx_query[0]['entity.Asset.sg_versions'] if 'Cfx' in v['name']]
  80. cfx_pubs.sort()
  81. import shotgun
  82. sg = shotgun.connect()
  83. sg.find_one('Version',[['id','is',cfx_pubs[-1]['id']]],['description'])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top