Code: Select all
// LayerColorPick.grg
// Svengali - April 2013
// get current layer ID
tv_layergetid = "Color Shape Objects"
iLayerId = result
tv_PicColor // display pointer for user to pick color of pixel
tv_GetMouse // get X and Y where user just clicked
parse result MX MY
tv_GetPixelLayer "Color Shape Objects" MX MY // read the RGBA values for the current layer
parse result PR PG PB PA
//tv_warn "Pr Pg Pb Pa = " PR PG PB PA
IF (PR == 0) && (PG == 0) && (PB == 0) && (PA == 00) // IF R G B AND A are all zero then the pixel is transparent
tv_NOP // don't do anything leaving original APen color
ELSE
tv_SetAPen PR PG PB // otherwise set the APen color
END
I think TVPaint Command list needs more example. Without any any examples it seems very confusing. What does oLayerId mean? What does iLayerPosition mean? What does "i" and "o" mean? It so confusing without any examples.