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

    Polygonize() and scene camera

    Cinema 4D SDK
    c++ sdk
    2
    4
    521
    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.
    • WickedPW
      WickedP
      last edited by WickedP

      Hi folks,

      whenever I use doc->Polygonize(), the selected camera gets ignored in the newly cloned scene. The cloned scene is viewed from the editor camera and not the original selected camera copy.

      How can I keep the current/selected camera when Polygnize()'ing a document?

      Edit: apologies, looks like I've selected the incorrect forum category, it should be in Cinema 4D Development, not the Cineware forum. I can't seem to edit this.

      WP.

      wickedp.com

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        Hi,

        the only way of doing it is to retrieve the current camera of your document with GetSceneCamera from the BaseDraw

        Once you got the camera, clone it and move it to the document and set the camera in the new document with SetSceneCamera

        Before that, you probably have to set the active document to the new one with SetActiveDocument

        Of course, if the camera is animated trough its parent, you will have to copy it also or bake it before.

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • WickedPW
          WickedP
          last edited by

          Thanks Manuel,

          making a copy of the camera and inserting into the new scene should do.

          Just out of interest, why would it not just keep and use the selected camera in the first place? Seems a bit odd.

          WP.

          wickedp.com

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            hi,

            i don't think there's a particular reason for not keeping the camera but the function description is :

            Returns a copy of the document in which all objects are converted to polygon objects.

            As a camera doesn't generate polygon, it just doesn't follow. I'm expecting the same for light, atmosphere, background, floor etc.

            Cheers,
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

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