(2017-08-15, 20:39)Lunatixz Wrote: Hey @badaas any documentation beyond evaluating your demo skin?
I'd really like to incorporate some aspects of this script into my projects, Thanks.
Not atm, just what's here and in adonic.
I'll try document a little each day.
You can enable kodi system->logging->debug logging, then most errors will be posted to kodi.log (as well as standard python errors).
I'm trying to maintain a set of colorbox_* skin.strings for each setting (see top of Utils.py), these need to be init by skin before python can use (afaik may have changed), then any setting will be stored in that for future use.
FIVE_daemon_set, cfa_daemon_set, SEVEN_daemon_set & EIGHT_daemon_set window propertys need to be set to an effect to work (SEVEN can be any garbage as it only makes colors).
They HAVE to be exact effect name (and var name for settings), as they are used to map the functions via a dictionary, see here in default.py:
Code:
ColorBox_function_map = {
'blur': Utils.blur,
'pixelate': Utils.pixelate,
'shiftblock': Utils.shiftblock,
'pixelnone': Utils.pixelnone,
'pixelwaves': Utils.pixelwaves,
'pixelrandom': Utils.pixelrandom,
'pixelfile': Utils.pixelfile,
'pixelfedges': Utils.pixelfedges,
'pixeledges': Utils.pixeledges,
'fakelight': Utils.fakelight,
'twotone': Utils.twotone,
'posterize': Utils.posterize,
'distort': Utils.distort,
'halftone': Utils.halftone,
'dither': Utils.dither,
'dataglitch': Utils.dataglitch}
ColorBox_settings_map = {
'pixelsize': Utils.set_pixelsize,
'bitsize': Utils.set_bitsize,
'blursize': Utils.set_blursize,
'black': Utils.set_black,
'white': Utils.set_white,
'hsv': Utils.set_hsv,
'hls': Utils.set_hls,
'comp': Utils.set_comp,
'bump': Utils.set_bump,
'quality': Utils.set_quality}
I suggest if using daemon, to fire it up on Startup.xml, then delay the settings via AlarmClock. All the settings can be chained in one hit as per eg.
PHP Code:
<onfocus condition="System.HasAddon(script.colorbox)">AlarmClock(nms1,SetProperty(NINE_manual_set,"var=comp,set=fixcomp|var=bump,set=16|var=hsv,set=0;-0.2;0.2|var=hls,set=0.0;
0.7;0.7|var=quality,set=$INFO[Skin.String(colorbox_quality)]|var=blursize,set=$INFO[Skin.String(colorbox_blursize)]|var=bitsize,set=$INFO[Skin.String(colorbox_bitsize)]
|var=pixelsize,set=$INFO[Skin.String(colorbox_pixelsize)]|var=black,set=$INFO[Skin.String(colorbox_black)]|var=white,set=$INFO[Skin.String(colorbox_white)]",home),00:05,true)</onfocus>
Once running all daemon settings done via window property NINE.
You can also RunScript(), chaining all settings (as these will be lost in each namespace ofc.). ie.
PHP Code:
<onload>RunScript(script.colorbox,info=blur,id=$VAR[PICTURE_LOCATION],prefix=mypic1,blursize=1,quality=8)</onload>
more to follow...