Batch Version Manager (C2C):
The BatchVersionManagerMEC is a sophisticated node designed to manage versioning within a hierarchical structure of shows, shots, and tasks. Its primary function is to identify and reserve the next available version number within a specified directory structure, ensuring that each version is unique and sequential. This node is particularly beneficial in environments where multiple users or processes might attempt to create new versions simultaneously, as it employs an atomic reservation system using lock files to prevent conflicts. By scanning existing directories named in the format v###, it determines the next available version number and can reserve it if required. The node is designed to be safe for use within workflows, as it does not perform any pixel I/O operations. Additionally, it outputs paths using forward slashes, which is a standard requirement for VFX pipelines, render farms, and OS-agnostic asset databases. This ensures compatibility across different systems and platforms.
Batch Version Manager (C2C) Input Parameters:
reserve
The reserve parameter is a boolean flag that determines whether the node should reserve the next available version number. When set to True, the node will attempt to create a lock file to reserve the version, ensuring that no other process can claim it simultaneously. This is particularly useful in collaborative environments where multiple users might be working on the same task. If the lock file already exists, the node will retry with the next version number up to a specified maximum number of retries. The default value is False, meaning the node will only compute the next version number without reserving it.
max_retries
The max_retries parameter specifies the maximum number of attempts the node should make to reserve a version number if the initial attempt fails due to an existing lock file. This parameter is crucial in environments with high concurrency, as it allows the node to gracefully handle conflicts by trying subsequent version numbers. The default value is typically set to a reasonable number to balance between performance and the likelihood of successfully reserving a version.
Batch Version Manager (C2C) Output Parameters:
version_path
The version_path output provides the full path to the next-version directory, formatted with forward slashes. This path indicates where the new version's files should be stored and is essential for organizing assets within the specified hierarchy of show, shot, and task.
version_int
The version_int output is an integer representing the allocated version number. This number is crucial for tracking and referencing specific versions within the workflow, ensuring that each version is unique and sequential.
version_label
The version_label output is a string that provides a padded version label, such as v001. This label is often used in naming conventions and helps maintain consistency across different versions.
info_json
The info_json output is a JSON-formatted string containing metadata about the versioning operation. This includes details such as the show, shot, task, user, host, timestamp, and reservation status. This metadata is valuable for auditing and tracking purposes, providing a comprehensive overview of the versioning process.
Batch Version Manager (C2C) Usage Tips:
- To ensure smooth operation in collaborative environments, always set the
reserveparameter toTruewhen you need to guarantee that a version number is uniquely reserved for your task. - Adjust the
max_retriesparameter based on the level of concurrency in your environment. A higher number of retries can be beneficial in busy pipelines to increase the chances of successfully reserving a version.
Batch Version Manager (C2C) Common Errors and Solutions:
version_manifest.json write failed
- Explanation: This error occurs when the node fails to write the version manifest file, which contains metadata about the versioning operation.
- Solution: Check the file system permissions to ensure that the node has write access to the target directory. Additionally, verify that there is sufficient disk space available.
Workflow hash skipped
- Explanation: This warning indicates that the node was unable to compute a hash for the workflow, possibly due to an unsupported data type in the prompt.
- Solution: Ensure that the prompt data is serializable to JSON. If necessary, convert any complex data types to strings or other JSON-compatible formats before passing them to the node.
