Пример #1
def mkBakeExecution():
	Uiinfo				=		myclass()
	if Uiinfo.result == 0: # Apply
		imgFormat 			=		Uiinfo.dlg.getValue("formats")
		imgres				=		Uiinfo.dlg.getValue("resolution")
		surfShdr			=		Uiinfo.mkCreateCamNrml()
		TimeLine			=		Uiinfo.dlg.getValue("Frame range")
		TimeLine			=		TimeLine.split('-')
		startFrame			=		int(TimeLine[0])
		endFrame			=		int(TimeLine[1])
		cameraName			=		Uiinfo.dlg.getValue("Load camera")
		ShaderName			=		Uiinfo.dlg.getValue("Load shader")
		objectName			=		Uiinfo.dlg.getValue("Load object")
		fileImageName		=		Uiinfo.dlg.getValue("Image name")
		normalCheck			=		Uiinfo.dlg.getValue("Normal map")
		cmds.currentTime( startFrame, edit=True )
		for i in range (startFrame,endFrame):
			mKcurentFrame	=		cmds.currentTime( query=True )
			intFrame		=		int(mKcurentFrame)
			intFrame		=		str(intFrame).zfill(4)
			cmds.convertSolidTx( ShaderName, objectName, fileImageName=fileImageName+"_"+intFrame+'.'+imgFormat, fil =imgFormat,rx= int(imgres), ry= int(imgres))
			if normalCheck== 1 :
				cmds.convertSolidTx( surfShdr['surface'],objectName, fileImageName= fileImageName+"_nrml."+intFrame+'.'+imgFormat, fil = imgFormat,rx= int(imgres), ry= int(imgres))
			cmds.currentTime( mKcurentFrame+1, edit=True )
Пример #2
    def set_to_bookmark(self, bmark=None):
        set camera to specified bookmark position otherwise
            set position to current bookmark if available

        :type   bmark: C{str}
        :param  bmark: bookmark for camera position
        if bmark and bmark in self.bookmarks:
            mc.cameraView(bmark, edit=True, camera=self.camera, setCamera=True)
            self.current_bookmark = bmark
        elif self.current_bookmark:
            mc.cameraView(self.current_bookmark, edit=True, camera=self.camera, setCamera=True)
Пример #3
    def home_position(self, cam):
        set the original view position of camera before processing

        :type   cam: C{str}
        :param  cam: camera for view position
        self._home_position = mc.cameraView(camera=cam)
Пример #4
def CamSet3():
    if cmds.objExists('saveCam_3'): cmds.cameraView('saveCam_3',e=1,sc=1)
    if not cmds.objExists('saveCam_3'): cmds.cameraView(n='saveCam_3',ab=1)