Hello SIEMENS Expert,
My plant simulation version is 13.0.4, and I want to know,
1. If there is simtalk attribute or method for camera operations like attach, detach.
2. when I use fly on path for camera animation, camera move slowly because the factor is 1 in the relative dialog. however, if I use simtalk like schedule and playanimation, the camera move fast when the model run fast. so, my question is ,if I can set the factor to show a camera animation so that the camera moves slowly.
Thanks very much!
Solved! Go to Solution.
First of all: yes, there is a SimTalk method to attach/detach a camera to a an object:
F3DAttachCamera(obj) attaches, F3DAttachCamera(void) detaches an object camera to the object specified by <obj>. Note that this method is undocumented and not officially supported.
The function attaches/detaches the camera in the active 3D window.
Now on your second topic:
Running a camera animation using the dialog differs from running it via SimTalk in the timing behaviour:
If the camera animation is run via SimTalk during a simulation, it is considered part of that simulation and thus uses the simulation time. From the dialog, the camera animation is run in CPU time meaning that 1s for the camera animation equals 1s for you.
What you can do to change the animation velocity is change the animation itself. If you open the 3D properties dialog of the frame that has the camera animations, go to the camera animations tab, select the animation for which you want to change the velocity and click on "Edit...", you can select the first anchor there, edit its values and change the velocity/time. The resulting velocity will be used for the anchors after that as long as they do not define another velocity/time.
Thanks for your reply, and I see what you means.
Another question, when I use F3DAttachCamera method, how to get the object I selected by simtalk?
You can ask an object whether it is selected anywhere in 3D with the attribute _3D.Selected or select/deselect it by assigning true/false to that attribute.
In order to find out which objects are selected, you can traverse the content of the frame you want to work in and ask every object whether it is selected or not.
But if you want to use it in order to use F3DAttachCamera, why don't you attach the camera with the command in the 3D View ribbon?
you told me the function "F3DAttachCamera", but only I know the object selected and then I can use it to my task. I think I can get this object , because when I use command in Ribbon, I also selected an object before I can use attach command.
Use ribbon command is a easy way, but I want to integrate the comand to a dialog to convenient customer to use all 3D operation including DIY roaming ,and so on.
In that case, the traversal it is.
There is a SimTalk 3D tutorial of last year's user conference where I explained such traversals and their applications in more detail: