I use a cylinder volume with a scatter model (gaussian) in the front face to implement a generic diffuser.
Among other parameters, the scatter model is adjusted through the sigma value.
Using the following code does not result in the sigma value being updated:
o11 = TheSystem.NCE.GetObjectAt(11)coat_scatter = o11.get_CoatScatterData()coat_scatter.GetFaceData(1).CurrentScatterModelSettings.set_Sigma(1.2)
Alternatively, using the following code also does not update sigma:
coat_scatter_face_1.CurrentScatterModelSettings.Sigma = 1.5
Does anyone had a similar experience? How to address this problem?
Kind regards!
Best answer by David.Nguyen
Hi Jonasz,
I had more success with the following snippet in Python:
# Retrieve object of interest
my_object = TheSystem.NCE.GetObjectAt(1)
# Retrieve scatter data from the relevant face
scatter_data = o11.CoatScatterData.GetFaceData(0)
# Retrieve scatter settings
scatter_settings = scatter_data.CurrentScatterModelSettings._S_Gaussian
# Retrieve sigma parameter
sigma = scatter_settings.Sigma
# Print current sigma
print(sigma)
# Change sigma to a new value
sigma = 1.2345
# Apply new scatter settings
scatter_data.ChangeScatterModelSettings(scatter_settings)
I hope this helps. The main difference is that I used the _S_Gaussian property to sort of cast the settings to the Gaussian scatter model.
Also you need to use the ChangeScatterModelSettings method to actually apply the settings.
Take care,
David