props ¶
Functions:
-
get_clip_filepath
–Helper function to get the file path from a clip.
-
get_prop
–Get FrameProp
prop
from frameframe
with expected typet
to satisfy the type checker. -
get_props
–Get multiple frame properties from a clip.
-
merge_clip_props
–Merge frame properties from all provided clips.
get_clip_filepath ¶
get_clip_filepath(
clip: VideoNode,
fallback: SPathLike | None = ...,
strict: Literal[False] = ...,
*,
func: FuncExceptT | None = ...
) -> SPath | None
get_clip_filepath(
clip: VideoNode,
fallback: SPathLike | None = None,
strict: bool = False,
*,
func: FuncExceptT | None = None
) -> SPath | None
Helper function to get the file path from a clip.
This functions checks for the IdxFilePath
frame property. It also checks to ensure the file exists, and throws an error if it doesn't.
Parameters:
-
clip
¶VideoNode
) –The clip to get the file path from.
-
fallback
¶SPathLike | None
, default:None
) –Fallback file path to use if the
prop
is not found. -
strict
¶bool
, default:False
) –If True, will raise an error if the
prop
is not found. This makes it so the function will NEVER return False. Default: False. -
func
¶FuncExceptT | None
, default:None
) –Function returned for error handling. This should only be set by VS package developers.
Raises:
-
FileWasNotFoundError
–The file path was not found.
-
FramePropError
–The property was not found in the clip.
Source code
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
|
get_prop ¶
get_prop(
obj: HoldsPropValueT,
key: SupportsString | PropEnum,
t: type[BoundVSMapValue],
*,
func: FuncExceptT | None = None
) -> BoundVSMapValue
get_prop(
obj: HoldsPropValueT,
key: SupportsString | PropEnum,
t: tuple[type[BoundVSMapValue], type[BoundVSMapValue_0]],
*,
func: FuncExceptT | None = None
) -> BoundVSMapValue | BoundVSMapValue_0
get_prop(
obj: HoldsPropValueT,
key: SupportsString | PropEnum,
t: tuple[
type[BoundVSMapValue], type[BoundVSMapValue_0], type[BoundVSMapValue_1]
],
*,
func: FuncExceptT | None = None
) -> BoundVSMapValue | BoundVSMapValue_0 | BoundVSMapValue_1
get_prop(
obj: HoldsPropValueT,
key: SupportsString | PropEnum,
t: tuple[type[BoundVSMapValue], ...],
*,
func: FuncExceptT | None = None
) -> Any
get_prop(
obj: HoldsPropValueT,
key: SupportsString | PropEnum,
t: type[BoundVSMapValue] | tuple[type[BoundVSMapValue], ...],
cast: type[CT] | Callable[[BoundVSMapValue], CT],
*,
func: FuncExceptT | None = None
) -> CT
get_prop(
obj: HoldsPropValueT,
key: SupportsString | PropEnum,
t: type[BoundVSMapValue] | tuple[type[BoundVSMapValue], ...],
*,
default: DT | MissingT = ...,
func: FuncExceptT | None = None
) -> BoundVSMapValue | DT
get_prop(
obj: HoldsPropValueT,
key: SupportsString | PropEnum,
t: type[BoundVSMapValue] | tuple[type[BoundVSMapValue], ...],
cast: type[CT] | Callable[[BoundVSMapValue], CT],
default: DT | MissingT = ...,
func: FuncExceptT | None = None,
) -> CT | DT
get_prop(
obj: HoldsPropValueT,
key: SupportsString | PropEnum,
t: type[BoundVSMapValue],
cast: type[CT] | Callable[[BoundVSMapValue], CT] | None,
default: DT | MissingT,
func: FuncExceptT | None = None,
) -> BoundVSMapValue | CT | DT
get_prop(
obj: HoldsPropValueT,
key: SupportsString | PropEnum,
t: type[BoundVSMapValue] | tuple[type[BoundVSMapValue], ...],
cast: type[CT] | Callable[[BoundVSMapValue], CT] | None = None,
default: DT | MissingT = MISSING,
func: FuncExceptT | None = None,
) -> BoundVSMapValue | CT | DT
Get FrameProp prop
from frame frame
with expected type t
to satisfy the type checker.
Parameters:
-
obj
¶HoldsPropValueT
) –Clip or frame containing props.
-
key
¶SupportsString | PropEnum
) –Prop to get.
-
t
¶type[BoundVSMapValue] | tuple[type[BoundVSMapValue], ...]
) –type of prop.
-
cast
¶type[CT] | Callable[[BoundVSMapValue], CT] | None
, default:None
) –Cast value to this type, if specified.
-
default
¶DT | MissingT
, default:MISSING
) –Fallback value.
-
func
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling. This should only be set by VS package developers.
Returns:
-
BoundVSMapValue | CT | DT
–frame.prop[key].
Raises:
-
FramePropError
–key
is not found in props. -
FramePropError
–key
is of the wrong type.
Source code
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
|
get_props ¶
get_props(
obj: HoldsPropValueT,
keys: Sequence[SupportsString | PropEnum],
t: type[BoundVSMapValue],
*,
func: FuncExceptT | None = None
) -> dict[str, BoundVSMapValue]
get_props(
obj: HoldsPropValueT,
keys: Sequence[SupportsString | PropEnum],
t: type[BoundVSMapValue],
cast: type[CT] | Callable[[BoundVSMapValue], CT],
*,
func: FuncExceptT | None = None
) -> dict[str, CT]
get_props(
obj: HoldsPropValueT,
keys: Sequence[SupportsString | PropEnum],
t: type[BoundVSMapValue],
*,
default: DT,
func: FuncExceptT | None = None
) -> dict[str, BoundVSMapValue | DT]
get_props(
obj: HoldsPropValueT,
keys: Sequence[SupportsString | PropEnum],
t: type[BoundVSMapValue] | Sequence[type[BoundVSMapValue]],
cast: (
type[CT]
| Callable[[BoundVSMapValue], CT]
| Sequence[type[CT] | Callable[[BoundVSMapValue], CT]]
| None
) = None,
default: DT | Sequence[DT] | MissingT = MISSING,
func: FuncExceptT | None = None,
) -> dict[str, Any]
Get multiple frame properties from a clip.
Parameters:
-
obj
¶HoldsPropValueT
) –Clip or frame containing props.
-
keys
¶Sequence[SupportsString | PropEnum]
) –List of props to get.
-
t
¶type[BoundVSMapValue] | Sequence[type[BoundVSMapValue]]
) –Type of prop or list of types of props. If fewer types are provided than props, the last type will be used for the remaining props.
-
cast
¶type[CT] | Callable[[BoundVSMapValue], CT] | Sequence[type[CT] | Callable[[BoundVSMapValue], CT]] | None
, default:None
) –Cast value to this type, if specified.
-
default
¶DT | Sequence[DT] | MissingT
, default:MISSING
) –Fallback value. Can be a single value or a list of values. If a list is provided, it must be the same length as keys.
-
func
¶FuncExceptT | None
, default:None
) –Function returned for custom error handling. This should only be set by VS package developers.
Returns:
-
dict[str, Any]
–Dictionary mapping property names to their values. Values will be of type specified by cast if provided, otherwise of the type(s) specified in
t
or a default value if provided.
Source code
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
|
merge_clip_props ¶
Merge frame properties from all provided clips.
The props of the main clip (defined by main_idx) will be overwritten, and all other props will be added to it.
Parameters:
-
clips
¶VideoNode
, default:()
) –Clips which will be merged.
-
main_idx
¶int
, default:0
) –Index of the main clip to which all other clips props will be merged.
Returns:
-
VideoNode
–First clip with all the frameprops of every other given clip merged into it.
Source code
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
|