Fix #117816: Import USD DistantLight as Blender Sun light
The UsdLuxDistantLight schema was being checked under the wrong conditional. Pull Request: https://projects.blender.org/blender/blender/pulls/117820
This commit is contained in:
committed by
Jesse Yurkovich
parent
df8c85d3f9
commit
4797773604
@@ -134,16 +134,16 @@ void USDLightReader::read_object_data(Main *bmain, const double motionSampleTime
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (prim_.IsA<pxr::UsdLuxDistantLight>()) {
|
||||
blight->type = LA_SUN;
|
||||
}
|
||||
else if (prim_.IsA<pxr::UsdLuxDistantLight>()) {
|
||||
blight->type = LA_SUN;
|
||||
|
||||
pxr::UsdLuxDistantLight distant_light(prim_);
|
||||
if (distant_light) {
|
||||
if (pxr::UsdAttribute angle_attr = distant_light.GetAngleAttr()) {
|
||||
float angle = 0.0f;
|
||||
if (angle_attr.Get(&angle, motionSampleTime)) {
|
||||
blight->sun_angle = DEG2RADF(angle) * 2.0f;
|
||||
}
|
||||
pxr::UsdLuxDistantLight distant_light(prim_);
|
||||
if (distant_light) {
|
||||
if (pxr::UsdAttribute angle_attr = distant_light.GetAngleAttr()) {
|
||||
float angle = 0.0f;
|
||||
if (angle_attr.Get(&angle, motionSampleTime)) {
|
||||
blight->sun_angle = DEG2RADF(angle * 2.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user