Adding CurvePoints to existing Curve

Discussion regarding all scripting related questions
Please DO NOT post to this thread anything that is not directly related to scripting of Capture One.

Adding CurvePoints to existing Curve

Postby NN635649772476095761UL » Fri Feb 28, 2020 1:07 pm

It's seems like every image has preexisting curves in C1 with two CurvePoints set by default as a curve is a straight line with two points by default. I'm however now struggling in identifying proper means of adding CurvePoints via JXA or AppleScript. Does anyone have a JXA or AppleScript example on how to add an element?

Thank you in advance.

Michael
NN635649772476095761UL
 
Posts: 1
Joined: Sat Apr 18, 2015 7:07 pm

Re: Adding CurvePoints to existing Curve

Postby dkyeah » Fri May 01, 2020 11:26 pm

Hi Michael,

I'm probably a bit late to answer. But in case you still need the info, here is a sample using AppleScript:

Code: Select all
tell application "Capture One 20"
   set selectedVariants to (get selected variants)
   tell document in front
      -- CHECKS IF ANY VARIANT IS SELECTED
      if selectedVariants is {} then
         display dialog "No selected variant. Please select variants and try again."
      else
         -- LOOP TO APPLY SETTINGS TO ALL SELECTED VARIANTS
         repeat with thisVariant in selectedVariants
            tell adjustments of thisVariant
               
               -- DEFINE VALUES FOR RGB CHANEL
               tell rgb curve
                  
                  -- SET VALUES FOR DEFAULT (0;0) POINT
                  -- !! VALUES ARE DEFINED ON a 0-100 SCALE, NOT 0-255
                  set brightness of first curve point to 0
                  set amount of first curve point to 5
                  
                  make new curve point with properties {brightness:18, amount:14}
                  make new curve point with properties {brightness:50, amount:55}
                  make new curve point with properties {brightness:85, amount:87}
                  
                  -- SET VALUES FOR DEFAULT (100;100) POINT
                  set brightness of last curve point to 100
                  set amount of last curve point to 95
                  
               end tell
               
               -- DEFINE VALUES FOR RED CHANEL
               tell red curve
                  
                  -- SET VALUES FOR DEFAULT (0;0) POINT
                  set brightness of first curve point to 2
                  set amount of first curve point to 0
                  
                  make new curve point with properties {brightness:50, amount:45}
                  
                  -- SET VALUES FOR DEFAULT (100;100) POINT
                  set brightness of last curve point to 100
                  set amount of last curve point to 98
                  
               end tell
            end tell
         end repeat
      end if
   end tell
end tell
dkyeah
 
Posts: 1
Joined: Wed May 21, 2014 12:47 am


Return to Scripting



Who is online

Users browsing this forum: NNN636664127211944167 and 4 guests