sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    C SDK - How to get reference for the camera object(s)?

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 2 Posters 431 Views 2 Watching
    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.
    • G Offline
      Gábor
      last edited by

      The get and set functions defined in camera.h require a reference to the camera object (type: SUCameraRef). Any idea how to get this reference from the model file?

      (I can't find anything in entities.h to get the camera(s))

      1 Reply Last reply Reply Quote 0
      • tt_suT Offline
        tt_su
        last edited by

        I camera isn't an entity - so it doesn't belong to entities.

        In the Ruby API you get Camera objects from View and Page.

        In the C API there is no View object, but you get the view's camera from model:
        SUModelGetCamera
        http://www.sketchup.com/intl/en/developer/su-api/model_8h.html#a8820108ec3ba3ebf849d249845eeab34

        ...and from scenes (what used to be named Pages a long time ago in SketchUp)
        http://www.sketchup.com/intl/en/developer/su-api/scene_8h_source.html

        1 Reply Last reply Reply Quote 0
        • G Offline
          Gábor
          last edited by

          @tt_su said:

          I camera isn't an entity - so it doesn't belong to entities.

          In the Ruby API you get Camera objects from View and Page.

          In the C API there is no View object, but you get the view's camera from model:
          SUModelGetCamera
          http://www.sketchup.com/intl/en/developer/su-api/model_8h.html#a8820108ec3ba3ebf849d249845eeab34

          ...and from scenes (what used to be named Pages a long time ago in SketchUp)
          http://www.sketchup.com/intl/en/developer/su-api/scene_8h_source.html

          Thank you very much Thomthom. 😍 It is great help to me. I was searching the documentation for phrases like "getcamera" in vain.

          1 Reply Last reply Reply Quote 0
          • tt_suT Offline
            tt_su
            last edited by

            The search function in the docs sucks.
            Glad it helped.

            1 Reply Last reply Reply Quote 0
            • G Offline
              Gábor
              last edited by

              Thanks again Thomthom. Maybe there is a function to get a reference to a "Text" object as well??? I was searching the web for hours for it when I came to the conclusion that it was missing from the C SDK.

              1 Reply Last reply Reply Quote 0
              • tt_suT Offline
                tt_su
                last edited by

                You might just be right. I'll check, but it might very well be missing. The C API doesn't have full feature parity.

                1 Reply Last reply Reply Quote 0
                • G Offline
                  Gábor
                  last edited by

                  Thank you for checking it. 😄

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement