03-12-2018, 07:57 AM
(03-12-2018, 05:13 AM)dinasset Wrote: Nothing specific, just the way to set the layer's mode is typical of 2.9
About the FG/BG saving/restoring: some times ago I noticed (on 2.8) that the push/pop operations were not enough for them (OK for pattern, font, gradient), hence I specifically added those.
Didn't try yet if that was a temporary bug on 2.8.
Works for me on 2.8.22. Even better, it seems that of you do one context_push() there is an implicit context_pop() at the end:
Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gimpfu import *
def testContext(image,layer):
gimp.context_push()
gimp.set_foreground(0,0,255)
layer.fill(FOREGROUND_FILL)
# gimp.context_pop() # doesn't even seem necessary
register(
'test-context','Test context','Test context',
'','','','Test context','RGB*',
[(PF_IMAGE,'image','Input image', None),(PF_DRAWABLE,'layer','Input layer', None)],[],
testContext,
menu='<Image>/Test'
)
main()