Skip to content

Instantly share code, notes, and snippets.

Forked from anonymous/
Created April 26, 2014 15:11
Show Gist options
  • Save zeffii/11322528 to your computer and use it in GitHub Desktop.
Save zeffii/11322528 to your computer and use it in GitHub Desktop.
import bpy
import os
from bpy.props import EnumProperty
class SvTextSubMenu(bpy.types.Menu):
bl_idname = "TEXT_MT_templates_submenu"
bl_label = "Select"
def avail_templates(self, context):
sv_path = os.path.dirname(os.path.realpath(__file__))
script_dir = "node_script_templates"
path = os.path.join(sv_path, script_dir)
items = [(t, t, "") for t in next(os.walk(path))[2]]
return items
files_popup = EnumProperty(
description='choose file to load as template')
def draw(self, context):
layout = self.layout
# layout.prop(self, 'txt.files_popup', '')
#layout.operator("object.select_all", text="Select/Deselect All")
# access this operator as a submenu
# "object.select_by_type", "type", text="Select All by Type...")
# "node.object.select_by_type", "type", text="Select All by Type...")
#row.operator('node.sverchok_script_template', text='Template')
for i in [2,3,4,5]:#self.avail_templates(self, context):
# print(i)
layout.operator("object.select_all", text="Select/Deselect All")
def menu_draw(self, context):"TEXT_MT_templates_submenu")
def register():
def unregister():
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment