Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

i need to get number of angle from drop shadow

Explorer ,
Jan 07, 2020 Jan 07, 2020

 

i need to get number of angle from drop shadow ..i`m making this but i get 90° everytime ..can you help me?

 

         angle =  desc.getDouble( stringIDToTypeID('localLightingAngle'));

 

 

mag.jpg

TOPICS
Actions and scripting
930
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Jan 07, 2020 Jan 07, 2020

You get localLightingAngle (i.e. angle without "use global light" option)

When the "use global light" option is turned on, FX panel shown value from globalLight value of layer, i.e.:

 

function s2t(s) {return stringIDToTypeID(s)}

var ref = new ActionReference()  
ref.putEnumerated( s2t("layer"), s2t("ordinal"), s2t("targetEnum")) 
 
$.writeln ("Global angle is turned on: " + executeActionGet(ref).getObjectValue(s2t("layerEffects")).getObjectValue (s2t("dropShadow")).getBoolean(s2t("useGlobalAngle"
...
Translate
Adobe
Community Expert ,
Jan 07, 2020 Jan 07, 2020

How was the object  "desc" set? If you show that code perhaps r-bin can help.

JJMack
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jan 07, 2020 Jan 07, 2020

You get localLightingAngle (i.e. angle without "use global light" option)

When the "use global light" option is turned on, FX panel shown value from globalLight value of layer, i.e.:

 

function s2t(s) {return stringIDToTypeID(s)}

var ref = new ActionReference()  
ref.putEnumerated( s2t("layer"), s2t("ordinal"), s2t("targetEnum")) 
 
$.writeln ("Global angle is turned on: " + executeActionGet(ref).getObjectValue(s2t("layerEffects")).getObjectValue (s2t("dropShadow")).getBoolean(s2t("useGlobalAngle"))) 
$.writeln ("Local angle of dropShadow FX: " + executeActionGet(ref).getObjectValue(s2t("layerEffects")).getObjectValue (s2t("dropShadow")).getUnitDoubleValue(s2t("localLightingAngle")))
$.writeln ("Global angle of layer FX: " + executeActionGet(ref).getUnitDoubleValue(s2t("globalAngle")))

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 07, 2020 Jan 07, 2020
LATEST

Make it to work faster by using:

 

ref.putProperty(stringIDToTypeID('property'), stringIDToTypeID('layerEffects'))

 

after:

 

var ref = new ActionReference()

 

then before last line such 3 lines use again but with 'layerEffects' replaced by 'globalAngle'

 

btw anyone know why I can see coloured code during posting (when set to JavaScript language) but when I visit the topic with the colored code, it only flicks for one second to turn into grey?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines