earthbound19 / _ebDev

Various tools, mostly custom-made for art development.
2 stars 2 forks source link

color_growth.py: breaks on preset with double space #119

Open earthbound19 opened 3 years ago

earthbound19 commented 3 years ago
--WIDTH 256 --HEIGHT 128 --BG_COLOR [162,181,191] --GROWTH_CLIP (1,4)  --CUSTOM_COORDS_AND_COLORS [[(105,10),[162,181,191]],[(238,101),[95,140,163]],[(239,108),[255,239,182]],[(168,12),[255,239,182]],[(188,65),[162,181,191]],[(42,111),[255,182,184]],[(165,10),[95,140,163]],[(198,15),[255,239,182]],[(17,78),[162,181,191]],[(143,5),[196,76,81]],[(46,100),[95,140,163]],[(226,125),[162,181,191]],[(11,33),[162,181,191]],[(189,21),[162,181,191]],[(189,36),[255,182,184]],[(190,92),[255,239,182]],[(14,109),[95,140,163]],[(194,73),[95,140,163]],[(80,106),[255,239,182]],[(203,39),[196,76,81]],[(152,45),[162,181,191]],[(131,20),[255,239,182]],[(188,71),[196,76,81]],[(5,104),[196,76,81]],[(195,122),[196,76,81]],[(222,16),[196,76,81]],[(159,55),[95,140,163]],[(100,127),[95,140,163]],[(31,104),[95,140,163]],[(34,72),[196,76,81]],[(209,92),[255,239,182]],[(255,28),[162,181,191]],[(53,4),[196,76,81]],[(21,38),[255,182,184]],[(182,39),[255,182,184]],[(139,30),[162,181,191]],[(83,22),[95,140,163]],[(153,86),[255,239,182]],[(215,120),[95,140,163]],[(166,46),[255,182,184]],[(136,114),[255,182,184]],[(102,48),[162,181,191]],[(218,90),[255,182,184]],[(7,127),[95,140,163]],[(39,58),[255,239,182]],[(161,29),[196,76,81]],[(181,105),[162,181,191]],[(122,38),[196,76,81]],[(245,47),[255,239,182]],[(10,127),[255,182,184]]]

-- and call color_growth.py with that preset, using this command:

python /path/to/color_growth.py --LOAD_PRESET 50_from_2d7hCwtv__2020_11_16__20_00_58__a76a57.cgp

Expected result: the preset loads and an image is rendered from it.

Actual result: it exits without rendering and without error.

Root cause: the double-space in the --GROWTH_CLIP (1,4) --CUSTOM_COORDS_AND_COLORS portion of the preset. If the double space is reduced to a single space, the expected result happens.

Workaround: don't make presets with double-spaces.

Wanted fix: make color_growth.py work with presets that have extra whitespace in the middle of parameters (check for errors on extra whitespace before and after parameters also).