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

    Retrieving Light properties

    SDK Help
    0
    2
    212
    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

      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 is

          
          
          
          
          BaseObject *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

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

        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.

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