boraddd
08-07-2003, 11:24 PM
Hi all,
I saw this question "how to protect a mb file" recently while reading highend3d`s mel section.
I wrote a mel script to do this. Called `mbLock`.
After you lock a scene with mbLock, it is not possible to save or export anything
from the scene anymore. Exciting huh!?
you download these files,
http://homepagez.com/boraddd/mblock.zip
http://homepagez.com/boraddd/sampleLockedFile.zip
http://homepagez.com/boraddd/source_mblock.zip
How to use:
- Open the scene you wish to lock
- type `$bypassLock=1` in command line
- Open up expression editor
- Copy/paste the mblock.mel here
- Hit the Create button
- Now save your scene (make sure you don`t overwrite the orginal scene)
- done.
Everything will go back to normal after you restart Maya
I`ll tell a little more about how it works and what it does for people with strong mel skills.
mbLock works as an expression first of all. It simply replaces some global procedures defined
when Maya boots up with safe(!) ones. so you can not use `save`, `save as` or any `export` features
for the active maya session.(need to restart maya to clean everything up).
The main challange is to keep those dirty mel gru`s away from hacking mbLock so they can`t enable those
features back. To achieve this, mbLock also disables `script editor`, `command line` and
`expression editor`. If you try to open a scene locked with mblock while in prompt mode(maya -prompt)
it kills the Maya process in the memory. Lock will still be active if you try to import or even reference
the locked file in any other scene. So it is quite difficult (but not impossible) to unlock a scene once
it is locked.
Please send your comments and suggestions.
* Also let me know if you can find a way to hack it.I know one, but not going to tell you ;)
Bora,
I saw this question "how to protect a mb file" recently while reading highend3d`s mel section.
I wrote a mel script to do this. Called `mbLock`.
After you lock a scene with mbLock, it is not possible to save or export anything
from the scene anymore. Exciting huh!?
you download these files,
http://homepagez.com/boraddd/mblock.zip
http://homepagez.com/boraddd/sampleLockedFile.zip
http://homepagez.com/boraddd/source_mblock.zip
How to use:
- Open the scene you wish to lock
- type `$bypassLock=1` in command line
- Open up expression editor
- Copy/paste the mblock.mel here
- Hit the Create button
- Now save your scene (make sure you don`t overwrite the orginal scene)
- done.
Everything will go back to normal after you restart Maya
I`ll tell a little more about how it works and what it does for people with strong mel skills.
mbLock works as an expression first of all. It simply replaces some global procedures defined
when Maya boots up with safe(!) ones. so you can not use `save`, `save as` or any `export` features
for the active maya session.(need to restart maya to clean everything up).
The main challange is to keep those dirty mel gru`s away from hacking mbLock so they can`t enable those
features back. To achieve this, mbLock also disables `script editor`, `command line` and
`expression editor`. If you try to open a scene locked with mblock while in prompt mode(maya -prompt)
it kills the Maya process in the memory. Lock will still be active if you try to import or even reference
the locked file in any other scene. So it is quite difficult (but not impossible) to unlock a scene once
it is locked.
Please send your comments and suggestions.
* Also let me know if you can find a way to hack it.I know one, but not going to tell you ;)
Bora,
