Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: cp932 -*-
- import pymel.core as pm
- import pymel.tools.mel2py as mel2py
- melCmd = """
- global proc string getPcUserName()
- {
- string $output="";
- string $AppDir = `internalVar -userAppDir`;
- print ("$AppDir="+$AppDir+"\n");
- string $AppDirArr[];
- tokenize $AppDir "/" $AppDirArr;
- $output=$AppDirArr[2];
- print("---getPcUserName()-----------"+$output+"\n");
- return $output;
- }
- getPcUserName();
- """
- print "------------------------------------------------"
- melCmd = melCmd.replace('+"\n"', '')
- melCmd = melCmd.replace('\n', '')
- print("melCmd="+melCmd)
- print "------------------------------------------------"
- pyCmd = mel2py.mel2pyStr(melCmd,pymelNamespace='pm')
- pyFixed_Dest = ""
- pyFixed_Dest = pyFixed_Dest + "# -*- coding: cp932 -*- \n"
- pyFixed_Dest = pyFixed_Dest + "from maya import cmds \n"
- pyFixed = pyCmd.replace("pymel.all","pymel.core")
- pyFixed = pyFixed.replace("pm.pm.cmds","cmds")
- pyFixed_Dest = pyFixed_Dest + pyFixed+"\n"
- print "------------------------------------------------"
- pyFixed_Dest = pyFixed_Dest.replace('pm.file', 'cmds.file')
- pyFixed_Dest = pyFixed_Dest.replace('pm.ls', 'cmds.ls')
- pyFixed_Dest = pyFixed_Dest.replace('pm.select', 'cmds.select')
- pyFixed_Dest = pyFixed_Dest.replace('pm.internalVar', 'cmds.internalVar')
- pyFixed_Dest = pyFixed_Dest.replace('pm.keyframe', 'cmds.keyframe')
- print "------------------------------------------------"
- print pyFixed_Dest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement