Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.49 KB | None | 0 0
  1. import bpy
  2.  
  3. def act_strip(context):
  4.     try:
  5.         return context.scene.sequence_editor.active_strip
  6.     except AttributeError:
  7.         return None
  8.    
  9. class StripSettings(bpy.types.PropertyGroup):
  10.     bpy.types.ImageSequence.fakeinput1 = bpy.props.PointerProperty(name="Input 1", type=bpy.types.Sequences)
  11.    
  12. class LayoutDemoPanel( bpy.types.Panel):
  13.     bl_label = "Offset"
  14.     bl_options = {'DEFAULT_CLOSED'}
  15.     bl_category = "Strip"
  16.     bl_space_type = 'SEQUENCE_EDITOR'
  17.     bl_region_type = 'UI'
  18.  
  19.     @staticmethod
  20.     def has_sequencer(context):
  21.         return (context.space_data.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'})
  22.    
  23.     @classmethod
  24.     def poll(cls, context):
  25.         return cls.has_sequencer(context) and (act_strip(context) is not None)
  26.  
  27.     def draw_header(self, context):
  28.         strip = act_strip(context)
  29.         self.layout.prop(strip, "use_translation", text="")
  30.  
  31.     def draw(self, context):
  32.         strip = act_strip(context)
  33.         layout = self.layout
  34.         layout.use_property_split = True
  35.  
  36.         layout.active = strip.use_translation and (not strip.mute)
  37.  
  38.         col = layout.column(align=True)
  39.         col.prop(strip, "fakeinput1")
  40.  
  41.  
  42.    
  43.    
  44. def register():
  45.    
  46.     bpy.utils.register_class(CrossfadeStripSettings)
  47.     bpy.utils.register_class(LayoutDemoPanel)
  48.  
  49.  
  50.  
  51. def unregister():
  52.     bpy.utils.unregister_class(LayoutDemoPanel)
  53.     bpy.utils.unregister_class(StripSettings)
  54.  
  55. if __name__ == "__main__":
  56.     register()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement