diff --git a/Servers/Filters/vtkFileSeriesReader.cxx b/Servers/Filters/vtkFileSeriesReader.cxx index 96d86fb..5aaf4af 100644 --- a/Servers/Filters/vtkFileSeriesReader.cxx +++ b/Servers/Filters/vtkFileSeriesReader.cxx @@ -553,6 +553,28 @@ int vtkFileSeriesReader::RequestInformation( this->RequestInformationForInput(i, request, outputVector); this->Internal->TimeRanges->AddTimeRange(i, outInfo); } + + // Catch case where multiple files set the same timestep + int numTimeSteps + = outInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); + if (numTimeSteps < numFiles) + { + vtkWarningMacro("Multiple files contain identical time step values. " + << "Reverting to fake time step values."); + + this->Internal->TimeRanges->Reset(); + outInfo->Remove(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); + outInfo->Remove(vtkStreamingDemandDrivenPipeline::TIME_RANGE()); + + // Input files have non-unique time steps. Fake a time step for each equal to the + // index. + for (int i = 0; i < numFiles; i++) + { + double time = (double)i; + outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), &time, 1); + this->Internal->TimeRanges->AddTimeRange(i, outInfo); + } + } } // Now that we have collected all of the time information, set the aggregate