Last active
December 12, 2017 16:17
-
-
Save raganmd/79474bcc32f60835a1dc4bc257d14b5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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