私は実行する自動化されたクリップ スクリプトを持っています。その一部として、カラー スキームを範囲内の可視データに再スケーリングするオプション (ブール値) を使用したいと考えています。
Paraview ユーザー ガイド(第 10.1.2 章) でこのコマンドを見つけclipDisplay.SetScalarBarVisibility(renderView1, True)
、クリップの paraview 追跡スクリプト内の色転送機能の最後に配置しました。
スクリプトを実行してもエラーは発生しませんが、GUI で行われた同じ操作と比較して配色を再スケーリングする作業は行われません。
私はコードを普遍的に使用したいので、数値定義で範囲内のデータを手動で選択することは問題外です...
編集
trace を使用すると、次のようになります。
# trace generated using paraview version 5.7.0
#
# To ensure correct image size when batch processing, please search
# for and uncomment the line `# renderView*.ViewSize = [*,*]`
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# get color transfer function/color map for 'p'
pLUT = GetColorTransferFunction('p')
pLUT.AutomaticRescaleRangeMode = "Grow and update on 'Apply'"
pLUT.InterpretValuesAsCategories = 0
pLUT.AnnotationsInitialized = 0
pLUT.ShowCategoricalColorsinDataRangeOnly = 0
pLUT.RescaleOnVisibilityChange = 0
pLUT.EnableOpacityMapping = 0
pLUT.RGBPoints = [-714.7062377929688, 0.231373, 0.298039, 0.752941, -259.51192474365234, 0.865003, 0.865003, 0.865003, 195.68238830566406, 0.705882, 0.0156863, 0.14902]
pLUT.UseLogScale = 0
pLUT.ColorSpace = 'Diverging'
pLUT.UseBelowRangeColor = 0
pLUT.BelowRangeColor = [0.0, 0.0, 0.0]
pLUT.UseAboveRangeColor = 0
pLUT.AboveRangeColor = [0.5, 0.5, 0.5]
pLUT.NanColor = [1.0, 1.0, 0.0]
pLUT.NanOpacity = 1.0
pLUT.Discretize = 1
pLUT.NumberOfTableValues = 256
pLUT.ScalarRangeInitialized = 1.0
pLUT.HSVWrap = 0
pLUT.VectorComponent = 0
pLUT.VectorMode = 'Magnitude'
pLUT.AllowDuplicateScalars = 1
pLUT.Annotations = []
pLUT.ActiveAnnotatedValues = []
pLUT.IndexedColors = []
pLUT.IndexedOpacities = []
# Rescale transfer function
pLUT.RescaleTransferFunction(-413.7960510253906, 192.35369873046875)
# get opacity transfer function/opacity map for 'p'
pPWF = GetOpacityTransferFunction('p')
pPWF.Points = [-714.7062377929688, 0.0, 0.5, 0.0, 195.68238830566406, 1.0, 0.5, 0.0]
pPWF.AllowDuplicateScalars = 1
pPWF.UseLogScale = 0
pPWF.ScalarRangeInitialized = 1
# Rescale transfer function
pPWF.RescaleTransferFunction(-413.7960510253906, 192.35369873046875)
アイデアはありますか?乾杯