Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bl_info = {
- "name": "Origami Symbols",
- "author": "Diego Quevedo",
- "version": (1, 0),
- "blender": (2, 7, 0),
- "location": "View3D > Add > Mesh > New Object",
- "description": "Adds a new Mesh Object used like origami simbols",
- "warning": "",
- "wiki_url": "",
- "category": "Add Mesh"}
- import bpy
- from bpy.types import Operator
- from bpy.props import FloatVectorProperty
- from bpy_extras.object_utils import AddObjectHelper, object_data_add
- from mathutils import Vector
- class addArrowMesh_forward_1(bpy.types.Operator):
- bl_idname = "mesh.primitive_arrow_forward_1"
- bl_label = "Arrow Mesh forward 1"
- bl_options = {'REGISTER', 'UNDO'}
- def execute(self, context):
- try:
- bpy.ops.object.mode_set(mode = 'OBJECT')
- except:
- print("ya en modo objeto")
- try:
- ao = bpy.context.active_object
- ao.select = False
- except:
- print("ningun objeto seleccionado""Arrow_forward_1")
- object = bpy.data.objects.new("Arrow_forward_1", mesh)
- mat = bpy.data.materials['MaterialFlecha1']
- object.data.materials.append(mat)
- object.location = bpy.context.scene.cursor_location
- bpy.context.scene.objects.link(object)
- mesh.from_pydata(verts, [], faces)
- mesh.update(calc_edges=True)
- bpy.ops.object.mode_set(mode = 'EDIT')
- return{'FINISHED'}
- class INFO_MT_mes_custom_menu_add(bpy.types.Menu):
- bl_idname = "INFO_MT_mes_custom_menu_add"
- bl_label = "Custom Menu"
- def draw(self, context):
- layout = self.layout
- layout.operator("mesh.primitive_arrow_forward_1", text="Fold paper forward 1 ");
- # Registration
- def menu_func(self, context):
- self.layout.menu("INFO_MT_mes_custom_menu_add",icon='PLUGIN')
- class Objet_Panel(bpy.types.Panel):
- bl_space_type = "VIEW_3D"
- bl_region_type = "TOOLS"
- #bl_context = "editmode"
- bl_label = "SIMBOLOS"
- bl_category = "ORIGAMI SYMBOLS"
- def draw(self, context):
- layout = self.layout
- layout.operator("mesh.primitive_arrow_forward_1", text="Fold paper forward 1 ");
- def register():
- bpy.utils.register_module(__name__)
- def unregister():
- bpy.utils.unregister_module(__name__)
- if __name__ == "__main__":
- register()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement