Issue with focal length and film gate
-
On 04/04/2018 at 10:24, xxxxxxxx wrote:
Can we change the focal length and Film gate of the created camera using the own created GUI?
I have created a prompt window, from where I want to change the focal length and gate field of the cameras. But what happen if I am trying to change the focal length to enter the value in prompt windows, it is not reflecting.
Here I am using a trick here I am reading the value from the prompt and delete the existing camera and again creating a camera with new focal length, it is working but it seems complicated if there are a lot of cameras.
Please give me some right solution to change the focal length and another property of camera from the own created GUI.
-
On 05/04/2018 at 02:55, xxxxxxxx wrote:
Hi,
actually I'd like to move this thread either into SDK Help or Python sub-forum. Just not sure, if you are using C++ or Python for this?
About your actual question(s) we will need a bit more information in order to understand the problem.
In general the parameters of camera objects can be changed like any other parameter of other arbitrary entities (C4DAtom::SetParameter()). But I guess, you already know this, as you seem to be able to change the parameters for freshly created cameras. Now, I'm wondering, why you can not simply use the same approach on an already existing camera, but instead do the deletion and recreation?
"Your own created GUI" is a GeDialog? Or is it something completely different? Maybe it also helps, if you tell us what type of plugin (CommandData, ObjectData,...?) you are implementing.
-
On 05/04/2018 at 03:23, xxxxxxxx wrote:
I am using C++ for the development.I am creating a CommandData plugin, where I am creating more than one camera. So here I am creating GeDialog to change the focal length of each camera. I am using the below-mentioned API to change camera focal length and sensor size.
cameraObj>SetFocus(f);
cameraObj>SetAperture(g); -
On 09/04/2018 at 03:13, xxxxxxxx wrote:
Hi Andreas,
I am waiting for your reply since 5 days, please help me.!
Cry
[URL-REMOVED]
[URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.
-
On 10/04/2018 at 02:58, xxxxxxxx wrote:
Hi,
terribly sorry, I can only apologize. Even though marked in bold red in my ToDo table, I somehow managed to loose your thread...
So, SetFocus() and SetAperture() internally do not much else than setting the respective camera parameter. Only addition is clamping the input values to a valid range.
But I still don't understand the actual issue? I need to repeat my question: I'm wondering, why you can not simply use the same approach on an already existing camera, but instead do the deletion and recreation?
In general you react to value changes in your GeDialog in its Command() function. In reaction to changes of your for example "focus widget" in the GeDialog, you'd set the respective parameters of one or all cameras, either with above mentioned dedicated functions or by generally modifying parameters (SetParameter()).
Maybe also check out the manuals about CameraObject and GeDialog, the code snippets there can help a lot with understanding how things are working together.