Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search

Issue with focal length and film gate

Author
Message
  Topic Search Topic Search
amlendra View Drop Down
Member
Member


Joined: 2018 Feb 01
Online Status: Offline
Posts: 46
Direct Link To This Post Topic: Issue with focal length and film gate
    Posted: 2018 Apr 04 at 10:24am
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. 
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1878
Direct Link To This Post Posted: 2018 Apr 05 at 2:55am
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.
Cheers,
Andreas
SDK Support Engineer
Back to Top
amlendra View Drop Down
Member
Member


Joined: 2018 Feb 01
Online Status: Offline
Posts: 46
Direct Link To This Post Posted: 2018 Apr 05 at 3:23am
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);




Edited by amlendra - 2018 Apr 05 at 10:44am
Back to Top
amlendra View Drop Down
Member
Member


Joined: 2018 Feb 01
Online Status: Offline
Posts: 46
Direct Link To This Post Posted: 2018 Apr 09 at 3:13am
Hi Andreas,

I am waiting for your reply since 5 days, please help me.Cry




Edited by amlendra - 2018 Apr 09 at 3:14am
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1878
Direct Link To This Post Posted: 2018 Apr 10 at 2:58am
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.

Cheers,
Andreas
SDK Support Engineer
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.