Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Setting data of a camera (from a tag)

    Scheduled Pinned Locked Moved SDK Help
    15 Posts 0 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 29/07/2007 at 22:27, xxxxxxxx wrote:

      Thanks for the Info! πŸ™‚

      Wow, that sounds pretty easy. So after that I use "cam" as the camera object, and it has all methods and properties of a BaseCamera (or a RayCamera)?

      Greetings,
      Jack

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 30/07/2007 at 05:35, xxxxxxxx wrote:

        Quote: _So after that I use "cam" as the camera object, and it has all methods and properties of a BaseCamera (or a RayCamera)?
        >
        > * * *
        _


        Yes, it has all methods of the CameraObject class (there is no BaseCamera object).

        cheers,
        Matthias

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 30/07/2007 at 16:04, xxxxxxxx wrote:

          Hm...
          I get an error in this line:

          CameraObject* cam = static_cast<CameraObject*>(op);
          

          Error message:
          error C2065: 'MyCam': nichtdeklarierter Bezeichner

          I thought "CameraObject* cam" IS the declaration?

          Thanks again,
          Jack

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 30/07/2007 at 16:39, xxxxxxxx wrote:

            Where is 'MyCam' coming from? Maybe you have it undeclared but used elsewhere? If the cast gives you trouble, just use the old C-style cast instead:

            CameraObject* cam = (CameraObject* )op;

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 31/07/2007 at 15:05, xxxxxxxx wrote:

              It works now... but another problem:
              I don't find a parameter for setting the "Target Distance" of the camera. How can I access thos depth parameters?

              Thanks again in advance!

              Greetings,
              Jack

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 31/07/2007 at 15:20, xxxxxxxx wrote:

                Target what? Most cameras use a direction vector (eye vector or whatnot) to point the camera which is based on the camera's rotation - there isn't an explicit target and thus no 'target distance'.

                Cameras in C4D are only explicitly targeted when using a Target tag and you could do the simple math of determining the distance from the camera's global origin to the target's global origin in these cases.

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 01/08/2007 at 00:17, xxxxxxxx wrote:

                  Yes, I know that. I am writing a plugin that - besides other features - also does targeting. I won't use the normal target expression tag. My target function already works, that's not the problem.

                  Anyway, a camera has an attribute "Target distance" which can be found in the depth attributes (used for setting the focus of the DOF). The normal target expression tag can adjust the target distance attribute, I want to do that too, since it would be a very important function in my plugin.

                  Best regards,
                  Jack

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                    On 01/08/2007 at 03:41, xxxxxxxx wrote:

                    Hey Jack,

                    look up the ID in the Ocamera.h (or .res) resource file (you find this and also files for all other objects,tags,nodes,videoposts in ..c4dfolder\resource\res\description\)and then simply use cam->GetDataInstance()->SetReal().

                    The ID for targetdistance is CAMERAOBJECT_TARGETDISTANCE

                    ScoobyDoobyCammyTooly ;-D

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

                      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                      On 01/08/2007 at 03:43, xxxxxxxx wrote:

                      Btw., the functions in the CameraObject class are only there for convenience, so to make your life easier, but you can still set all the parameters via their corresponding IDs within the BaseContainer directly. Just as a side note as I think that was the initial problem you had...

                      Keep going.

                      1 Reply Last reply Reply Quote 0
                      • H Offline
                        Helper
                        last edited by

                        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                        On 01/08/2007 at 04:30, xxxxxxxx wrote:

                        That may be one of the best tips, thanks Samir! I'll try that.

                        Hope to see you in Cologne, btw πŸ™‚

                        Greetings,
                        Jack

                        1 Reply Last reply Reply Quote 0
                        • H Offline
                          Helper
                          last edited by

                          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                          On 01/08/2007 at 10:42, xxxxxxxx wrote:

                          And it works perfectly, thanks again!

                          Best regards,
                          Jack

                          1 Reply Last reply Reply Quote 0
                          • H Offline
                            Helper
                            last edited by

                            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                            On 02/08/2007 at 03:32, xxxxxxxx wrote:

                            Nope, I wonΒ΄t make it to cologne this year due to my diploma unfortunately. πŸ˜• But wish you a good time there, it was very....drunk the last time. πŸ˜‰

                            1 Reply Last reply Reply Quote 0
                            • H Offline
                              Helper
                              last edited by

                              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                              On 02/08/2007 at 03:40, xxxxxxxx wrote:

                              Hehe, yes, I remember the picture of you from last time πŸ™‚
                              I wish you success with your diploma!!

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post