Hello,
I would like to implement a persistent edge borders display in blender.
There are some requests in rightclickselect but no one took it up so I decided to take it up myself.
Here is my post:
And here’s another one thats 4 years old.
I could get started and try it out but it would be much faster if someone could point me in the right direction as I don’t wanna spend too much time on this feature in C. I am comfortable with C programming but unfamiliar with the Blender source code.
I basically wanna add a new Mesh Edit Mode display called Border
Mesh Edit Mode
Creases | Sharp | Bevel | Seams | Border
It should persistently show the mesh borders like so:
I currently made a hacky prototype with python and it works fine but I have to manually update it and lose my selection:
import bpy
def main(context):
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.mark_seam(clear=True)
bpy.ops.mesh.select_all(action='DESELECT')
bpy.ops.mesh.select_non_manifold()
bpy.ops.mesh.mark_seam(clear=False)
bpy.ops.mesh.select_all(action='DESELECT')
class ToggleBorder(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.toggle_border"
bl_label = "Toggle Border Operator"
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
main(context)
return {'FINISHED'}
def menu_func(self, context):
self.layout.operator(ToggleBorder.bl_idname, text=ToggleBorder.bl_label)
# Register and add to the "object" menu (required to also use F3 search "Simple Object Operator" for quick access).
def register():
bpy.utils.register_class(ToggleBorder)
bpy.types.VIEW3D_MT_object.append(menu_func)
def unregister():
bpy.utils.unregister_class(ToggleBorder)
bpy.types.VIEW3D_MT_object.remove(menu_func)
if __name__ == "__main__":
register()
# test call
bpy.ops.object.toggle_border()
I already have blender running with Visual Studio 2022 ready for programming, just want someone to give me hints to speed things up please.
Thank you so much!