16 #include <pxr/usd/usdGeom/camera.h>
32 pxr::UsdGeomCamera cam_prim(
prim_);
39 cam_prim.GetFocalLengthAttr().Get(&val, motionSampleTime);
40 pxr::VtValue verApOffset;
41 cam_prim.GetVerticalApertureOffsetAttr().Get(&verApOffset, motionSampleTime);
42 pxr::VtValue horApOffset;
43 cam_prim.GetHorizontalApertureOffsetAttr().Get(&horApOffset, motionSampleTime);
44 pxr::VtValue clippingRangeVal;
45 cam_prim.GetClippingRangeAttr().Get(&clippingRangeVal, motionSampleTime);
46 pxr::VtValue focalDistanceVal;
47 cam_prim.GetFocusDistanceAttr().Get(&focalDistanceVal, motionSampleTime);
48 pxr::VtValue fstopVal;
49 cam_prim.GetFStopAttr().Get(&fstopVal, motionSampleTime);
50 pxr::VtValue projectionVal;
51 cam_prim.GetProjectionAttr().Get(&projectionVal, motionSampleTime);
53 cam_prim.GetVerticalApertureAttr().Get(&verAp, motionSampleTime);
55 cam_prim.GetHorizontalApertureAttr().Get(&horAp, motionSampleTime);
57 bcam->
lens = val.Get<
float>();
63 bcam->
shiftx = verApOffset.Get<
float>();
64 bcam->
shifty = horApOffset.Get<
float>();
66 bcam->
type = (projectionVal.Get<pxr::TfToken>().GetString() ==
"perspective") ?
CAM_PERSP :
70 bcam->
clip_start =
max_ff(0.1f, clippingRangeVal.UncheckedGet<pxr::GfVec2f>()[0]);
71 bcam->
clip_end = clippingRangeVal.UncheckedGet<pxr::GfVec2f>()[1];
Camera data-block and utility functions.
void * BKE_camera_add(struct Main *bmain, const char *name)
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
MINLINE float max_ff(float a, float b)
Object is a sort of wrapper for general info.
void create_object(Main *bmain, double motionSampleTime) override
void read_object_data(Main *bmain, double motionSampleTime) override
struct CameraDOFSettings dof