37 if (blight ==
nullptr) {
41 pxr::UsdLuxLightAPI light_api(
prim_);
46 if (
prim_.IsA<pxr::UsdLuxDiskLight>()) {
51 pxr::UsdLuxDiskLight disk_light(
prim_);
53 if (pxr::UsdAttribute radius_attr = disk_light.GetRadiusAttr()) {
55 if (radius_attr.Get(&radius, motionSampleTime)) {
61 else if (
prim_.IsA<pxr::UsdLuxRectLight>()) {
66 pxr::UsdLuxRectLight rect_light(
prim_);
68 if (pxr::UsdAttribute width_attr = rect_light.GetWidthAttr()) {
70 if (width_attr.Get(&width, motionSampleTime)) {
75 if (pxr::UsdAttribute height_attr = rect_light.GetHeightAttr()) {
77 if (height_attr.Get(&height, motionSampleTime)) {
83 else if (
prim_.IsA<pxr::UsdLuxSphereLight>()) {
87 pxr::UsdLuxSphereLight sphere_light(
prim_);
89 pxr::UsdAttribute treatAsPoint_attr = sphere_light.GetTreatAsPointAttr();
91 if (treatAsPoint_attr && treatAsPoint_attr.Get(&treatAsPoint, motionSampleTime) &&
96 else if (pxr::UsdAttribute radius_attr = sphere_light.GetRadiusAttr()) {
98 if (radius_attr.Get(&radius, motionSampleTime)) {
104 pxr::UsdLuxShapingAPI shaping_api = pxr::UsdLuxShapingAPI(
prim_);
105 if (shaping_api && shaping_api.GetShapingConeAngleAttr().IsAuthored()) {
108 if (pxr::UsdAttribute cone_angle_attr = shaping_api.GetShapingConeAngleAttr()) {
109 float cone_angle = 0.0f;
110 if (cone_angle_attr.Get(&cone_angle, motionSampleTime)) {
115 if (pxr::UsdAttribute cone_softness_attr = shaping_api.GetShapingConeSoftnessAttr()) {
116 float cone_softness = 0.0f;
117 if (cone_softness_attr.Get(&cone_softness, motionSampleTime)) {
123 else if (
prim_.IsA<pxr::UsdLuxDistantLight>()) {
126 pxr::UsdLuxDistantLight distant_light(
prim_);
128 if (pxr::UsdAttribute angle_attr = distant_light.GetAngleAttr()) {
130 if (angle_attr.Get(&
angle, motionSampleTime)) {
138 if (pxr::UsdAttribute intensity_attr = light_api.GetIntensityAttr()) {
139 float intensity = 0.0f;
140 if (intensity_attr.Get(&intensity, motionSampleTime)) {
143 blight->
energy = intensity * 4.0f;
154 if (pxr::UsdAttribute exposure_attr = light_api.GetExposureAttr()) {
155 float exposure = 0.0f;
156 if (exposure_attr.Get(&exposure, motionSampleTime)) {
162 if (pxr::UsdAttribute color_attr = light_api.GetColorAttr()) {
164 if (color_attr.Get(&
color, motionSampleTime)) {
172 if (pxr::UsdAttribute enable_temperature_attr = light_api.GetEnableColorTemperatureAttr()) {
173 bool enable_temperature =
false;
174 if (enable_temperature_attr.Get(&enable_temperature, motionSampleTime)) {
175 if (enable_temperature) {
181 if (pxr::UsdAttribute color_temperature_attr = light_api.GetColorTemperatureAttr()) {
182 float color_temperature = 6500.0f;
183 if (color_temperature_attr.Get(&color_temperature, motionSampleTime)) {
189 if (pxr::UsdAttribute diff_attr = light_api.GetDiffuseAttr()) {
190 float diff_fac = 1.0f;
191 if (diff_attr.Get(&diff_fac, motionSampleTime)) {
195 if (pxr::UsdAttribute spec_attr = light_api.GetSpecularAttr()) {
196 float spec_fac = 1.0f;
197 if (spec_attr.Get(&spec_fac, motionSampleTime)) {
203 if (pxr::UsdAttribute normalize_attr = light_api.GetNormalizeAttr()) {
205 if (normalize_attr.Get(&
normalize, motionSampleTime)) {