Skip to content

[PPRO] Added missing args and types to ComponentParam and TrackItem #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GreenDuckStudio
Copy link

I fixed the Track item components, replacing any type with the correct Component[] type.

Additionally, I added several missing arguments in the functions of the ComponentParam class.

@GreenDuckStudio
Copy link
Author

Additionally, there are some updateUI arguments that are not documented. I added them in all the places where I know they exist.
Docs

Comment on lines +2031 to +2044
setColorValue(alpha: number, red: number, green: number, blue: number, updateUI: boolean): boolean
/**
* interpolationType must be one of the following:
* 0 KF_Interp_Mode_Linear
* 1 kfInterpMode_EaseIn_Obsolete
* 2 kfInterpMode_EaseOut_Obsolete
* 3 kfInterpMode_EaseInEaseOut_Obsolete
* 4 KF_Interp_Mode_Hold
* 5 KF_Interp_Mode_Bezier
* 6 KF_Interp_Mode_Time
* 7 kfInterpMode_TimeTransitionStart
* 8 kfInterpMode_TimeTransitionEnd
* */
setInterpolationTypeAtKey(time: Time, interpolationType: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8, updateUI?: boolean): boolean

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead create an enum conforming to the TIME_FORMAT:

declare enum INTERPOLATION_TYPE {
  KFINTERPMODE_Linear,
  KFINTERPMODE_EaseIn_Obsolete,
  KFINTERPMODE_EaseOut_Obsolete,
  KFINTERPMODE_EaseInEaseOut_Obsolete,
  KFINTERPMODE_Hold,
  KFINTERPMODE_Bezier,
  KFINTERPMODE_Time,
  KFINTERPMODE_TimeTransitionStart,
  KFINTERPMODE_TimeTransitionEnd,
}

And then use it in the parameter type:

setInterpolationTypeAtKey(time: Time, interpolationType: INTERPOLATION_TYPE, updateUI?: boolean): boolean

@@ -1250,7 +1250,7 @@ declare class TrackItem {
/**
*
*/
readonly components: any
readonly components: Component[]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
readonly components: Component[]
readonly components: ComponentCollection

setValue(value: any, updateUI?: boolean): boolean
setValueAtKey(): boolean
setValueAtKey(time: Time, value: any, updateUI: boolean): boolean

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
setValueAtKey(time: Time, value: any, updateUI: boolean): boolean
setValueAtKey(time: Time, value: any, updateUI?: boolean): boolean

Comment on lines +2015 to +2018
/**
* threshold in ticks
*/
findNearestKey(timeToCheck: Time, threshold: number): object

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the comment, and ticks usually come as string if I'm not mistaken

Suggested change
/**
* threshold in ticks
*/
findNearestKey(timeToCheck: Time, threshold: number): object
findNearestKey(timeToCheck: Time, thresholdInTicks: string): object

* threshold in ticks
*/
findNearestKey(timeToCheck: Time, threshold: number): object
findNextKey(timeToCheck: Time): object

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time to check doesn't add much context / explanation. Better to leave it as time

Suggested change
findNextKey(timeToCheck: Time): object
findNextKey(time: Time): object

*/
findNearestKey(timeToCheck: Time, threshold: number): object
findNextKey(timeToCheck: Time): object
findPreviousKey(timeToCheck: Time): object

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
findPreviousKey(timeToCheck: Time): object
findPreviousKey(time: Time): object

getColorValue(): any[]
getKeys(): any[]
getValue(): any
getValueAtKey(): any
getValueAtTime(): any
getValueAtKey(timeToCheck: Time): any

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
getValueAtKey(timeToCheck: Time): any
getValueAtKey(time: Time): any

@zlovatt
Copy link
Member

zlovatt commented Oct 15, 2024

For both the initial PR and the suggested changes:

Did these only get added to the API in PPro 15.0? If not, please make sure these are included in all of the appropriate typedefs, not just the latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants