Protecting a mesh from accidental edits

When doing animations most of the vast power of Blender is wasted due to being counter-productive. For example, if you want to move some vertices and accidentally type F instead of G you may not get any visual indication of the problem you have created because it could be entirely internal to the mesh. If you press Y at the appropriate time it will lock a transformation onto the Y axis, but if you accidentally press Y at the wrong time it will invisibly break your mesh.

The question is: if you know for a fact that the edges, vertices, and faces of a mesh are all exactly connected in the right way, what is the best practice to prevent those things from accidentally changing? To be clear, I don't want to disable these operators in such a way that it is troublesome to enable them. I just want to disable them while I'm animating. A way to quickly turn mesh editing on and off would be ideal. I also don't want to completely disable editing of any particular object, because that would prevent me from animating the vertices of the object and creating shape keys. I just want the appropriate operators to be available at the appropriate times based on my current task.

Unless there is some feature of Blender that I am missing, I suspect that the solution will be along the lines of this answer: Prevent (accidental) deletion of object. There we register a class with the bl_idname of an existing operator to replace that operator with a safer version. In my case I would want to somehow preserve the original operators so we can call them when it is safe rather than attempting to replicate their behavior. Ideally we would have it so that we just create a list of operator names and a for-loop can handle registration and overriding of each listed operator.

• you can hide the mesh parts you want to protect Jul 4 '16 at 16:12

yes, make the mesh a group and put the original on a different layer.

Then create a group instance on the layer you want to make the edits and move it to be right over the armature.

Now you animate without being able to go into edit mode because its a group instance.

And if you want to edit the mesh in edit mode, you can edit the original and all group instances get updated automatically.

this is just an idea, but you can monitor the operations you perform on your mesh and alert you when you do an undesired operation,for example by keeping a list of operation you don't want and notify you when they do happen.

import bpy

def monitor(self, context):
layout = self.layout
c = layout.column(align=True)
state = "Good"
last_op = str(bpy.context.window_manager.operators[-1].properties)
for ops in list:
if ops in last_op:
state = "Stop"
c.label(text="State : " + state)

def register():
bpy.types.VIEW3D_PT_view3d_name.append(monitor)
def unregister():
bpy.types.VIEW3D_PT_view3d_name.remove(monitor)
if __name__ == "__main__":
register()


this only detects deletion,making faces and splitting , but you can add more unwanted operations to the list.
This doesn't do much , i'll update when i have more time and learn a bit more,but it should be possible to play a soundfile or display some kind of warning , and a checkbox to disable this when you don't need it.

• Maybe using operators[-1].bl_idname would be better, but how does one find the bl_idname of an operator so it can be added to the list? The mouse-over text gives us something like "bpy.ops.mesh.split()" so how are we supposed to know about "MESH_OT_split"? That would be a good explanation to add.
– Geo
Jul 6 '16 at 21:25
• @Geo I used print(bpy.context.window_manager.operators[-1].properties) in the python console right after doing each of those 3 operations, i don't know the right way to get them
– user2816
Jul 7 '16 at 2:19

Apart from locking the object in the outliner, I'm not aware of something that can disable editing on a per object basis :/