12 #include <pxr/usd/usdLux/diskLight.h>
13 #include <pxr/usd/usdLux/distantLight.h>
14 #include <pxr/usd/usdLux/rectLight.h>
15 #include <pxr/usd/usdLux/shapingAPI.h>
16 #include <pxr/usd/usdLux/sphereLight.h>
34 if (blight ==
nullptr) {
41 #if PXR_VERSION >= 2111
42 pxr::UsdLuxLightAPI light_api(
prim_);
44 pxr::UsdLuxLight light_api(
prim_);
51 pxr::UsdLuxShapingAPI shaping_api;
55 if (
prim_.IsA<pxr::UsdLuxDiskLight>()) {
60 else if (
prim_.IsA<pxr::UsdLuxRectLight>()) {
64 else if (
prim_.IsA<pxr::UsdLuxSphereLight>()) {
67 shaping_api = pxr::UsdLuxShapingAPI(
prim_);
69 if (shaping_api && shaping_api.GetShapingConeAngleAttr().IsAuthored()) {
73 else if (
prim_.IsA<pxr::UsdLuxDistantLight>()) {
79 if (pxr::UsdAttribute intensity_attr = light_api.GetIntensityAttr()) {
80 float intensity = 0.0f;
81 if (intensity_attr.Get(&intensity, motionSampleTime)) {
88 pxr::VtValue exposure;
89 light_prim.GetExposureAttr().Get(&exposure, motionSampleTime);
95 light_prim.GetDiffuseAttr().Get(&diffuse, motionSampleTime);
98 if (pxr::UsdAttribute spec_attr = light_api.GetSpecularAttr()) {
100 if (spec_attr.Get(&spec, motionSampleTime)) {
105 if (pxr::UsdAttribute color_attr = light_api.GetColorAttr()) {
107 if (color_attr.Get(&
color, motionSampleTime)) {
116 pxr::VtValue use_color_temp;
117 light_prim.GetEnableColorTemperatureAttr().Get(&use_color_temp, motionSampleTime);
122 pxr::VtValue color_temp;
123 light_prim.GetColorTemperatureAttr().Get(&color_temp, motionSampleTime);
126 switch (blight->
type) {
130 pxr::UsdLuxRectLight rect_light(
prim_);
136 if (pxr::UsdAttribute width_attr = rect_light.GetWidthAttr()) {
138 if (width_attr.Get(&
width, motionSampleTime)) {
143 if (pxr::UsdAttribute height_attr = rect_light.GetHeightAttr()) {
145 if (height_attr.Get(&
height, motionSampleTime)) {
152 pxr::UsdLuxDiskLight disk_light(
prim_);
158 if (pxr::UsdAttribute radius_attr = disk_light.GetRadiusAttr()) {
160 if (radius_attr.Get(&radius, motionSampleTime)) {
167 if (
prim_.IsA<pxr::UsdLuxSphereLight>()) {
169 pxr::UsdLuxSphereLight sphere_light(
prim_);
175 if (pxr::UsdAttribute radius_attr = sphere_light.GetRadiusAttr()) {
177 if (radius_attr.Get(&radius, motionSampleTime)) {
184 if (
prim_.IsA<pxr::UsdLuxSphereLight>()) {
186 pxr::UsdLuxSphereLight sphere_light(
prim_);
192 if (pxr::UsdAttribute radius_attr = sphere_light.GetRadiusAttr()) {
194 if (radius_attr.Get(&radius, motionSampleTime)) {
203 if (pxr::UsdAttribute cone_angle_attr = shaping_api.GetShapingConeAngleAttr()) {
204 float cone_angle = 0.0f;
205 if (cone_angle_attr.Get(&cone_angle, motionSampleTime)) {
210 if (pxr::UsdAttribute cone_softness_attr = shaping_api.GetShapingConeSoftnessAttr()) {
211 float cone_softness = 0.0f;
212 if (cone_softness_attr.Get(&cone_softness, motionSampleTime)) {
219 if (
prim_.IsA<pxr::UsdLuxDistantLight>()) {
220 pxr::UsdLuxDistantLight distant_light(
prim_);
222 if (!distant_light) {
226 if (pxr::UsdAttribute angle_attr = distant_light.GetAngleAttr()) {
228 if (angle_attr.Get(&
angle, motionSampleTime)) {
typedef float(TangentPoint)[2]
General operations, lookup, etc. for blender lights.
struct Light * BKE_light_add(struct Main *bmain, const char *name) ATTR_WARN_UNUSED_RESULT
General operations, lookup, etc. for blender objects.
struct Object * BKE_object_add_only_object(struct Main *bmain, int type, const char *name) ATTR_RETURNS_NONNULL
Object is a sort of wrapper for general info.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
void create_object(Main *bmain, double motionSampleTime) override
void read_object_data(Main *bmain, double motionSampleTime) override
const USDImportParams & import_params_
float light_intensity_scale