I've a recorded script for creating a new raster layer and flood filling it with #808080 (I'm putting it in a code tag below). My problem is that it only works about 70% of the times, or even less (the rest of the time it leaves the layer empty). Any idea why?
Code: Select all
from PSPApp import *
def ScriptProperties():
return {
'Author': u'',
'Copyright': u'',
'Description': u'',
'Host': u'PaintShop Pro',
'Host Version': u'22.00'
}
def Do(Environment):
# EnableOptimizedScriptUndo
App.Do( Environment, 'EnableOptimizedScriptUndo', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((22,0,0),1)
}
})
# New Raster Layer
App.Do( Environment, 'NewRasterLayer', {
'General': {
'Opacity': 100,
'Name': u'Raster 2',
'IsVisible': True,
'IsTransparencyLocked': False,
'LinkSet': 0,
'UseHighlight': False,
'PaletteHighlightColor': (255,255,64),
'GroupLink': True,
'BlendMode': App.Constants.BlendMode.Normal
},
'BlendRanges': {
'BlendRangeGreen': (0,0,255,255,0,0,255,255),
'BlendRangeRed': (0,0,255,255,0,0,255,255),
'BlendRangeBlue': (0,0,255,255,0,0,255,255),
'BlendRangeGrey': (0,0,255,255,0,0,255,255)
},
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((22,0,0),1)
}
})
# Fill
App.Do( Environment, 'Fill', {
'BlendMode': App.Constants.BlendMode.Normal,
'MatchMode': App.Constants.MatchMode.None,
'Material': {
'Color': (128,128,128),
'Pattern': None,
'Gradient': None,
'Texture': None,
'Art': None
},
'UseForeground': True,
'Opacity': 100,
'Point': (1021.5,335.5),
'SampleMerged': False,
'Tolerance': 0,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((22,0,0),1)
}
})
# Layer Properties
App.Do( Environment, 'LayerProperties', {
'General': {
'Opacity': None,
'Name': u'50% Gray',
'IsVisible': None,
'IsTransparencyLocked': None,
'LinkSet': None,
'UseHighlight': None,
'PaletteHighlightColor': None,
'GroupLink': None,
'BlendMode': None
},
'BlendRanges': None,
'Path': (0,0,[],False),
'ArtMediaTexture': None,
'Effects': None,
'BrightnessContrast': None,
'ChannelMixer': None,
'ColorBalance': None,
'CurveParams': None,
'HSL': None,
'Threshold': None,
'Levels': None,
'Posterize': None,
'Vibrancy': None,
'Overlay': None,
'LocalToneMapping': None,
'Invert': None,
'HistogramAdjustment': None,
'FillLightClarity': None,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Silent,
'AutoActionMode': App.Constants.AutoActionMode.Default,
'Version': ((22,0,0),1)
}
})