-
1. Re: Questions about brushes
Paul Riggott May 28, 2010 2:27 PM (in response to habaki1)It might be best to have a look at this thread...
-
2. Re: Questions about brushes
habaki1 May 29, 2010 2:16 PM (in response to Paul Riggott)Thank you Paul!
I found this simple script that is enough to access to a lot of infos:
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var Desc = executeActionGet(ref);For instance below is a part of this descriptor: the currentToolOptions (printed with the "actionViewer" script i wrote).
So to get opacity, flow and other properties is no more a problem.
Key[0]:"flow" = Integer(41),
Key[1]:'prVr' = Object(Type='brVr',
Key[0]:'bVTy' = Integer(0),
Key[1]:'fStp' = Integer(25),
Key[2]:"jitter" = UnitDouble(Type="percentUnit", Val=0)
),
Key[2]:'opVr' = Object(Type='brVr',
Key[0]:'bVTy' = Integer(2),
Key[1]:'fStp' = Integer(25),
Key[2]:"jitter" = UnitDouble(Type="percentUnit", Val=0)
),
Key[3]:"mode" = Enumerated(Type="blendMode", Val="normal"),
Key[4]:"opacity" = Integer(43),
Key[5]:"brush" = Object(Type="computedBrush",
Key[0]:"diameter" = UnitDouble(Type="pixelsUnit", Val=13),
Key[1]:"hardness" = UnitDouble(Type="percentUnit", Val=100),
Key[2]:"angle" = UnitDouble(Type="angleUnit", Val=0),
Key[3]:"roundness" = UnitDouble(Type="percentUnit", Val=100),
Key[4]:"spacing" = UnitDouble(Type="percentUnit", Val=25),
Key[5]:"interfaceIconFrameDimmed" = Boolean(true),
Key[6]:"flipX" = Boolean(false),
Key[7]:"flipY" = Boolean(false)
),
Key[6]:"useTipDynamics" = Boolean(true),
Key[7]:"flipX" = Boolean(false),
Key[8]:"flipY" = Boolean(false),
Key[9]:"minimumDiameter" = UnitDouble(Type="percentUnit", Val=0),
Key[10]:"minimumRoundness" = UnitDouble(Type="percentUnit", Val=25),
Key[11]:"tiltScale" = UnitDouble(Type="percentUnit", Val=200),
Key[12]:'szVr' = Object(Type='brVr',
Key[0]:'bVTy' = Integer(2),
Key[1]:'fStp' = Integer(25),
Key[2]:"jitter" = UnitDouble(Type="percentUnit", Val=0)
),
Key[13]:"angleDynamics" = Object(Type='brVr',
Key[0]:'bVTy' = Integer(0),
Key[1]:'fStp' = Integer(25),
Key[2]:"jitter" = UnitDouble(Type="percentUnit", Val=0)
),
Key[14]:"roundnessDynamics" = Object(Type='brVr',
Key[0]:'bVTy' = Integer(0),
Key[1]:'fStp' = Integer(25),
Key[2]:"jitter" = UnitDouble(Type="percentUnit", Val=0)
),
Key[15]:"useScatter" = Boolean(false),
Key[16]:"texture" = Object(Type="pattern",
Key[0]:"name" = String("Canvas"),
Key[1]:"ID" = String("bdc82908-af3b-11d5-9188-9025d38e8e3b")
),
Key[17]:"textureScale" = UnitDouble(Type="percentUnit", Val=100),
Key[18]:"invertTexture" = Boolean(true),
Key[19]:"protectTexture" = Boolean(false),
Key[20]:"useTexture" = Boolean(false),
Key[21]:"dualBrush" = Object(Type="dualBrush",
Key[0]:"useDualBrush" = Boolean(false)
),
Key[22]:"useColorDynamics" = Boolean(false),
Key[23]:"wetEdges" = Boolean(false),
Key[24]:"noise" = Boolean(false),
Key[25]:"smoothing" = Boolean(true),
Key[26]:"usePaintDynamics" = Boolean(false),
Key[27]:"repeat" = Boolean(false),
Key[28]:"foregroundColor" = Object(Type="RGBColor",
Key[0]:"red" = Double(0),
Key[1]:"grain" = Double(0),
Key[2]:"blue" = Double(0)
)The whole descriptor gives 90KB of data, with the current tool, the list of loaded brushes (presetManager), etc.. It is magic.
Unfortunalty, some other important infos seem to not be present, like for instance the name of the current brush.
Is there some other ActionDescriptors to get somewhere ?


