22 #include <pxr/usd/usdLux/diskLight.h>
23 #include <pxr/usd/usdLux/distantLight.h>
24 #include <pxr/usd/usdLux/rectLight.h>
25 #include <pxr/usd/usdLux/sphereLight.h>
52 pxr::UsdLuxLight usd_light;
54 switch (light->
type) {
59 pxr::UsdLuxDiskLight disk_light = pxr::UsdLuxDiskLight::Define(
stage,
usd_path);
60 disk_light.CreateRadiusAttr().Set(light->
area_size, timecode);
61 usd_light = disk_light;
65 pxr::UsdLuxRectLight rect_light = pxr::UsdLuxRectLight::Define(
stage,
usd_path);
66 rect_light.CreateWidthAttr().Set(light->
area_size, timecode);
67 rect_light.CreateHeightAttr().Set(light->
area_sizey, timecode);
68 usd_light = rect_light;
72 pxr::UsdLuxRectLight rect_light = pxr::UsdLuxRectLight::Define(
stage,
usd_path);
73 rect_light.CreateWidthAttr().Set(light->
area_size, timecode);
74 rect_light.CreateHeightAttr().Set(light->
area_size, timecode);
75 usd_light = rect_light;
81 pxr::UsdLuxSphereLight sphere_light = pxr::UsdLuxSphereLight::Define(
stage,
usd_path);
82 sphere_light.CreateRadiusAttr().Set(light->
area_size, timecode);
83 usd_light = sphere_light;
90 BLI_assert(!
"is_supported() returned true for unsupported light type");
99 usd_intensity = light->
energy;
102 usd_intensity = light->
energy / 100.0f;
104 usd_light.CreateIntensityAttr().Set(usd_intensity, timecode);
106 usd_light.CreateColorAttr().Set(pxr::GfVec3f(light->
r, light->
g, light->
b), timecode);
107 usd_light.CreateSpecularAttr().Set(light->
spec_fac, timecode);
Object is a sort of wrapper for general info.
const pxr::SdfPath & usd_path() const
pxr::UsdTimeCode get_export_time_code() const
const USDExporterContext usd_export_context_
virtual bool is_supported(const HierarchyContext *context) const override
USDLightWriter(const USDExporterContext &ctx)
virtual void do_write(HierarchyContext &context) override
struct SELECTID_Context context
const pxr::SdfPath usd_path
const pxr::UsdStageRefPtr stage