diff --git a/GrpcInterface/Python/rips/PythonExamples/headless_plot_export.py b/GrpcInterface/Python/rips/PythonExamples/headless_plot_export.py new file mode 100644 index 0000000000..af5c527bdc --- /dev/null +++ b/GrpcInterface/Python/rips/PythonExamples/headless_plot_export.py @@ -0,0 +1,35 @@ +import sys +import os + +import rips + +use_platform_offscreen = True +if use_platform_offscreen: + # To use offscreen, the path to fonts must be specified in the environment variable QT_QPA_FONTDIR="C:/windows/fonts" + resinsight = rips.Instance.launch( + command_line_parameters=["-platform offscreen", "--size", 1200, 1000] + ) + + qpa_fontdir = os.environ["QT_QPA_FONTDIR"] + print("Environment var QT_QPA_FONTDIR : " + qpa_fontdir) +else: + resinsight = rips.Instance.find() + +summary_filename = "NORNE.SMSPEC" + +project = resinsight.project +summary_case = project.import_summary_case(summary_filename) + +summary_plot_collection = project.descendants(rips.SummaryPlotCollection)[0] + +summary_plot_collection.new_summary_plot(summary_cases=[summary_case], address="FOPR") +summary_plot_collection.new_summary_plot( + summary_cases=[summary_case], address="WOPR:A*;WOPR:B*" +) + +plots = resinsight.project.plots() +for plot in plots: + plot.export_snapshot() + # plot.export_snapshot(output_format="PDF") + +resinsight.exit() diff --git a/GrpcInterface/RiaGrpcServiceInterface.cpp b/GrpcInterface/RiaGrpcServiceInterface.cpp index 896b66821d..308a5cd761 100644 --- a/GrpcInterface/RiaGrpcServiceInterface.cpp +++ b/GrpcInterface/RiaGrpcServiceInterface.cpp @@ -181,9 +181,13 @@ void RiaGrpcServiceInterface::copyPdmObjectFromRipsToCaf( const rips::PdmObject* auto scriptability = field->template capability(); if ( scriptability ) { - if ( !dynamic_cast( field ) ) + bool isPdmPtrArrayField = ( dynamic_cast( field ) && + !dynamic_cast( field ) ); + + if ( !isPdmPtrArrayField && !dynamic_cast( field ) ) { - // Recursive object update is not supported + // Update of child objects and child object arrays are not supported + // Update of PdmPtrArrayField is supported, used by RimcSummaryPlotCollection_newSummaryPlot // https://github.com/OPM/ResInsight/issues/7794 continue; }