7
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ you can hide the mesh parts you want to protect $\endgroup$
    – lemon
    Commented Jul 4, 2016 at 16:12

3 Answers 3

6
$\begingroup$

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.

enter image description here

$\endgroup$
4
$\begingroup$

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)
    list = {"MESH_OT_delete","MESH_OT_edge_face_add","MESH_OT_split"}
    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.

enter image description here

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$
    – Geo
    Commented Jul 6, 2016 at 21:25
  • $\begingroup$ @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 $\endgroup$
    – user2816
    Commented Jul 7, 2016 at 2:19
1
$\begingroup$

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

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .