diff --git a/examples/02-modal_analyses/01-plot_and_animate_modes.py b/examples/02-modal_analyses/01-plot_and_animate_modes.py index d167150245..b6673eb347 100644 --- a/examples/02-modal_analyses/01-plot_and_animate_modes.py +++ b/examples/02-modal_analyses/01-plot_and_animate_modes.py @@ -72,4 +72,6 @@ # To suppress window pop-up, set the `off_screen` argument to True. # ~~~~~~~~~~~~~~~~~~~~ -animation.animate_mode(disp, mode_number=1, save_as="tmp.gif", off_screen=True) +animation.animate_mode( + disp, mode_number=1, save_as="tmp.gif", off_screen=True, deform_scale_factor=10.0 +) diff --git a/src/ansys/dpf/core/animation.py b/src/ansys/dpf/core/animation.py index 3ba200c543..2fa42bf790 100644 --- a/src/ansys/dpf/core/animation.py +++ b/src/ansys/dpf/core/animation.py @@ -120,6 +120,7 @@ def animate_mode( wf.set_input_name("weights", scaling_op.inputs.weights) wf.set_output_name("field", scaling_op.outputs.field) + wf.set_output_name("deform_by", scaling_op.outputs.field) anim = Animator(workflow=wf, **kwargs) @@ -130,5 +131,6 @@ def animate_mode( save_as=save_as, mode_number=mode_number, clim=[0, max_data], + scale_factor=deform_scale_factor, **kwargs, ) diff --git a/src/ansys/dpf/core/animator.py b/src/ansys/dpf/core/animator.py index 56ac79e472..e418cd4a69 100644 --- a/src/ansys/dpf/core/animator.py +++ b/src/ansys/dpf/core/animator.py @@ -70,7 +70,7 @@ def animate_workflow( scale_factor = [False] * len(indices) type_scale = type(scale_factor) if type_scale in [int, float]: - scale_factor = [scale_factor] * len(indices) + scale_factor = [float(scale_factor)] * len(indices) elif type_scale == list: pass # elif type_scale in [core.field.Field, core.fields_container.FieldsContainer]: @@ -121,6 +121,7 @@ def render_frame(frame): self.add_field( field, deform_by=deform, + scale_factor=scale_factor[frame], scale_factor_legend=scale_factor[frame], shell_layer=shell_layer, **kwargs,