The Skylight object is not exposed as a class in the SDK, but you can create an instance in a scene from its class ID:
INode* maxLightsDemoUtility::createSkyLight(){
Interface *ip = GetCOREInterface();
TimeValue tv(0);
// Light
INode *nodeLight;
GenLight* lightObjLight = (GenLight*) CreateInstance(LIGHT_CLASS_ID,Class_ID(0x7bf61478, 0x522e4705));
// show the gizmo
lightObjLight->Enable(true);
// add to scene
nodeLight = ip->CreateObjectNode(lightObjLight);
nodeLight->SetName(_T("MySkyLight")); // light naming
return nodeLight;
}
You can get the Class ID of a class in MaxScript using ShowClass(), or from an object in a scene using $obj.ClassID():
showClass "Skylight"
Skylight : light {7bf61478,522e4705}
Hope that helps.
Drew
how can i get color of sky light in c++.
i try this and its always return same value.
: : Point3 trans = SkyLight->GetNodeTM(GetCOREInterface11()->GetTime()).GetTrans();
: : Point3 color;
Properties props;
std::string objString;
ObjectState ostate = SkyLight->EvalWorldState(0);
LightObject *light = (LightObject*)ostate.obj;
color = light->GetRGBColor(GetCOREInterface()->GetTime(), FOREVER);