<s> import os <EOL> import bpy <EOL> from stalker import Project , Task , Version , Sequence , Shot <EOL> from anima import logger <EOL> bl_info = { <EOL> "<STR_LIT:name>" : "<STR_LIT>" , <EOL> "<STR_LIT:description>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:version>" : ( <NUM_LIT:0> , <NUM_LIT:1> ) , <EOL> "<STR_LIT>" : ( <NUM_LIT:2> , <NUM_LIT> , <NUM_LIT:0> ) , <EOL> "<STR_LIT:location>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> idname_template = '<STR_LIT>' <EOL> registered_menus = [ ] <EOL> output_types = { <EOL> '<STR_LIT:image>' : [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> } <EOL> class StripGenerator ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> pass <EOL> def add_from_task ( self , task ) : <EOL> """<STR_LIT>""" <EOL> if not task : <EOL> return <EOL> repo = task . project . repository <EOL> versions = Version . query . filter ( Version . task == task ) . order_by ( Version . version_number . desc ( ) ) . all ( ) <EOL> found_output = False <EOL> for v in versions : <EOL> if len ( v . outputs ) : <EOL> for output in v . outputs : <EOL> output_absolute_full_path = os . path . expandvars ( <EOL> output . full_path <EOL> ) <EOL> self . add_output ( output_absolute_full_path ) <EOL> found_output = True <EOL> break <EOL> if found_output : <EOL> break <EOL> def add_output ( self , full_path , name = None , channel = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> logger . debug ( '<STR_LIT>' % full_path ) <EOL> extension = os . path . splitext ( full_path ) [ - <NUM_LIT:1> ] . lower ( ) <EOL> logger . debug ( '<STR_LIT>' % extension ) <EOL> output_type = None <EOL> for key in output_types . keys ( ) : <EOL> if extension in output_types [ key ] : <EOL> output_type = key <EOL> break <EOL> if output_type == '<STR_LIT:image>' : <EOL> logger . debug ( '<STR_LIT>' ) <EOL> bpy . ops . sequencer . image_strip_add ( <EOL> directory = os . path . dirname ( full_path ) , <EOL> files = [ <EOL> { <EOL> "<STR_LIT:name>" : os . path . basename ( full_path ) , <EOL> } <EOL> ] , <EOL> relative_path = True , <EOL> frame_start = <NUM_LIT:1> , <EOL> frame_end = <NUM_LIT> , <EOL> channel = channel <EOL> ) <EOL> elif output_type == '<STR_LIT>' : <EOL> logger . debug ( '<STR_LIT>' ) <EOL> logger . debug ( '<STR_LIT>' % full_path ) <EOL> bpy . ops . sequencer . movie_strip_add ( <EOL> filepath = full_path , <EOL> files = [ <EOL> { <EOL> "<STR_LIT:name>" : os . path . basename ( full_path ) , <EOL> } <EOL> ] , <EOL> relative_path = True , <EOL> frame_start = <NUM_LIT:1> , <EOL> channel = channel <EOL> ) <EOL> else : <EOL> logger . debug ( '<STR_LIT>' % output_type ) <EOL> def storyboard ( self , task ) : <EOL> """<STR_LIT>""" <EOL> storyboard = Task . query . filter ( Task . parent == task ) . filter ( Task . name == '<STR_LIT>' ) . first ( ) <EOL> self . add_from_task ( storyboard ) <EOL> def previs ( self , task ) : <EOL> """<STR_LIT>""" <EOL> previs = Task . query . filter ( Task . parent == task ) . filter ( Task . name == '<STR_LIT>' ) . first ( ) <EOL> self . add_from_task ( previs ) <EOL> def animation ( self , task ) : <EOL> """<STR_LIT>""" <EOL> animation = Task . query . filter ( Task . parent == task ) . filter ( Task . name == '<STR_LIT>' ) . first ( ) <EOL> self . add_from_task ( animation ) <EOL> def lighting ( self , task ) : <EOL> """<STR_LIT>""" <EOL> animation = Task . query . filter ( Task . parent == task ) . filter ( Task . name == '<STR_LIT>' ) . first ( ) <EOL> self . add_from_task ( animation ) <EOL> def comp ( self , task ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class StalkerMenu ( bpy . types . Menu ) : <EOL> """<STR_LIT>""" <EOL> bl_label = "<STR_LIT>" <EOL> bl_idname = '<STR_LIT>' <EOL> def draw ( self , context ) : <EOL> layout = self . layout <EOL> layout . operator_context = '<STR_LIT>' <EOL> layout . menu ( StalkerAddFromProjectMenu . bl_idname , <EOL> text = "<STR_LIT>" ) <EOL> def draw_stalker_entity_menu_item ( self , context ) : <EOL> """<STR_LIT>""" <EOL> logger . debug ( '<STR_LIT>' % self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % self . stalker_entity_name ) <EOL> def draw_stalker_project_menu_item ( self , context ) : <EOL> """<STR_LIT>""" <EOL> logger . debug ( '<STR_LIT>' % self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % self . stalker_entity_name ) <EOL> layout = self . layout <EOL> project = Project . query . get ( self . stalker_entity_id ) <EOL> all_seqs = Sequence . query . filter ( Sequence . project == project ) . order_by ( Sequence . name ) . all ( ) <EOL> for seq in all_seqs : <EOL> idname = idname_template % ( seq . entity_type , seq . id ) <EOL> layout . menu ( idname , text = seq . name ) <EOL> def draw_stalker_sequence_menu_item ( self , context ) : <EOL> """<STR_LIT>""" <EOL> logger . debug ( '<STR_LIT>' % self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % self . stalker_entity_name ) <EOL> layout = self . layout <EOL> seq = Sequence . query . get ( self . stalker_entity_id ) <EOL> for scene in sorted ( seq . children , key = lambda x : x . name ) : <EOL> idname = idname_template % ( scene . entity_type , scene . id ) <EOL> layout . menu ( idname , text = scene . name ) <EOL> def draw_stalker_scene_menu_item ( self , context ) : <EOL> """<STR_LIT>""" <EOL> logger . debug ( '<STR_LIT>' % self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % self . stalker_entity_name ) <EOL> layout = self . layout <EOL> scene = Task . query . get ( self . stalker_entity_id ) <EOL> op = layout . operator ( <EOL> StalkerSceneAddEverythingOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = scene . id <EOL> op . stalker_entity_name = scene . name <EOL> layout . separator ( ) <EOL> op = layout . operator ( <EOL> StalkerSceneAddStoryboardOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = scene . id <EOL> op . stalker_entity_name = scene . name <EOL> op = layout . operator ( <EOL> StalkerSceneAddPrevisOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = scene . id <EOL> op . stalker_entity_name = scene . name <EOL> layout . separator ( ) <EOL> idname = '<STR_LIT>' % ( <EOL> idname_template % ( scene . entity_type , scene . id ) , <EOL> '<STR_LIT>' <EOL> ) <EOL> layout . menu ( idname ) <EOL> def draw_stalker_scene_add_from_shots_menu_item ( self , context ) : <EOL> """<STR_LIT>""" <EOL> logger . debug ( '<STR_LIT>' % self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % self . stalker_entity_name ) <EOL> layout = self . layout <EOL> scene = Task . query . get ( self . stalker_entity_id ) <EOL> op = layout . operator ( <EOL> StalkerSceneAddAllShotOutputsOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = scene . id <EOL> op . stalker_entity_name = scene . name <EOL> layout . separator ( ) <EOL> op = layout . operator ( <EOL> StalkerSceneAddAllShotPrevisOutputsOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = scene . id <EOL> op . stalker_entity_name = scene . name <EOL> op = layout . operator ( <EOL> StalkerSceneAddAllShotAnimationOutputsOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = scene . id <EOL> op . stalker_entity_name = scene . name <EOL> op = layout . operator ( <EOL> StalkerSceneAddAllShotLightingOutputsOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = scene . id <EOL> op . stalker_entity_name = scene . name <EOL> op = layout . operator ( <EOL> StalkerSceneAddAllShotCompOutputsOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = scene . id <EOL> op . stalker_entity_name = scene . name <EOL> layout . separator ( ) <EOL> shots_task = Task . query . filter ( Task . parent == scene ) . filter ( Task . name == '<STR_LIT>' ) . first ( ) <EOL> if shots_task : <EOL> for shot in shots_task . children : <EOL> idname = idname_template % ( shot . entity_type , shot . id ) <EOL> layout . menu ( idname ) <EOL> def draw_stalker_shot_menu_item ( self , context ) : <EOL> """<STR_LIT>""" <EOL> logger . debug ( '<STR_LIT>' % self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % self . stalker_entity_name ) <EOL> layout = self . layout <EOL> shot = Shot . query . get ( self . stalker_entity_id ) <EOL> op = layout . operator ( <EOL> StalkerShotAddAllTaskOutputsOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = self . stalker_entity_id <EOL> op . stalker_entity_name = self . stalker_entity_name <EOL> layout . separator ( ) <EOL> op = layout . operator ( <EOL> StalkerShotAddPrevisOutputOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = self . stalker_entity_id <EOL> op . stalker_entity_name = self . stalker_entity_name <EOL> op = layout . operator ( <EOL> StalkerShotAddAnimationOutputOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = self . stalker_entity_id <EOL> op . stalker_entity_name = self . stalker_entity_name <EOL> op = layout . operator ( <EOL> StalkerShotAddLightingOutputOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = self . stalker_entity_id <EOL> op . stalker_entity_name = self . stalker_entity_name <EOL> op = layout . operator ( <EOL> StalkerShotAddCompOutputOperator . bl_idname , <EOL> text = '<STR_LIT>' <EOL> ) <EOL> op . stalker_entity_id = self . stalker_entity_id <EOL> op . stalker_entity_name = self . stalker_entity_name <EOL> class StalkerAddFromProjectMenu ( bpy . types . Menu ) : <EOL> """<STR_LIT>""" <EOL> bl_label = "<STR_LIT>" <EOL> bl_idname = "<STR_LIT>" <EOL> def draw ( self , context ) : <EOL> layout = self . layout <EOL> for project in Project . query . order_by ( Project . name ) . all ( ) : <EOL> idname = '<STR_LIT>' % ( project . entity_type , project . id ) <EOL> layout . menu ( idname ) <EOL> class StalkerSceneAddEverythingOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> scene = Task . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % scene ) <EOL> strip_gen = StripGenerator ( ) <EOL> strip_gen . storyboard ( scene ) <EOL> strip_gen . previs ( scene ) <EOL> strip_gen . animation ( scene ) <EOL> strip_gen . lighting ( scene ) <EOL> strip_gen . comp ( scene ) <EOL> for task in scene . walk_hierarchy ( ) : <EOL> if isinstance ( task , Shot ) : <EOL> animation_task = Task . query . filter ( Task . parent_id == task . id ) . filter ( Task . name == '<STR_LIT>' ) . first ( ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> class StalkerSceneAddStoryboardOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> scene = Task . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % scene ) <EOL> strip_gen = StripGenerator ( ) <EOL> strip_gen . storyboard ( scene ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> class StalkerSceneAddPrevisOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> scene = Task . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % scene ) <EOL> strip_gen = StripGenerator ( ) <EOL> strip_gen . previs ( scene ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> class StalkerSceneAddAllShotOutputsOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> scene = Task . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % scene ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> class StalkerSceneAddAllShotPrevisOutputsOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> scene = Task . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % scene ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> class StalkerSceneAddAllShotAnimationOutputsOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> scene = Task . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % scene ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> class StalkerSceneAddAllShotLightingOutputsOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> scene = Task . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % scene ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> class StalkerSceneAddAllShotCompOutputsOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> scene = Task . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % scene ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> class StalkerShotAddAllTaskOutputsOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> shot = Shot . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % shot ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> class StalkerShotAddPrevisOutputOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> shot = Shot . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % shot ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> class StalkerShotAddAnimationOutputOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> shot = Shot . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % shot ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> class StalkerShotAddLightingOutputOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> shot = Shot . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % shot ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> class StalkerShotAddCompOutputOperator ( bpy . types . Operator ) : <EOL> """<STR_LIT>""" <EOL> bl_label = '<STR_LIT>' <EOL> bl_idname = '<STR_LIT>' <EOL> stalker_entity_id = bpy . props . IntProperty ( name = '<STR_LIT>' ) <EOL> stalker_entity_name = bpy . props . StringProperty ( name = '<STR_LIT>' ) <EOL> def execute ( self , context ) : <EOL> logger . debug ( '<STR_LIT>' % self . __class__ . __name__ ) <EOL> shot = Shot . query . get ( self . stalker_entity_id ) <EOL> logger . debug ( '<STR_LIT>' % shot ) <EOL> return set ( [ '<STR_LIT>' ] ) <EOL> def draw_stalker_menu ( self , context ) : <EOL> layout = self . layout <EOL> layout . menu ( StalkerMenu . bl_idname ) <EOL> def generate_op_class ( entity , <EOL> draw = draw_stalker_entity_menu_item , <EOL> idpostfix = '<STR_LIT>' , <EOL> label = None ) : <EOL> """<STR_LIT>""" <EOL> idname = '<STR_LIT>' % ( <EOL> idname_template % ( entity . entity_type , entity . id ) , <EOL> idpostfix <EOL> ) <EOL> return type ( <EOL> idname , <EOL> ( bpy . types . Menu , ) , <EOL> { <EOL> '<STR_LIT>' : idname , <EOL> '<STR_LIT>' : label if label else entity . name , <EOL> '<STR_LIT>' : entity . id , <EOL> '<STR_LIT>' : entity . entity_type , <EOL> '<STR_LIT>' : entity . name , <EOL> '<STR_LIT>' : draw <EOL> } <EOL> ) <EOL> def register ( ) : <EOL> """<STR_LIT>""" <EOL> from anima . utils import do_db_setup <EOL> do_db_setup ( ) <EOL> for project in Project . query . order_by ( Project . name ) . all ( ) : <EOL> opclass = generate_op_class ( <EOL> project , <EOL> draw = draw_stalker_project_menu_item <EOL> ) <EOL> bpy . utils . register_class ( opclass ) <EOL> registered_menus . append ( opclass ) <EOL> all_seqs = Sequence . query . filter ( Sequence . project == project ) . order_by ( Sequence . name ) . all ( ) <EOL> for seq in all_seqs : <EOL> opclass = generate_op_class ( <EOL> seq , <EOL> draw = draw_stalker_sequence_menu_item <EOL> ) <EOL> bpy . utils . register_class ( opclass ) <EOL> registered_menus . append ( opclass ) <EOL> for sce in seq . children : <EOL> opclass = generate_op_class ( <EOL> sce , <EOL> draw = draw_stalker_scene_menu_item <EOL> ) <EOL> bpy . utils . register_class ( opclass ) <EOL> registered_menus . append ( opclass ) <EOL> opclass = generate_op_class ( <EOL> sce , <EOL> draw = draw_stalker_scene_add_from_shots_menu_item , <EOL> idpostfix = '<STR_LIT>' , <EOL> label = '<STR_LIT>' <EOL> ) <EOL> bpy . utils . register_class ( opclass ) <EOL> registered_menus . append ( opclass ) <EOL> for shot in Shot . query . filter ( Shot . project == project ) . all ( ) : <EOL> opclass = generate_op_class ( <EOL> shot , <EOL> draw = draw_stalker_shot_menu_item <EOL> ) <EOL> bpy . utils . register_class ( opclass ) <EOL> registered_menus . append ( opclass ) <EOL> bpy . utils . register_class ( StalkerMenu ) <EOL> bpy . utils . register_class ( StalkerAddFromProjectMenu ) <EOL> bpy . utils . register_class ( StalkerSceneAddEverythingOperator ) <EOL> bpy . utils . register_class ( StalkerSceneAddStoryboardOperator ) <EOL> bpy . utils . register_class ( StalkerSceneAddPrevisOperator ) <EOL> bpy . utils . register_class ( StalkerSceneAddAllShotOutputsOperator ) <EOL> bpy . utils . register_class ( StalkerSceneAddAllShotPrevisOutputsOperator ) <EOL> bpy . utils . register_class ( StalkerSceneAddAllShotAnimationOutputsOperator ) <EOL> bpy . utils . register_class ( StalkerSceneAddAllShotLightingOutputsOperator ) <EOL> bpy . utils . register_class ( StalkerSceneAddAllShotCompOutputsOperator ) <EOL> bpy . utils . register_class ( StalkerShotAddAllTaskOutputsOperator ) <EOL> bpy . utils . register_class ( StalkerShotAddPrevisOutputOperator ) <EOL> bpy . utils . register_class ( StalkerShotAddAnimationOutputOperator ) <EOL> bpy . utils . register_class ( StalkerShotAddLightingOutputOperator ) <EOL> bpy . utils . register_class ( StalkerShotAddCompOutputOperator ) <EOL> bpy . types . SEQUENCER_MT_add . append ( draw_stalker_menu ) <EOL> def unregister ( ) : <EOL> """<STR_LIT>""" <EOL> bpy . utils . unregister_class ( StalkerMenu ) <EOL> bpy . utils . unregister_class ( StalkerAddFromProjectMenu ) <EOL> bpy . utils . unregister_class ( StalkerSceneAddEverythingOperator ) <EOL> bpy . utils . unregister_class ( StalkerSceneAddStoryboardOperator ) <EOL> bpy . utils . unregister_class ( StalkerSceneAddPrevisOperator ) <EOL> bpy . utils . unregister_class ( StalkerSceneAddAllShotOutputsOperator ) <EOL> bpy . utils . unregister_class ( StalkerSceneAddAllShotPrevisOutputsOperator ) <EOL> bpy . utils . unregister_class ( StalkerSceneAddAllShotAnimationOutputsOperator ) <EOL> bpy . utils . unregister_class ( StalkerSceneAddAllShotLightingOutputsOperator ) <EOL> bpy . utils . unregister_class ( StalkerSceneAddAllShotCompOutputsOperator ) <EOL> bpy . utils . unregister_class ( StalkerShotAddPrevisOutputOperator ) <EOL> bpy . utils . unregister_class ( StalkerShotAddAnimationOutputOperator ) <EOL> bpy . utils . unregister_class ( StalkerShotAddLightingOutputOperator ) <EOL> bpy . utils . unregister_class ( StalkerShotAddCompOutputOperator ) <EOL> for opclass in registered_menus : <EOL> bpy . utils . unregister_class ( opclass ) <EOL> bpy . types . SEQUENCER_MT_add . remove ( draw_stalker_menu ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> register ( ) </s>
