This is RenderMan 21 Documentation you are viewing. The Rmanwiki home page will redirect you to the current documentation.
"it" is not your usual python interpreter so there are some things to know about adding scripts.
Reloading a Script
When a custom command is loaded via a .ini file you would typically put and file called it.ini in a folder alongside the python file containing your code. The it.ini file would look like this:
Then in the python file we might have something like:
If you editing acmd.py heavily as you develop your code you might not want to keep quitting "it" to get it to reload acmd.py. We can't use python's reload() command because, for various reasons, acmd.py is not loaded as a python module. We can fix this by not loading acmd.py directly and instead using a intermediate loading script that does import acmd.py as a module.
First modify you it.ini file to point to the intermediate file:
Now in this new file we set things up in python so we can load acmd.py as a module. In reload.py we have:
Now when you launch "it" acmd will be loaded and if you edit acmd.py, save it and then in the Console window you can type:
Note that extensions are always loaded into it.extensions to keep them from colliding with python built-ins or "it" built-ins.