-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmove_x.py
More file actions
36 lines (28 loc) · 930 Bytes
/
Copy pathmove_x.py
File metadata and controls
36 lines (28 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# SPDX-FileCopyrightText: © 2016 Michel Anders (varkenvarken) & contributors
#
# SPDX-License-Identifier: GPL-2.0-or-later
bl_info = {
"name": "Simple Move X Operator",
"author": "Your Name",
"version": (0, 0, 1),
"blender": (5, 0, 0),
"location": "Object > Move X",
"description": "Move the active object along the X axis",
"category": "Object",
}
from bpy.types import Operator
class OBJECT_OT_move_x(Operator):
bl_idname = "object.move_x"
bl_label = "Move X"
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
"""Move the active object by 1 unit along the x-axis"""
context.active_object.location.x += 1
return {"FINISHED"}
from bpy.utils import register_class, unregister_class
def register():
register_class(OBJECT_OT_move_x)
def unregister():
unregister_class(OBJECT_OT_move_x)
if __name__ == "__main__":
register()