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

    Create ObjectData as Light Objects

    SDK Help
    0
    4
    447
    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
      Helper
      last edited by

      On 21/11/2016 at 12:31, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R18 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hello.

      I want to create an ObjectData plugin that will represent a Light source in my render engine.
      There are 2 things that come in my mind but I'm not sure which is possible.

      1. Override (somehow) the Olight object and hide the unwanted parameters. Also, add as parameters anything else that I need.

      2. Create an ObjectData plugin and manually draw in the viewport the lines defined in Spot, Omni e.t.c.

      Is there any example that I could use as reference ?

      Thank you for your time.

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

        On 22/11/2016 at 02:09, xxxxxxxx wrote:

        Hello,

        it is not possible to "override" build-in object types. A third party renderer typically introduces a custom tag that can be added to a light object to provide additional parameters.

        One can of course create an ObjectData based plugin that draws something in the viewport. This is done by implementing ObjectData::Draw(). You find some examples in the Draw Manual and the example projects like "Gravitation".

        best wishes,
        Sebastian

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

          On 22/11/2016 at 05:24, xxxxxxxx wrote:

          Hello.

          How can I make the ObjectData operate as light in the viewport ? 
          I want to illuminate only specific parts of the scene and create shadows behind the other objects.

          I add a GetVirtualObjects method in my ObjectData plugin and I return an Olight object. I can modify this Light Object using my Object Data parameters, but I cannot control it in the viewport.

          The Cinema 4D spot light can be configured in the viewport using the dots that control the inner/outer angle. How can I create such viewport controls ?

          Thank you again.

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

            On 22/11/2016 at 08:33, xxxxxxxx wrote:

            Hello,

            such "viewport controls" are called handles. They are implemented with GetHandleCount() / GetHandle() / SetHandle(). You find some examples in the SDK example project like the "Circle" example.

            For questions no longer related to the thread's original topic please open a new thread. Thanks.

            best wishes,
            Sebastian

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