Skip to main content

RunTransformsV2PipelineAtTime Command

Overview

RunTransformsV2PipelineAtTime bridges Triage/command sequences to saved TransformsV2 PipelineDescriptor JSON files. It is registered from src/TransformsV2/register_transformsv2_commands.cpp and appears in CommandPickerDialog via the shared CommandRegistry.

The command loads a widget/library-format pipeline JSON (not DataManagerPipelineDescriptor), subsets one frame from an input DataManager key, runs the pipeline off-DataManager via executePipeline, then creates or updates the output key.

Source Files

File Role
src/TransformsV2/Commands/RunTransformsV2PipelineAtTime.hpp Command + params struct
src/TransformsV2/Commands/RunTransformsV2PipelineAtTime.cpp execute() implementation
src/TransformsV2/Commands/RunTransformsV2PipelineAtTimeUIHints.hpp ParameterUIHints (path browse for pipeline_path)

Parameters

struct RunTransformsV2PipelineAtTimeParams {
    std::string input_key;
    std::string output_key;
    int64_t time = 0;  // sequence JSON may use "${current_frame}" / "${mark_frame}"
    std::string pipeline_path;
};
Field Description
input_key DataManager key of the source object for the frame subset
output_key DataManager key where results are created or merged
time Frame index; use "${current_frame}" or "${mark_frame}" in sequence JSON (expanded to a JSON number before deserialization, same as ClearLineDataAtTime)
pipeline_path Absolute path to a pipeline JSON file (browse defaults to the user pipeline library)

Execution Flow

  1. Validate input_key, output_key, and pipeline_path; require input_key in DataManager.
  2. loadPipelineFromFile(pipeline_path) builds a typed TransformPipeline.
  3. createTemporalSubset(input_key, [time, time]) extracts a single-frame input.
  4. executePipeline(subset, pipeline) runs transforms off-DataManager (multi-step PipelineStepDescriptor chains are supported when types chain correctly).
  5. Store output:
    • Inherit the input object’s TimeKey when creating a new key.
    • If output_key exists and the result type supports merge-overwrite (MaskData, LineData, PointData), call mergeOverwriteData. Transient pipeline results are assigned the target key’s identity context before merge so each frame gets a distinct registry-backed EntityId. Repeated runs at different time values therefore accumulate frames in a pre-existing empty output key; re-running the same time overwrites only that frame.
    • If output_key exists with an incompatible type, return an error.
    • Otherwise call setData to create or replace the output object.

Terminal range_reduction entries in the JSON are loaded but not applied by executePipeline (same behavior as the TransformsV2 widget).

UI Hints

pipeline_path uses PathFieldKind::FilePath with file_dialog_id = "transformv2_pipeline_open". MainWindow registers a fallback directory via AutoParamWidget::registerDialogFallback() pointing at defaultUserPipelineDirectory(configDir()), sharing session path memory with TransformsV2Properties_Widget.

input_key and output_key set dynamic_combo = true. CommandRowWidget registers a DataManager observer and calls AutoParamWidget::updateAllowedValues() for those fields, filtered by the command’s supported_data_types.