Scripted View

40 views
Skip to first unread message

Lorenzo Ferro

unread,
Nov 11, 2024, 1:29:48 PM11/11/24
to JaamSim Users Discussion Group
Dear Harry,

today I used for the first time the ScriptedViewPosition and ScriptedViewCenter fields of the View object. I realized that once filled-in these fields take the control and the ViewPosition and ViewCenter fields are deactivated.
Every time I wanted to add a new Scripted View I had to cancel the Scripts, find the new View position and rewrite the scripts with the additional view. So, I had to use an external text file to save the previous Scripts.

I don't know if my way of proceeding was the best one and maybe you can give me some advices. Anyhow, I wanted to propose you to add a boolean field for activating/deactivating the ScriptedView fields, so as to be able to switch to the normal View and find the new view position before switching back to the ScriptedView and test the result.

It would be useful also to have a command to append the ViewPosition and ViewCenter values to the Scripted ones, just imputing the time of the current "keyframe".

Thank you,
Lorenzo

Harry King

unread,
Nov 12, 2024, 12:54:17 AM11/12/24
to JaamSim Users Discussion Group
Lorenzo,

Yes, that method is about right. It is necessary to use an external file to build the script inputs. One trick you can use is to define a second View that does not include the scripts. You can then use that View to find the next view position.

It is a process that requires a lot of manual trial-and-error work. It is used mainly for recording videos.

Harry

Lorenzo Ferro

unread,
May 21, 2026, 2:31:49 AM (yesterday) May 21
to JaamSim Users Discussion Group
Hello Harry,

when making dynamic videos the ScriptedViewPosition and ScriptedViewCenter input fields are a very good way to align the camera X-Y-Z position with a proper x-y-z center of view but lots of iterations are required to find the correct position in space and time, particularly when the model is complex.

When the Scripted View feature is not used, the ViewPosition and ViewDirection give information about the point of view but there infos are not directly usable for Scripted View because the ViewDirection is a vector and not a point like the ScriptedViewCenter.

It would be very useful if the users could have the possibility to set the proper view point (as usual with pans and rotations) and then retrieve the View Center information to be copied and paste into the ScriptedViewCenter field (maybe also with information about the current time, like {{t_i s}{x_i y_i z_i m}})

Surely with some trigonometry it is possible to calculate the conversion from ViewDirection+ViewPosition to ScriptedViewCenter but it is not practical (and I suppose it is already calculated by JaamSim) and it is very time consuming or requires a dedicated excel file or similar.

Do you think it is something that could be implemented in the future?

Thank you,
Lorenzo

Harry King

unread,
12:13 AM (17 hours ago) 12:13 AM
to JaamSim Users Discussion Group
Hi Lorenzo,

We have only just converted View from the ViewCenter input to ViewDirection in 2026-03. We have not yet converted the ScriptedViewCenter input to ScriptedViewDirection.

We will make that change in the next release.

Harry

Reply all
Reply to author
Forward
0 new messages