question

Steven Chen avatar image
0 Likes"
Steven Chen asked Matthew Gillespie answered

Follow object and rotate view by using script

Hello,

I want to have camera follow a specific item on using video recorder. Since item doesn't exists before start model. I can't do this from context menu. So plan is writing a script in trigger to follow the item.

Another question is it possible to rotate view with given speed and degree when following an object?

FlexSim 19.2.4
video recorderfollow objectsviewpoint
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Brandon Peterson avatar image
1 Like"
Brandon Peterson answered Brandon Peterson commented

Steven,

During your model run you can use a trigger to set the node ">viewsettings/followobject" on the view to the object you want to follow. For example, you could set the node to the 100th item to enter a processor. The view would then follow the item through the model. If you use the OnDraw trigger of an object to do this then you will have a pointer to the view by default so you wont have to make adjustments every time you close an open views. The down side is that it will do it for all the 3D views that are open.

There is not a direct way to rotate the view with a given speed and degree when following an object that I know of. There are a few pointers I can offer for doing it yourself. First, do it in a PreDraw trigger or the view will not rotate smoothly. Second, you'll want to uncheck the "Rotate with Object" option if you are using the default follow object in the view.

I hope this helps, Brandon

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.