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
    • Recent
    • Tags
    • Users
    • Login

    Object Plugin not Rendering, ok in Viewport

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 385 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

      On 02/07/2015 at 04:09, xxxxxxxx wrote:

      Hi c4d Community

      i'm trying to learn the Basics of python Plugin development, and i'm stuck with a little Problem.

      I wrote a script, which sets Keys on a Plugin-Object and then changes the Active Camera in the Object Manager acordingly to the Keyvalues. This works fine in the Viewport, but when I render nothing changes.

      The "key to camera comparison" functions are called in the Draw function like this:

      def Draw(self, op, drawpass, bd, bh) :
          if drawpass == c4d.DRAWPASS_OBJECT:
              self.activate_scene(op)
              self.activate_light(op)
              self.activate_camera(op)
          return c4d.DRAWRESULT_OK

      Do I have to "set" something in General or in my functions to say that the Render is the Same than the Viewport? c4d.EventAdd() and c4d.CallCommand(12147) seem to make no difference as well...

      Sorry for this "noobish" question 😉
      Thanks!!

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

        On 03/07/2015 at 02:19, xxxxxxxx wrote:

        Hello,

        Draw() functions are just used to draw something in the (OpenGL) viewport. So this function has nothing to do with the rendering process and therefore is not called during rendering.

        In fact, the viewport drawing (an the call of Draw()) is executed from a separate thread. So it is forbidden to manipulate the scene from Draw(). Please read "Threading Information". Modifying the scene from the drawing-thread could lead to any kind of problems including crashes.

        Best wishes,
        Sebastian

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

          On 04/07/2015 at 01:40, xxxxxxxx wrote:

          Ah I get it, thanks for your reply 🙂 But now the next question is, which functions are responsible for the rendering output. Which functions are called for the actual Rendering process? 
          I would be very happy to get some tipps, because I somehow can't figure it out.
          Thanks a lot!

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

            On 13/07/2015 at 05:24, xxxxxxxx wrote:

            Hello,

            the functions responsible for the rendering output are the functions responsible for the state of the scene. In case of a generator this is ObjectData.GetVirtualObjects, in case of a tag it is TagData.Execute, etc.

            best wishes,
            Sebastian

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