The following code snippet will provide the version of the program and place it in the variable 'version'.
VersionInfo = App.Do(Environment, 'GetVersionInfo') version = VersionInfo['MajorVersion']
Insert the snippet after Do(Environment) at the beginning of the script.
def Do(Environment):
The variable 'version' can then be used to set variables for use in the script. For example, to switch between custom brushes.
if version == 9: brush = u'Marble2' elif version == 10: brush = u'Marble2' elif version == 11: brush = u'Corel_01_029' else: brush = u'Corel_01_029'Then, replace the CustomBrush string in the brush command with the 'brush' variable.
# PaintBrush App.Do( Environment, 'PaintBrush', { 'BrushTip': { 'Shape': App.Constants.BrushShape.Custom, 'CustomBrush': brush, 'Size': 500, 'Hardness': 100, 'Step': 32, 'Density': 100, 'Thickness': 100, 'Rotation': 0, 'BrushVariance': { 'SizeVariance': App.Constants.VarianceMethod.Pressure, 'SizeJitter': 0, 'OpacityVariance': App.Constants.VarianceMethod.None, 'OpacityJitter': 0, 'DensityVariance': App.Constants.VarianceMethod.None, 'DensityJitter': 0, 'ThicknessVariance': App.Constants.VarianceMethod.None, 'ThicknessJitter': 0, 'RotationVariance': App.Constants.VarianceMethod.None, 'RotationJitter': 0, 'ColorBlendVariance': App.Constants.VarianceMethod.None, 'ColorBlendJitter': 0, 'HueVariance': App.Constants.VarianceMethod.None, 'HueJitter': 0, 'SaturationVariance': App.Constants.VarianceMethod.None, 'SaturationJitter': 0, 'LightnessVariance': App.Constants.VarianceMethod.None, 'LightnessJitter': 0, 'PositionJitter': 0, 'UseScaledPositionJitter': False, 'ImpressionsPerStep': 1, 'FadeRate': 100 } }, 'Brush': { 'Opacity': 87, 'ContinuousPaint': True, 'WetLookPaint': True, 'BlendMode': App.Constants.BlendMode.Multiply }, 'PrimaryMaterial': App.Constants.MaterialRef.Foreground, 'ForegroundMaterial': { 'Color': (128,128,128), 'Pattern': None, 'Gradient': None, 'Texture': None, 'Art': None }, 'BackgroundMaterial': { 'Color': (128,128,128), 'Pattern': None, 'Gradient': None, 'Texture': None, 'Art': None }, 'Stroke': [ (App.Constants.PathEntryInterpretation.Absolute,(880.5,1680.5),0), (App.Constants.PathEntryInterpretation.Absolute,(880.5,1680.5),188) ], 'GeneralSettings': { 'ExecutionMode': App.Constants.ExecutionMode.Default, 'RandomSeed': 77296609, 'AutoActionMode': App.Constants.AutoActionMode.Match, 'Version': ((12,0,1),1) } })
No comments:
Post a Comment