  | | | XSI Python error log | XSI Python error log 2004-04-23 - By Jerry Gamache
Back The errors are annoying but do not prevent Python scripting from working.
The only feature not accessible will be the XSI-specific constant names and here is a script that generates them all (to save Rick some work). Some non-xsi constants might sneak in, but can be edited out afterwards.
# # This script browses all files generated by gen_py for constants # and generates a file named XSI.py in the correct location for # importing. You only need to run this script once. # # The gen_py files are generated on the fly by starting # XSI then switching to the Python scripting langage so # make sure to have that XSI running when running this script. # # When done, you will be able to do the following: # # import XSIConst # Application.LogMessage(str(XSIConst.siAxesFilter.siXY)) # #INFO : "3" # # To get an idea of all names generated, just open # X:\Python23\Lib\XSIConst.py in an editor # import sys, os, re pythonPath = os.path.dirname(sys.executable) genPyPath = pythonPath + "\\Lib\\site-packages\\win32com\\gen_py" constantFile = open(pythonPath + "\\Lib\\XSIConst.py", "w") # Browse all CLSID under gen_py: for clsidDir in os.listdir(genPyPath): # Browse all py files there: clsidPath = genPyPath + "\\" + clsidDir if not os.path.isdir(clsidPath): continue for pyFile in os.listdir(clsidPath): if pyFile[-3:] == ".py": pyFilePath = clsidPath + "\\" + pyFile foundConstant = 0 currentClass = None for line in file(pyFilePath): if not foundConstant: if "class constants:" in line: foundConstant = 1 continue else: if "=" in line: className = line.split(" ")[-1] if className != currentClass: constantFile.write("\n") constantFile.write("class " + className[:-1] + ":\n ") currentClass = className constantFile.write(line) else: foundConstant = 0 constantFile.close() # # End script. #
-- --Original Message-- -- From: Christian Rittener [mailto:chrr@(protected)] Sent: Friday, April 23, 2004 2:15 PM To: Jerry Gamache Subject: XSI Python error log
See attachment. I didn't realize you were with Softimage :-) I was about to contact support if I didn't get a solution via the mailing list...
Christian
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|
 |