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

    VolumeData: Get RayObject from Light object

    SDK Help
    0
    4
    424
    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 26/02/2013 at 07:29, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :

      ---------
      Hi!

      I'm probably just blind, the documentation is a little unclear in the VolumeData section. I'm searching
      for a way to obtain the RayLight* from a BaseObject* that has been defined in my shader plugin
      via link-field, something like this:

      BaseObject* light = bc->GetLink(MYSHADER_LIGHTSOURCE, doc);
      LONG index = **vd- >GetLightObjectIndex(light); // This is what I search for**
      RayLight* ray = vd->GetLight(index);
      

      Is it possible and I just couldn't find it in the docs?

      Thank you!
      -Niklas

      EDIT: Corrected RayObject to RayLight.

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

        On 26/02/2013 at 09:46, xxxxxxxx wrote:

        Ah, I see there's the GetObj() method. Do I have to iterator over all available RayObject's to find the
        RayObject associated with the light in the scene?

        EDIT: Ok, I think RayObject's are not the light objects..

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

          On 26/02/2013 at 23:11, xxxxxxxx wrote:

          Hi Niklas,

          Originally posted by xxxxxxxx

          Ah, I see there's the GetObj() method. Do I have to iterator over all available RayObject's to find the
          RayObject associated with the light in the scene?

          You can get each light with GetLight() then check BaseObject* RayLight::link against the light link pointer in your shader.

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

            On 27/02/2013 at 07:07, xxxxxxxx wrote:

            Thank you, Yannick. This works fine.

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