24 #ifndef USDGEOM_GENERATED_POINTINSTANCER_H
25 #define USDGEOM_GENERATED_POINTINSTANCER_H
364 static const TfType &_GetStaticTfType();
366 static bool _IsTypedSchema();
370 const TfType &_GetTfType()
const override;
808 VtInt64Array
const *
ids =
nullptr)
const;
825 const int elementSize = 1);
939 const std::vector<UsdTimeCode>& times,
999 const VtIntArray& protoIndices,
1000 const VtVec3fArray& positions,
1001 const VtVec3fArray& velocities,
1003 const VtVec3fArray& accelerations,
1004 const VtVec3fArray& scales,
1005 const VtQuatfArray& orientations,
1006 const VtVec3fArray& angularVelocities,
1009 const std::vector<bool>&
mask,
1010 float velocityScale = 1.0);
1022 const VtIntArray& protoIndices,
1023 const VtVec3fArray& positions,
1024 const VtVec3fArray& velocities,
1026 const VtVec3fArray& accelerations,
1027 const VtVec3fArray& scales,
1028 const VtQuathArray& orientations,
1029 const VtVec3fArray& angularVelocities,
1032 const std::vector<bool>&
mask,
1033 float velocityScale = 1.0);
1039 bool _GetPrototypePathsForInstanceTransforms(
1040 const VtIntArray& protoIndices,
1045 bool _GetProtoIndicesForInstanceTransforms(
1047 VtIntArray* protoIndices)
const;
1052 bool _ComputePointInstancerAttributesPreamble(
1056 VtIntArray* protoIndices,
1058 std::vector<bool>*
mask)
const;
1065 template<
class QuatType>
1066 bool _DoComputeInstanceTransformsAtTimes(
1068 const std::vector<UsdTimeCode>& times,
1075 template <
class QuatType>
1076 static bool _DoComputeInstanceTransformsAtTime(
1080 const VtIntArray& protoIndices,
1081 const VtVec3fArray& positions,
1082 const VtVec3fArray& velocities,
1084 const VtVec3fArray& accelerations,
1085 const VtVec3fArray& scales,
1087 const VtVec3fArray& angularVelocities,
1090 const std::vector<bool>&
mask,
1091 float velocityScale = 1.0);
1132 VtVec3fArray* extent,
1140 VtVec3fArray* extent,
1160 std::vector<VtVec3fArray>* extents,
1161 const std::vector<UsdTimeCode>& times,
1169 std::vector<VtVec3fArray>* extents,
1170 const std::vector<UsdTimeCode>& times,
1184 bool _ComputeExtentAtTimePreamble(
1186 VtIntArray* protoIndices,
1187 std::vector<bool>*
mask,
1191 bool _ComputeExtentFromTransforms(
1192 VtVec3fArray* extent,
1193 const VtIntArray& protoIndices,
1194 const std::vector<bool>&
mask,
1197 const VtMatrix4dArray& instanceTransforms,
1201 bool _ComputeExtentAtTime(
1202 VtVec3fArray* extent,
1207 bool _ComputeExtentAtTimes(
1208 std::vector<VtVec3fArray>* extent,
1209 const std::vector<UsdTimeCode>& times,
1218 const int elementSize)
1224 size_t maskSize = mask.size();
1225 if (maskSize == 0 || dataArray->size() == (size_t)elementSize){
1228 else if ((maskSize * elementSize) != dataArray->size()){
1229 TF_WARN(
"Input mask's size (%zu) is not compatible with the "
1230 "input dataArray (%zu) and elementSize (%d).",
1231 maskSize, dataArray->size(), elementSize);
1235 T* beginData = dataArray->data();
1236 T* currData = beginData;
1237 size_t numPreserved = 0;
1238 for (
size_t i = 0; i < maskSize; ++i) {
1241 for (
int j = 0;
j < elementSize; ++
j) {
1242 *currData = beginData[i +
j];
1245 numPreserved += elementSize;
1248 if (numPreserved < dataArray->
size()) {
1249 dataArray->resize(numPreserved);
Exclude the transform on the proto's root.
UsdGeomPointInstancer(const UsdSchemaBase &schemaObj)
Compute and apply the PointInstancer mask.
USDGEOM_API UsdRelationship CreatePrototypesRel() const
USDGEOM_API bool DeactivateIds(VtInt64Array const &ids) const
static constexpr UsdTimeCode Default()
USDGEOM_API bool ComputeExtentAtTimes(std::vector< VtVec3fArray > *extents, const std::vector< UsdTimeCode > ×, const UsdTimeCode baseTime) const
USDGEOM_API UsdAttribute CreateOrientationsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
GT_API const UT_StringHolder time
USDGEOM_API UsdAttribute CreatePositionsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute CreateIdsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
GLsizei const GLchar *const * path
USDGEOM_API bool UsesOrientationsf(UsdAttribute &rotationsAttr) const
static const UsdSchemaKind schemaKind
USDGEOM_API bool ActivateId(int64_t id) const
USDGEOM_API UsdRelationship GetPrototypesRel() const
USDGEOM_API UsdAttribute CreateAngularVelocitiesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
UsdGeomPointInstancer(const UsdPrim &prim=UsdPrim())
USDGEOM_API UsdAttribute CreateAccelerationsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
UsdStagePtr UsdStageWeakPtr
USDGEOM_API UsdAttribute CreateScalesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute CreateProtoIndicesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
static bool ApplyMaskToArray(std::vector< bool > const &mask, VtArray< T > *dataArray, const int elementSize=1)
static USDGEOM_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Represents a concrete typed schema.
USDGEOM_API UsdAttribute GetOrientationsAttr() const
USDGEOM_API UsdAttribute GetPositionsAttr() const
USDGEOM_API bool InvisIds(VtInt64Array const &ids, UsdTimeCode const &time) const
USDGEOM_API size_t GetInstanceCount(UsdTimeCode timeCode=UsdTimeCode::Default()) const
USDGEOM_API bool UsdGeomPointInstancerSetOrMergeOverOp(std::vector< int64_t > const &items, SdfListOpType op, UsdPrim const &prim, TfToken const &metadataName)
USDGEOM_API UsdAttribute GetScalesAttr() const
USDGEOM_API UsdAttribute GetAccelerationsAttr() const
virtual USDGEOM_API ~UsdGeomPointInstancer()
Destructor.
std::vector< TfToken > TfTokenVector
Convenience types.
USDGEOM_API bool ComputeExtentAtTime(VtVec3fArray *extent, const UsdTimeCode time, const UsdTimeCode baseTime) const
static USDGEOM_API UsdGeomPointInstancer Get(const UsdStagePtr &stage, const SdfPath &path)
USDGEOM_API std::vector< bool > ComputeMaskAtTime(UsdTimeCode time, VtInt64Array const *ids=nullptr) const
GA_API const UT_StringHolder transform
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
USDGEOM_API UsdAttribute CreateInvisibleIdsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API bool UsdGeomPointInstancerApplyNewStyleListOps()
USDGEOM_API UsdAttribute GetVelocitiesAttr() const
USDGEOM_API UsdAttribute GetAngularVelocitiesAttr() const
USDGEOM_API bool VisId(int64_t id, UsdTimeCode const &time) const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
USDGEOM_API UsdAttribute GetInvisibleIdsAttr() const
USDGEOM_API bool ActivateAllIds() const
USDGEOM_API UsdAttribute GetOrientationsfAttr() const
#define PXR_NAMESPACE_CLOSE_SCOPE
USDGEOM_API bool InvisId(int64_t id, UsdTimeCode const &time) const
static USDGEOM_API UsdGeomPointInstancer Define(const UsdStagePtr &stage, const SdfPath &path)
USDGEOM_API bool VisIds(VtInt64Array const &ids, UsdTimeCode const &time) const
USDGEOM_API bool ActivateIds(VtInt64Array const &ids) const
USDGEOM_API UsdAttribute CreateVelocitiesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API bool ComputeInstanceTransformsAtTime(VtArray< GfMatrix4d > *xforms, const UsdTimeCode time, const UsdTimeCode baseTime, const ProtoXformInclusion doProtoXforms=IncludeProtoXform, const MaskApplication applyMask=ApplyMask) const
USDGEOM_API bool VisAllIds(UsdTimeCode const &time) const
USDGEOM_API UsdAttribute GetProtoIndicesAttr() const
Ignore the PointInstancer mask.
USDGEOM_API bool ComputeInstanceTransformsAtTimes(std::vector< VtArray< GfMatrix4d >> *xformsArray, const std::vector< UsdTimeCode > ×, const UsdTimeCode baseTime, const ProtoXformInclusion doProtoXforms=IncludeProtoXform, const MaskApplication applyMask=ApplyMask) const
USDGEOM_API UsdAttribute CreateOrientationsfAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
USDGEOM_API UsdAttribute GetIdsAttr() const
USDGEOM_API bool DeactivateId(int64_t id) const
Include the transform on the proto's root.