Cancel
Showing results for 
Search instead for 
Did you mean: 

Camera simtalk attribute or method

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

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!

 

 

6 REPLIES 6

Re: Camera simtalk attribute or method

Siemens Phenom Siemens Phenom
Siemens Phenom

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.

 

Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution

Re: Camera simtalk attribute or method

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

Hello PeterKomarek,

          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?

Re: Camera simtalk attribute or method

Siemens Phenom Siemens Phenom
Siemens Phenom

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?

Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution

Re: Camera simtalk attribute or method

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

Hello PeterKomarek,

          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.

        Thanks.

Re: Camera simtalk attribute or method

Siemens Phenom Siemens Phenom
Siemens Phenom

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:

https://community.plm.automation.siemens.com/t5/Plant-Simulation-Worldwide-User-Conference/Hands-on-...

 

Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution

Re: Camera simtalk attribute or method

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor
Thanks very much!