cgl.core package¶
Subpackages¶
- cgl.core.cloud package
- cgl.core.config package
- cgl.core.path package
- Submodules
- cgl.core.path.constants module
- cgl.core.path.object module
- cgl.core.path.query module
- cgl.core.path.sequence module
SequenceSequence.end_frameSequence.extSequence.frame_rangeSequence.get_project_info()Sequence.globals_infoSequence.hashSequence.hash_sequenceSequence.int_as_padded_frame()Sequence.is_valid_sequence()Sequence.middle_frameSequence.numSequence.num_sequenceSequence.paddingSequence.print_info()Sequence.sequenceSequence.set_ext()Sequence.set_frange()Sequence.set_sequence_strings()Sequence.split_sequence()Sequence.star_sequenceSequence.start_frame
- cgl.core.path.support module
add_cookbook_root()add_root()create_folders()edit_project_msd()edit_publish_msd()find_latest_publish_objects()get_dcc_from_task_file()get_folder_size()get_latest_asset_publish()get_projects()get_short_name()get_task_default_file()hd_proxy_exists()is_file()list_dir()lj_list_dir()open_file()open_folder()path_delimit()pick_best_default_item()print_file_size()read_publish_msd()remove_coobkook_root()remove_root()replace_illegal_filename_characters()resolve_new_path()seq_from_file()show_in_folder()split_after()start()start_url()
- cgl.core.path.version module
- Module contents
- cgl.core.utils package
- Submodules
- cgl.core.utils.amc_batch_extract_wav module
- cgl.core.utils.batch_folder_renamer module
- cgl.core.utils.build module
- cgl.core.utils.folder_renamer module
- cgl.core.utils.general module
CglExecuteErrorDateTimeEncoderLoggerapp_name()apply_theme()atomic_replace()cgl_clean_dir()cgl_copy()cgl_copy_single()cgl_execute()cgl_move()cgl_sync()cgl_sync_file()clean_file_list()clean_file_string()compare_drives()copy_file_list()create_file_dirs()current_user()display_debug_widget()ext_exists()fix_json()get_branch_name()get_end_time()get_file_type()get_job_id()get_print_list()get_resource_path()ignore_name()load_fonts_from_directory()load_json()load_style_sheet()load_xml()normpath()pretty()pretty_print_error()print_call_stack()remove_read_only_attribute()save_json()save_xml()screen_grab()split_all()
- cgl.core.utils.msd_tools module
- cgl.core.utils.network module
- cgl.core.utils.pycharm_setup module
- cgl.core.utils.read_write module
- cgl.core.utils.setup_codacy_coverage module
- cgl.core.utils.web module
- Module contents
Submodules¶
cgl.core.bid module¶
cgl.core.cgl_info module¶
cgl.core.convert module¶
- cgl.core.convert.audio_to_wav(input_audio_path, output_wav_path=None)[source]¶
Generates an ffmpeg command string to convert an audio file to WAV format.
- Parameters:
input_audio_path (str) – Path to the input audio file.
output_wav_path (str, optional) – Path to save the output WAV file. If not provided, it will use the same filename with a .wav extension.
- Returns:
The formatted ffmpeg command string.
- Return type:
str
- cgl.core.convert.convert_image_to_png(image_path, output_path=None, resolution=None, quiet=True)[source]¶
Converts any image_plane file (JPG, TIFF, BMP, etc.) to a PNG while preserving aspect ratio. If resolution is provided, resizes the image_plane to fit within it, adding black padding.
- Parameters:
image_path (str) – Path to the source image_plane.
output_path (str, optional) – Path to save the PNG file. If None, auto-generates a path.
resolution (tuple, optional) – (width, height) to fit the image_plane within. If None, keeps the original resolution.
- Returns:
Output PNG file path or None if conversion failed.
- Return type:
str
- cgl.core.convert.convert_png_sequence_to_mp4(source_sequence, start_frame=None, dest_mp4=None, fps=24, width=1920, height=1080, force=True)[source]¶
Converts a PNG image_plane sequence into an MP4 file.
- Parameters:
source_sequence (str) – Path pattern for the PNG sequence (e.g., “frame_####.png”).
start_frame (int, optional) – First frame number (default: auto-detected).
dest_mp4 (str, optional) – Output MP4 file path. Auto-generated if None.
fps (int, optional) – Frames per second (default: 24).
width (int, optional) – Output width (default: 1920).
height (int, optional) – Output height (default: 1080).
force (bool, optional) – If True, overwrite existing MP4 (default: True).
- Returns:
Path to the generated MP4 file or None if conversion failed.
- Return type:
str
- cgl.core.convert.convert_psd_to_png(psd_path, output_path=None, resolution=None, quiet=True)[source]¶
Converts a PSD file to a PNG while preserving aspect ratio. If resolution is provided, resizes the image_plane to fit within it, adding black padding.
- Parameters:
psd_path (str) – Path to the PSD file.
output_path (str, optional) – Output PNG path. If None, it auto-generates.
resolution (tuple, optional) – (width, height) to fit the image_plane within. If None, keeps the original resolution.
- Returns:
The output PNG path or None if failed.
- Return type:
str
- cgl.core.convert.convert_to_png(source_path, output_path=None, resolution=None)[source]¶
Converts any image_plane file (PSD, JPG, TIFF, BMP, etc.) to a full-resolution PNG.
- Parameters:
source_path (str) – Path to the source image_plane.
output_path (str, optional) – Path to save the PNG file. If None, it auto-generates.
- Returns:
Output PNG file path or None if conversion failed.
- Return type:
str
- cgl.core.convert.convert_to_wav(input_path, output_wav_path=None)[source]¶
Converts an audio or video file to WAV format. :param input_path: :param output_wav_path:
Returns:
- cgl.core.convert.create_mp4_from_proxy(proxy_folder_path)[source]¶
Converts a proxy sequence into an mp4 preview file. :param proxy_folder_path:
Returns:
- cgl.core.convert.create_mp4_from_single_proxy(proxy_path)[source]¶
Converts a single proxy image_plane into an mp4 preview file. :param proxy_path:
Returns:
- cgl.core.convert.create_png_proxies(path_object, resolution=(1920, 1080))[source]¶
This script assumes we are working with files in the “Render” folder that we are seeking to create jpg proxies for the purpose of creating quicktime movies. :param path_object: The path object to the render folder. :param resolution: The resolution to convert the images to.
Returns:
- cgl.core.convert.get_proxy_frame(proxy_path, frame_number)[source]¶
This function will return the path to a specific frame of a jpg proxy. :param proxy_path: Path to the jpg proxy file. :param frame_number: The frame number to get the path for.
- Returns:
The path to the specific frame.
- Return type:
str
- cgl.core.convert.psd_to_image(psd_path)[source]¶
Converts a PSD file to a PIL Image.
- Parameters:
psd_path (str) – Path to the PSD file.
- Returns:
The converted image_plane or None if failed.
- Return type:
PIL.Image
- cgl.core.convert.resize_and_pad_image(img, resolution=None)[source]¶
Resizes an image_plane while maintaining aspect ratio and pads it with black if needed.
- Parameters:
img (PIL.Image) – The input PIL Image object.
resolution (tuple, optional) – (width, height) to fit the image_plane within. If None, returns the original image_plane.
- Returns:
The resized and padded image_plane.
- Return type:
PIL.Image
- cgl.core.convert.video_to_wav(input_video_path, output_wav_path=None)[source]¶
Generates an ffmpeg command string to convert a video file to a WAV file.
- Parameters:
input_video_path (str) – Path to the input video file.
output_wav_path (str, optional) – Path to save the output WAV file. If not provided, saves in the same directory with the same filename.
- Returns:
The formatted ffmpeg command string.
- Return type:
str
cgl.core.list_dir module¶
- cgl.core.list_dir.find_missing(sequence, padding)[source]¶
finds missing numbers in a number sequence and formats a sequence the way nuke does it.
- Parameters:
sequence
Returns:
- cgl.core.list_dir.generate_sequence(sframe, eframe, remove_frames=0, padding=4)[source]¶
generates a sequence of files from a start frame to an end frame
cgl.core.lj_mail module¶
cgl.core.metadata module¶
- cgl.core.metadata.get_meta_data2(filein, tool='exiftool', print_output=True)[source]¶
Due to issues with the exiftool module this is provided as a way to parse output directly from exiftool through the system commands and cglexecute. For the moment it’s only designed to get the metadata for a single file. :param filein: :param tool: :param print_output:
- Returns:
dictionary containing metadata from exiftool
- cgl.core.metadata.get_red_data(filein)[source]¶
method for pulling metadata from r3d files. REDLINE is a command line interface from RED that is required for this: https://www.red.com/downloads/options?itemInternalId=16144 :param filein:
- Returns:
dictionary containing metadata from REDLINE
cgl.core.msd module¶
cgl.core.notes module¶
- class cgl.core.notes.Notes(path_object: PathObject)[source]¶
Bases:
object- addNote(originator, note)[source]¶
The function adds a note to a list of notes, including the originator, note content, and date.
- Parameters:
originator – The originator parameter represents the user or entity who is adding the note. It
could be a username, user ID, or any other identifier that helps identify the originator of the note.
note: The “note” parameter is the content of the note that you want to add. It can be a string
or any other data type that represents the content of the note.
- static create_from_path_object(path: PathObject)[source]¶
cgl.core.project module¶
cgl.core.read_bid module¶
cgl.core.review module¶
- cgl.core.review.convert_NA_to_jpg(source_gif, dest_image, width=1920, height=1080)[source]¶
Converts anything oiiotool can’t handle to a jpg.
Currently, this applies to gifs and webp files or something :param source_gif: :param dest_image: :param width: :param height:
- cgl.core.review.convert_doc_to_jpg(source_doc, dest_folder, dest_name, width=1920, height=1080)[source]¶
Converts a doc/docs to a jpg
- Parameters:
source_doc
dest_folder
width
height
- cgl.core.review.convert_exr_sequence_to_mp4(path_object, fps=24)[source]¶
converts an exr sequence into an mp4 file suitable for web previews
- Parameters:
path_object
fps
- Returns:
path to the mp4 file
- cgl.core.review.convert_exr_to_hdr(source_exr)[source]¶
Converts an exr to an hdr file using oiiotool
- cgl.core.review.convert_image_to_jpg(source_image, dest_image=None, width=1920, height=1080)[source]¶
Converts an image to JPG and resizes it using Pillow (PIL).
- Parameters:
source_image (str) – Path to the source image.
dest_image (str, optional) – Output path. If None, auto-generates.
width (int) – Target width (default: 1920).
height (int) – Target height (default: 1080).
- Returns:
Path to the converted JPG file.
- Return type:
str
- cgl.core.review.convert_jpg_sequence_to_mp4(source_sequence, start_frame=None, dest_mp4=None, wav_file=None, fps=24, width=1920, height=1080, force=True)[source]¶
converts a jpg sequence into an mp4 file suitable for web previews
- Parameters:
source_sequence – source jpg sequence
start_frame – start frame of the sequence
dest_mp4 – destination mp4 file
wav_file – optional wav file to use for audio
fps – frame rate of the sequence
width – width of the output
height – height of the output
- cgl.core.review.convert_mov_to_jpg(source_movie, dest_folder, dest_name, fps=24, width=1920, height=1080)[source]¶
Uses ffmpeg to convert a movie to a jpg :param source_movie: :param dest_name: :param fps: :param width: :param height:
- Returns:
highest number
- cgl.core.review.convert_movie_to_mp4(source_movie, dest_mp4=None, fps=24, source_audio=None, width='1920', height='1080')[source]¶
converts a movie into an mp4 file suitable for web previews
- Parameters:
source_movie
dest_mp4
fps
width
height
- Returns:
path to the mp4 file
- cgl.core.review.convert_ppt_to_jpg(source_ppt, dest_folder, dest_name)[source]¶
Converts a ppt to a jpg
- Parameters:
source_ppt
dest_folder
dest_name
- Returns:
highest number
- cgl.core.review.convert_single_jpg_to_mp4(source_jpg, start_frame=1, dest_mp4=None, fps=24, width=1920, height=1080)[source]¶
Converts a single jpg to an mp4 file suitable for web previews
- Parameters:
source_jpg – source jpg file
start_frame – start frame of the sequence
dest_mp4 – destination mp4 file
fps – frame rate of the sequence
width – width of the output
height – height of the output
- Returns:
path to the mp4 file
- cgl.core.review.convert_to_wav(source_audio, dest_wav)[source]¶
use ffmpeg to convert an audio file to a wav file :param source_audio: :param dest_wav:
- cgl.core.review.create_jpg_proxies(source_folder, dest_folder=None, filename=None)[source]¶
Creates a jpg proxy of each image_plane in the source folder :param source_folder: :param dest_folder: :return:
- cgl.core.review.create_jpg_proxies_from_path_object(path_object: PathObject, all=True)[source]¶
Create jpg proxes from a PathObject().
- cgl.core.review.create_proxy_mp4(path_object, fps=24, width=1920, height=1080)[source]¶
Creates a proxy mp4 for a given path object
- Parameters:
path_object
fps
width
height
- cgl.core.review.create_review_mp4(path_object: str | PathObject)[source]¶
Creates a review mp4 from a path object, assumes that a jpg sequences is available.
- cgl.core.review.create_thumbnail(path_object, thumb_type='task')[source]¶
Check if this is a movie or an image_plane if it’s a movie use create_thumbnail if it’s an image_plane use create_image_thumbnail :param path_object: :param thumb_type:
Returns:
- cgl.core.review.find_frame_number(pattern_path)[source]¶
Replaces %04d in paths with the actual frame number found on disk. .. rubric:: Example
Input: “path/to/sequence.%04d.png” Output: “path/to/sequence.0001.png” (if 0001.png exists)
- cgl.core.review.frame_from_timestamp(timestamp, fps)[source]¶
converts a timestamp to a frame number :param timestamp: :param fps:
- Returns:
timestamp
- cgl.core.review.get_highest_number(dest_folder, dest_name, ext='.jpg')[source]¶
gets all images in the folder and returns the highest number
- Parameters:
dest_folder
- Returns:
highest number
- Raises:
IndexError – if no files are found
- cgl.core.review.get_start_frame(dest_sequence)[source]¶
gets the start frame of the sequence
- Parameters:
dest_sequence
- Returns:
start frame
- cgl.core.review.get_wave_file(path)[source]¶
Checks if a wav file exists in the same folder as a given path
- Parameters:
path
- Returns:
wav file if it exists otherwise None
- cgl.core.review.movie_is_only_file(source_mov)[source]¶
Checks to see if the movie is the only file in the folder
- Parameters:
source_mov
- Returns:
True if the movie is the only file in the folder otherwise False
cgl.core.screen_grab module¶
- class cgl.core.screen_grab.ScreenCapture(parent=None, path_object=None, output=None)[source]¶
Bases:
QDialogA dialog for capturing a selected area of the screen.
- staticMetaObject = PySide6.QtCore.QMetaObject("ScreenCapture" inherits "QDialog": )¶
- cgl.core.screen_grab.capture_area(rect, output_path)[source]¶
Captures the selected screen area, ensuring it works on multiple monitors.
- Parameters:
rect (QRect) – The selected area to capture.
output_path (str) – File path to save the captured image_plane.
- Returns:
The captured screen area as a QPixmap.
- Return type:
QPixmap
- cgl.core.screen_grab.run(path_object=None, output='thumb', parent=None)[source]¶
Runs the screen capture tool.
- Parameters:
path_object (object, optional) – Path object.
output (str, optional) – Output file path.
parent (QWidget, optional) – Parent widget.
- Returns:
The path to the saved screenshot.
- Return type:
str
cgl.core.slow_task module¶
- class cgl.core.slow_task.BackgroundExecutor(parent=None)[source]¶
Bases:
QObject- complete¶
- error¶
- staticMetaObject = PySide6.QtCore.QMetaObject("BackgroundExecutor" inherits "QObject": Methods: #5 type=Signal, signature=complete(PyObject), parameters=PyObject #6 type=Signal, signature=error(PyObject), parameters=PyObject #7 type=Slot, signature=run(PyObject,PyObject,PyObject), parameters=PyObject, PyObject, PyObject )¶
- class cgl.core.slow_task.ProgressDialog(message='Running...', parent=None)[source]¶
Bases:
QDialog- staticMetaObject = PySide6.QtCore.QMetaObject("ProgressDialog" inherits "QDialog": Methods: #42 type=Signal, signature=submit(PyObject,PyObject,PyObject), parameters=PyObject, PyObject, PyObject #43 type=Slot, signature=on_complete(PyObject), parameters=PyObject #44 type=Slot, signature=on_error(PyObject), parameters=PyObject )¶
- submit¶