[Addon] Triangle Faces

Hy there!
I made a small Edit Addon to merge three steps togehter:
Close Face (selected Border) / Inset / Merge to Center

It is similar to Poke, but without the offset move.
And Poke cannot close open border.
Maybe in future Poke can do that as well?

So, here it is:
https://drive.google.com/file/d/0B5QQIWH-54S1Yk5uV0F0WkNaZVE/view?usp=sharing
You find it in the extrude menue [ALT+E]

Thanks mkbreuer, I try it today…
Bye bye
Spirou4D

Nice tool !

I changed it a bit to have what I need.


# ##### BEGIN GPL LICENSE BLOCK #####
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####






bl_info = {
    "name": "Close Faces",
    "author": "MKB, Cedric Lepiller",
    "version": (1, 0),
    "blender": (2, 75, 0),
    "location": "View3D > Editmode > Extrude Menu > ALT+E",
    "description": "Close Faces into the Extrude Menu",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Mesh"}






import bpy




class CloseFaces(bpy.types.Operator):
    """Close Faces"""
    bl_idname = "mesh.close_faces"
    bl_label = "Close Faces"
    bl_options = {'REGISTER', 'UNDO'}
    
    def execute(self, context):
        bpy.ops.mesh.edge_face_add()
        bpy.ops.mesh.inset(thickness=0.07)
        bpy.ops.mesh.poke()
        return {'FINISHED'}




def operator_draw(self,context):
    layout = self.layout
    col = layout.column(align=True)
    col.operator("mesh.close_faces", text="Close Faces")




def register():
    bpy.utils.register_class(CloseFaces)
    bpy.types.VIEW3D_MT_edit_mesh_extrude.append(operator_draw)


def unregister():
    bpy.utils.unregister_class(CloseFaces)
    bpy.types.VIEW3D_MT_edit_mesh_extrude.remove(operator_draw)




if __name__ == "__main__":
    register()

Yes interesting Cédric.
I imagine a popup menu like F6 to choose with or without “add loop”…

The name “close face” is better, indeed!
Congrats Cédric

Yes we could add some settings, but I don’t know how to do that after activating the tool.

Very easy…
I have already make that…here

Je n’ai pas le temps en ce moment mais analyse-le…

Il y a aussi une erreur car ton execute a pour option self et context, c’est bien mais c’est avec eux que tu dois lancer les actions cad que tu utilises context cad l’objet sélectionné pour appliquer une fonction.
Je sais bien que tu as utilisé son script basique mais il faudrait corriger ce point aussi.
Car quand tu utilises l’addon tu est déjà sur un objet sélectionné en mode edit, bien sûr, c’est ça le context.

Ok I will look at this !

And sorry mkb to use your post ^^

It`s ok! I´m great to see that it be useful!!!

further change for both:



bl_info = {
    "name": "Close Faces",
    "author": "MKB, Cedric Lepiller",
    "version": (1, 0),
    "blender": (2, 75, 0),
    "location": "View3D > Editmode > Extrude Menu > ALT+E",
    "description": "Close Faces into the Extrude Menu",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Mesh"}

import bpy

class CloseFaces(bpy.types.Operator):
    """Close Faces"""
    bl_idname = "mesh.close_faces"
    bl_label = "Close Faces"
    bl_options = {'REGISTER', 'UNDO'}
    
    inset = bpy.props.IntProperty(name="Inset", description="How often?", default=0, min=0, soft_max=100, step=1) 

    def execute(self, context):

        bpy.ops.mesh.edge_face_add()
        for i in range(self.inset):       
            bpy.ops.mesh.inset(thickness=0.2)            
        bpy.ops.mesh.poke()
        return {'FINISHED'}

def operator_draw(self,context):
    layout = self.layout
    col = layout.column(align=True)
    col.operator("mesh.close_faces", text="Close Faces")

def register():
    bpy.utils.register_class(CloseFaces)
    bpy.types.VIEW3D_MT_edit_mesh_extrude.append(operator_draw)

def unregister():
    bpy.utils.unregister_class(CloseFaces)
    bpy.types.VIEW3D_MT_edit_mesh_extrude.remove(operator_draw)


if __name__ == "__main__":
    register()