Created
August 28, 2023 07:15
-
-
Save CGArtPython/cd177a97bd5a8ba13e46dd5375af1b57 to your computer and use it in GitHub Desktop.
Blender Python script that bevels the edges of an active object that is in EDIT mode (see tutorial here: https://youtu.be/TFQMNcTj5Jw)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import bmesh | |
# get a reference to the active object | |
mesh_obj = bpy.context.active_object | |
# create a new bmesh and initialize it from mesh data in Edit Mode | |
bm = bmesh.from_edit_mesh(mesh_obj.data) | |
bmesh.ops.bevel( | |
bm, | |
geom=bm.edges, | |
offset=0.2, | |
segments=4, | |
affect="EDGES", | |
profile=0.5, | |
) | |
bm.normal_update() | |
# writes the bmesh data into the mesh data in Edit Mode | |
bmesh.update_edit_mesh(mesh_obj.data) | |
# clean up/free memory that was allocated for the bmesh | |
bm.free() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment