Generating pyc files for clients, getting Maya to import the pyc files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Prior to Maya 2023, maya would create pyc files when importing python scripts, but now I can't find them. When I import my .py scripts, they do not generate pyc files. ( I run the scripts from a custom directory by appending sys.path).
I manually created them using this:
py_dir = [path]/python
import compileall
compileall.compile_dir(py_dir)
and then moved the .py files out of the directory to test if maya could run them from the .pyc files, but it could not. I restarted Maya, but it still could not.
What am I doing wrong?
The reason I need this is so that I can distribute large tool sets to clients as pyc files and ensure that they get loaded properly. I do not want to give away a massive trove of proprietary code in an open source format.
Any help is appreciated. Thanks.