Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# me - this DAT
# scriptOp - the OP which is cooking
#
# press 'Setup Parameters' in the OP to call this function to re-create the parameters.
# define where pars is coming from
pars = parent().fetch( 'set_up_attr' )
def setupParameters(scriptOp):
return
# called whenever custom pulse parameter is pushed
def onPulse(par):
return
def cook(scriptOp):
scriptOp.clear()
# insert header row
scriptOp.insertRow( [ 'path', 'parameter', 'value', 'enable' ] )
# loop through dictionary for pars
for key, value in pars.items():
for item_key, item_value in value.items():
scriptOp.appendRow( [ key, item_key, item_value, 1 ] )
# set up parent pars for heigh and width
parent_height = max( [ pars[ 'container_ui' ][ 'h' ], pars[ 'container_led_display' ][ 'h' ] ] )
parent_width = sum( [ pars[ 'container_ui' ][ 'w' ], pars[ 'container_led_display' ][ 'w' ] ] )
scriptOp.appendRow( [ '..', 'w', parent_width, 1 ] )
scriptOp.appendRow( [ '..', 'h', parent_height, 1 ] )
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment