Create a menu from work items?

   977   0   1
User Avatar
Member
35 posts
Joined: Dec. 2012
Offline
Hi all, Is it possible to create a menu from work items. I have created a list from the work items using a python script top but I'm not sure how to go about creating a normal menu from this list any ideas or is this even possible?

import os
import sys
import hou
import time
import itertools

def generate_menu():
    
    menu_item = []
    array_paths = work_item.attribArray("full_path")
    array_dirs  = work_item.attribArray("filename")
    
    
    for path, dir in itertools.izip(array_paths, array_dirs):
        menu_item.append(path)
        menu_item.append(dir)
    
    return menu_item
  • Quick Links