Retrieving Light properties
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/12/2003 at 10:52, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.206
Platform:
Language(s) : C++ ;---------
Hi,
Im confused how to retrieve the properties of a light.
my code so far isBaseObject *object=NULL; GeData data; LONG LightCount=0; Vector LightColour; Real LightIntensity; Vector LightPosition; Real LightFallOffMin=1000; Real LightFallOffMax=1000; // Get first object in document object=doc->GetFirstObject(); // Continue looking for lights while(object) { if(object->GetType() == Olight) { object->GetParameter(DescID(LIGHT_TYPE), data,0); LightColour = data.GetVector(LIGHT_MAIN_F); LightPosition = object->GetPos(); LightIntensity = data.GetReal(LIGHT_MAIN_HELL); LightFallOffMin = data.GetReal(LIGHT_MAIN_INNERDIST); LightFallOffMax = data.GetReal(LIGHT_MAIN_OUTERDIST); ...
I get compile errors on the #define labels:
LIGHT_MAIN_INNERDIST' : undeclared identifier
this is declare in ge_prepass.h which is declare c4d.h, which I have #included. So I don't undestand why i am getting that error.
Also, there doesn't seem to be any documentation for those variables in the SDK -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 24/12/2003 at 01:05, xxxxxxxx wrote:
Object parameters are usually defined in their description files, the light IDs are in Olight.h, also keep in mind some objects have to have their parameters obtained directly with GetParameter(), some work with GetData and then you can also use GetDataInstance. Finally, the GetParameter for the LIGHT_TYPE (which is defined in Olight.h) will return a LONG with the values LIGHT_TYPE_SPOT etc. so this is what 'data' will contain, nothing else. GetParameter fetches a single parameter.