Skip to content

Instantly share code, notes, and snippets.

@p2or
Last active May 22, 2023 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save p2or/1f2b725a8c25ce82d69c to your computer and use it in GitHub Desktop.
Save p2or/1f2b725a8c25ce82d69c to your computer and use it in GitHub Desktop.
Edit HueCurveModifier #Blender #BSE
# for http://blender.stackexchange.com/questions/46784/can-python-access-control-points-of-hue-modifier
import bpy
# get the scene
scn = bpy.context.scene
# get the clip
act_strip = scn.sequence_editor.active_strip
# get the hue correct modifier
hue_modifier = act_strip.modifiers["Hue Correct"]
# get the mapping
# .../bpy.types.CurveMapping.html#bpy.types.CurveMapping
mapping = hue_modifier.curve_mapping
# get the curve maps
# .../bpy.types.CurveMap.html#bpy.types.CurveMap
hue, sat, val = mapping.curves
# iterate through saturation curve points
for count, point in enumerate(sat.points):
x, y = point.location
# desaturate blue
if 0.55 <= x <= 0.7: # check if x is within blue range
point.location.y = 0.01
# print the points
print (count, point.location)
# direct assignment via index operator
#sat.points[5].location[1] = 0 # desaturate blue
# update the curve
# ../bpy.types.CurveMapping.html#bpy.types.CurveMapping.update
mapping.update()
# force viewer update (optional)
hue_modifier.mute = True
hue_modifier.mute = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment