23 #include <pxr/base/gf/math.h>
24 #include <pxr/base/gf/matrix4f.h>
26 #include <pxr/usd/usdGeom/xform.h>
40 float transform_from_usd[4][4];
49 std::string
prim_path = use_parent_xform_ ?
prim_.GetParent().GetPath().GetAsString() :
67 *r_is_constant =
true;
72 pxr::UsdGeomXformable xformable;
74 if (use_parent_xform_) {
75 xformable = pxr::UsdGeomXformable(
prim_.GetParent());
78 xformable = pxr::UsdGeomXformable(
prim_);
87 *r_is_constant = !xformable.TransformMightBeTimeVarying();
90 pxr::GfMatrix4d usd_local_xf;
91 bool reset_xform_stack;
92 xformable.GetLocalTransformation(&usd_local_xf, &reset_xform_stack,
time);
95 pxr::GfMatrix4f
mat4f = pxr::GfMatrix4f(usd_local_xf);
103 float scale_mat[4][4];
116 pxr::UsdGeomXformable xformable(
prim_);
123 bool reset_xform_stack =
false;
125 return !xformable.GetOrderedXformOps(&reset_xform_stack).empty();
130 if (!
prim_.IsValid()) {
134 if (
prim_.IsInPrototype()) {
141 if (
prim_.IsA<pxr::UsdGeomXformable>()) {
147 pxr::UsdPrim cur_parent =
prim_.GetParent();
149 if (use_parent_xform_) {
150 cur_parent = cur_parent.GetParent();
153 while (cur_parent && !cur_parent.IsPseudoRoot()) {
154 if (cur_parent.IsA<pxr::UsdGeomXformable>()) {
157 cur_parent = cur_parent.GetParent();
struct bConstraint * BKE_constraint_add_for_object(struct Object *ob, const char *name, short type)
void id_us_plus(struct ID *id)
General operations, lookup, etc. for blender objects.
void BKE_object_apply_mat4(struct Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
struct Object * BKE_object_add_only_object(struct Main *bmain, int type, const char *name) ATTR_RETURNS_NONNULL
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void unit_m4(float m[4][4])
void scale_m4_fl(float R[4][4], float scale)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
@ CONSTRAINT_TYPE_TRANSFORM_CACHE
Object is a sort of wrapper for general info.
const std::string & prim_path() const
const ImportSettings * settings_
const USDImportParams & import_params_
GREAL mat4f[4][4]
Matrix 4D, row ordered.
float conversion_mat[4][4]