Turning off UI functions with Python

I have a very specific need, and I’m not sure it is possible by scripting. I have to give a very simplified 3D editing tool to my users (adding an object and placing it in the scene, no editmesh, no modifiers, no animation, no rendering, etc.) and I was thinking : what if I could take Blender as a basis and remove what I don’t need. Of course, I can do that by editing the source code, but maybe there is a way to do it with Python ?

Any idea or advice ?

Thanks !

I doubt that you could fully block/lock-down the functionality though Python alone. It would probably be fairly easy to just create a custom screen layout that only shows the features that you want. The user would still be able to change the layout to include the other functions if they wanted.

I guess it depends on if it is a hard requirement that there is no way for the user to edit the mesh data or not. If that is a hard requirement then I think you will have to make a custom build of Blender.

you can set up your own default screen with areas arranged to your liking. In addition, most UI panels are python-scripted, so you can edit the scripts and remove buttons etc.

CoDEmanX : Interesting, I didn’t think of that, I’ll give it a look. Thanks !

You can gather a list of every panel class, bpy.utils.unregister_class them. Hold on to references if you want to register them again. AFAIK the only part of the interface you can’t wipe out with this method is those buttons on the top of the property panel.

I dug out an old demo and put it on pasteall:

http://www.pasteall.org/45645/python

that’s right, the property editor isn’t scripted (header and body), the contained panels are however.