How to script applying or pasting range of ColorPoints,color properties to selected Keyframes&points?
Posted: Tue Jan 26, 2021 3:41 am
Hello Moho Discussion Scripting members and moderators,
&thanks for your generous expertise and pro scripting products.
I hoped anyone familiar or can discern ColorPoints scripting, could please advise writing a script to simultaneously apply or paste a range of ColorPoints, color properties to multiple selected Keyframes &vector points?
(CHRONOLOGY):
From the timeline, a user selected colorpoints layer Color, would provide the initial, single property color, from which a range of lighter or darker cp's colors would be (iteratively)generated, equal in number to the Multiple, user selected cp's (target)keyframes chosen after the initial single, source keyframe color.
(ALGORITHM): ..in VBA but i'll convert to LUA prog.lang. & C API then repost,.
Dim TargetVectorPt as ActivePoint
Dim SourceCPClr as ActiveKeyframe
Dim TargetCPKeysRange as ActiveKeyFrames
Set KF = ColorpointKeyframe
- MsgBox requests user input selection(s) and indication when complete,
- user selects TARGET Vector Points,
- detect selected TARGET Vector Points: TargetVectorPt, [using Iterative fAnimPos AnimVec2?] OR [ScriptInterface:CountSelectedPoints?]
- MsgBox requests user input selection,
- user selects ColorPoint keyframe with SOURCE color,
- detect selected SOURCE Colorpoint keyframe color property: SourceCPClr, [using GetValue LM_ColorVector?]
- create range of lighter\darker cp's colors interating rgb values from SourceCPClr,
- MsgBox requests user input selection(s) and indication when complete,
- user selects ColorPoint TARGET keyframe(s),
- detect TARGET selected Colorpoint keyframe(s): TargetCPKeysRange, [using Iterative GetValue LM_ColorVector?] OR [ScriptInterface:UpdateSelectedChannels?]
- apply\paste each SOURCE color in cp's range into each TARGET keyframe cp's property,.
For Each KF In TargetCPKeysRange
paste SourceCPClr to KF
Next KF
..hope this makes sense, please let know if any clarifications needed.
Thanks again for any equivalent scripting, welcome corrections and suggestions soon as able,
look forward to talk soon,
Jeff
http://mohoscripting.com/classes/M_Point
fColor AnimColor Added in version 11 11.0
fColored bool Added in version 11 11.0
fColorStrength AnimVal Added in version 11 11.0
fSelected bool true if the point is selected, otherwise false
fPos LM_Vector2 the point's current position < 9.5
http://mohoscripting.com/classes/AnimColor
METHODS:
GetValue LM_ColorVector Return the value of this channel at a given frame < 9.5
GetValueByID LM_ColorVector < 9.5
SetValue void Set the value at a given frame < 9.5
SetValue void Set the value at a given frame < 9.5
SetValueByID void < 9.5
SetValueByID void < 9.5
PROPERTIES:
value rgb_color The current value of the channel. < 9.5
M_Point.fSelected - true if the point is selected, otherwise false
ScriptInterface:CountSelectedPoints - Returns the number of selected points in the current vector layer
ScriptInterface:UpdateSelectedChannels - Updates the display of "selected" channels in the timeline
&thanks for your generous expertise and pro scripting products.
I hoped anyone familiar or can discern ColorPoints scripting, could please advise writing a script to simultaneously apply or paste a range of ColorPoints, color properties to multiple selected Keyframes &vector points?
(CHRONOLOGY):
From the timeline, a user selected colorpoints layer Color, would provide the initial, single property color, from which a range of lighter or darker cp's colors would be (iteratively)generated, equal in number to the Multiple, user selected cp's (target)keyframes chosen after the initial single, source keyframe color.
(ALGORITHM): ..in VBA but i'll convert to LUA prog.lang. & C API then repost,.
Dim TargetVectorPt as ActivePoint
Dim SourceCPClr as ActiveKeyframe
Dim TargetCPKeysRange as ActiveKeyFrames
Set KF = ColorpointKeyframe
- MsgBox requests user input selection(s) and indication when complete,
- user selects TARGET Vector Points,
- detect selected TARGET Vector Points: TargetVectorPt, [using Iterative fAnimPos AnimVec2?] OR [ScriptInterface:CountSelectedPoints?]
- MsgBox requests user input selection,
- user selects ColorPoint keyframe with SOURCE color,
- detect selected SOURCE Colorpoint keyframe color property: SourceCPClr, [using GetValue LM_ColorVector?]
- create range of lighter\darker cp's colors interating rgb values from SourceCPClr,
- MsgBox requests user input selection(s) and indication when complete,
- user selects ColorPoint TARGET keyframe(s),
- detect TARGET selected Colorpoint keyframe(s): TargetCPKeysRange, [using Iterative GetValue LM_ColorVector?] OR [ScriptInterface:UpdateSelectedChannels?]
- apply\paste each SOURCE color in cp's range into each TARGET keyframe cp's property,.
For Each KF In TargetCPKeysRange
paste SourceCPClr to KF
Next KF
..hope this makes sense, please let know if any clarifications needed.
Thanks again for any equivalent scripting, welcome corrections and suggestions soon as able,
look forward to talk soon,
Jeff
http://mohoscripting.com/classes/M_Point
fColor AnimColor Added in version 11 11.0
fColored bool Added in version 11 11.0
fColorStrength AnimVal Added in version 11 11.0
fSelected bool true if the point is selected, otherwise false
fPos LM_Vector2 the point's current position < 9.5
http://mohoscripting.com/classes/AnimColor
METHODS:
GetValue LM_ColorVector Return the value of this channel at a given frame < 9.5
GetValueByID LM_ColorVector < 9.5
SetValue void Set the value at a given frame < 9.5
SetValue void Set the value at a given frame < 9.5
SetValueByID void < 9.5
SetValueByID void < 9.5
PROPERTIES:
value rgb_color The current value of the channel. < 9.5
M_Point.fSelected - true if the point is selected, otherwise false
ScriptInterface:CountSelectedPoints - Returns the number of selected points in the current vector layer
ScriptInterface:UpdateSelectedChannels - Updates the display of "selected" channels in the timeline