1
$\begingroup$

I using Blender to edit terrain files that are later exported and used in my game engine. Terrain files there are planes with a fixed number of vertices with consistent spacing between them. I want to somehow be able to lock editing of X and Y coordinates of objects with some certain property on the scene. Is that possible somehow?

I came up with the idea that having a way to somehow check the execution context of bpy.ops.transform.translate would help me, since it is the operator called with specific arguments, so I just could check if X and Y coordinates are zeros, or cancel the operator. Is there any way to hook or wrap this operator?

Or is there any other ways to achieve this goal?

$\endgroup$

1 Answer 1

2
$\begingroup$

Once you start moving an object you can press Z to lock all motion to the z axis (preventing changes in x or y).

https://docs.blender.org/manual/en/dev/editors/3dview/object/editing/transform/control/precision/axis_locking.html

$\endgroup$
1
  • $\begingroup$ I need to lock it permanently, so the user of my addon won't be able to do it. I want a fail-safe solution. $\endgroup$
    – D. Skarn
    Commented Jan 14, 2018 at 19:29

You must log in to answer this question.

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