VolumeData: Get RayObject from Light object
-
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!
-NiklasEDIT: Corrected RayObject to RayLight.
-
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..
-
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.
-
On 27/02/2013 at 07:07, xxxxxxxx wrote:
Thank you, Yannick. This works fine.