def post_publish(): element = maya_publish_dialog.result if maya_publish_dialog.published: if not cmds.file(q=True, sceneName=True) == '': cmds.file(save=True, force=True) #save file #Publish user = maya_publish_dialog.user src = maya_publish_dialog.src comment = maya_publish_dialog.comment dst = element.publish(user, src, comment) #Ensure file has correct permissions try: os.chmod(dst, 0660) except: pass print "TODO: export playblast" print maya_publish_dialog.result.get_name() if element.get_department() == Department.MODEL: print "Exporting Alembic" alembic_static_exporter.go() if element.get_department() == Department.ANIM: print "Giving the Animator the opportunity to export alembic" alembic_exporter.go()
def publishElement(element, user, src, comment): dst = element.publish(user, src, comment) #Ensure file has correct permissions try: os.chmod(dst, 0660) except: pass #Export a playblast print 'TODO: export playblast' print element.get_name() #Export Alembics print 'Publish Complete. Begin Exporting Alembic' alembic_exporter.go(element=element)
def publishElement(element, user, src, comment): dst = element.publish(user, src, comment) #Ensure file has correct permissions try: os.chmod(dst, 0660) except: pass #freeze transformations and clear history if maya_publish_dialog.clearHistoryCheckbox.isChecked(): clear_construction_history() try: freeze_transformations() except: freeze_error_msg = ("Failed to freeze transformations, probably because " "there are one or more keyframed values in your object. Remove all " "keyframed values and expressions from your object and try again.") cmds.confirmDialog(title="Freeze Transformations Error", message=freeze_error_msg) print(freeze_error_msg) #Export a playblast print 'TODO: export playblast' print element.get_name() #Export Alembics print 'Publish Complete. Begin Exporting Alembic, or JSON if set' body = Project().get_body(element.get_parent()) try: alembic_exporter.go(element=element) except: print("alembic export failed.") if body and body.is_asset(): json_exporter.go(body, body.get_type()) else: json_exporter.go(body, type="shot") noEducationalLicence()
#Set frameRange as specified by the user. pm.playbackOptions(ast=firstFrame) pm.playbackOptions(aet=lastFrame) pm.saveFile() user = project.get_current_username() comment = 'First crowd cycle publish' element.publish(user, cycleFile, comment) # Select the group then grab the selection selection = pm.select(name) selection = pm.ls(selection=True) alembics = alembic_exporter.go(element, selection=selection, startFrame=firstFrame, endFrame=lastFrame) pm.saveFile() print 'opening', fileName pm.openFile(fileName, force=True) group = pm.ls(name)[0] delete(group) reference.referenceCrowdCycle(alembics) def delete(node): if pm.referenceQuery(node, inr = True): refFile = pm.referenceQuery(node, f = True) ref = pm.FileReference(refFile) ref.remove()
selectRig() keyArmFK() clearRotate(fullRig) clearTranslate(fullRig) clearScale(fullRig) #Move rig to anim start position posOk no prob, we mainly use it just to make sure we all have the most recent versions. what's your email? ition #this shouldn't be necessary if we didn't clear translation from primary_global #translateRig(startX, startY, startZ) #APose() -- No need to call APose() because Viking was built in A-Pose setRigKey(fullRig) mc.setKeyframe(rigPrefix + '_COG_cc_01', at='translateX') mc.setKeyframe(rigPrefix + '_COG_cc_01', at='translateY') mc.setKeyframe(rigPrefix + '_COG_cc_01', at='translateZ') mc.setKeyframe(rigPrefix + '_COG_cc_01', at='rotateX') mc.setKeyframe(rigPrefix + '_COG_cc_01', at='rotateY') mc.setKeyframe(rigPrefix + '_COG_cc_01', at='rotateZ') #Export Alembic (Requires User Input - Select Viking's Rig) mc.playbackOptions(animationStartTime=STARTPRE_0) import alembic_tagger; alembic_tagger.go() import alembic_exporter #reload(alembic_exporter) alembic_exporter.go(dept=Department.CFX) # puts abc in the cfx file instead
clearTranslate(fullRig) scaleFingers() #Scale Fingers (Only Scalable Control) #Key APose (Adjust Arms, Keyframe) APose() setRigKey(fullRig) mc.setKeyframe('ten_rig_main_m_COG_CTL', at='translateX') #Hip Controller Not Working? mc.setKeyframe('ten_rig_main_m_COG_CTL', at='translateY') mc.setKeyframe('ten_rig_main_m_COG_CTL', at='translateZ') mc.setKeyframe('ten_rig_main_m_COG_CTL', at='rotateX') mc.setKeyframe('ten_rig_main_m_COG_CTL', at='rotateY') mc.setKeyframe('ten_rig_main_m_COG_CTL', at='rotateZ') mc.setKeyframe('ten_rig_main_r_shoulder_CTL', at='translateX') #Shoulder Controller Not Working? mc.setKeyframe('ten_rig_main_r_shoulder_CTL', at='translateY') mc.setKeyframe('ten_rig_main_r_shoulder_CTL', at='translateZ') mc.setKeyframe('ten_rig_main_r_shoulder_CTL', at='rotateX') mc.setKeyframe('ten_rig_main_r_shoulder_CTL', at='rotateY') mc.setKeyframe('ten_rig_main_r_shoulder_CTL', at='rotateZ') #Export Alembic (Requires User Input - Select Ten's Rig) mc.playbackOptions(animationStartTime=STARTPRE) import alembic_exporter alembic_exporter.go()