12 #ifndef __VEX_GeoCommand__
13 #define __VEX_GeoCommand__
132 template <VEX_Precision PREC>
149 template <VEX_Precision PREC>
161 ,
myPos(0.0, 0.0, 0.0)
176 template <VEX_Precision PREC>
197 template <VEX_Precision PREC>
214 namespace VEX_DataObjID
224 {
return id.isstring(); }
228 {
return !
id.isEmpty(); }
231 template <VEX_Precision PREC,
typename OBJ_ID,
typename SEC_ID,
typename T>
236 exint srcelem,
const OBJ_ID &obj_id,
const SEC_ID &sec_id,
250 VEX_DataObjID::initID(
myObjID);
265 template <VEX_Precision PREC,
typename T>
268 template <VEX_Precision PREC,
typename T>
272 template <VEX_Precision PREC>
278 VEXint<PREC>
vtxidx, VEXint<PREC> newptnum)
296 template <VEX_Precision PREC>
302 VEXint<PREC> channelidx)
306 myChannelIdx(channelidx)
311 : myPrimNum(-1), myValue(0.0), myChannelIdx(-1)
315 VEXint<PREC>
primnum()
const {
return myPrimNum; }
320 VEXint<PREC> myPrimNum;
322 VEXint<PREC> myChannelIdx;
325 template <VEX_Precision PREC>
356 return std::get<SingleEdit>(
myData).second;
361 return std::get<FullEdit>(
myData);
373 std::variant<SingleEdit, FullEdit>
myData;
377 template <VEX_Precision PREC>
431 template <VEX_Precision PREC>
436 const UT_Array<VEXint<PREC>> &layer_ids,
bool is_collision)
439 myLayerIds(layer_ids),
440 myIsCollision(is_collision)
445 VEXint<PREC>
primnum()
const {
return myPrimNum; }
450 VEXint<PREC> myPrimNum = -1;
452 bool myIsCollision =
false;
457 template <VEX_Precision PREC>
491 template <VEX_Precision PREC>
529 template <VEX_Precision PREC,
typename OBJ_ID,
typename SEC_ID>
569 const
char *typeinfo);
571 void addAttribute(
exint srcelem,
576 void appendEdit(
exint srcelem,
577 const OBJ_ID &obj_id,
578 const SEC_ID &sec_id,
581 void appendEdit(
exint srcelem,
582 const OBJ_ID &obj_id,
583 const SEC_ID &sec_id,
586 void appendEdit(
exint srcelem,
587 const OBJ_ID &obj_id,
588 const SEC_ID &sec_id,
591 void appendEdit(
exint srcelem,
592 const OBJ_ID &obj_id,
593 const SEC_ID &sec_id,
596 void appendEdit(
exint srcelem,
597 const OBJ_ID &obj_id,
598 const SEC_ID &sec_id,
601 void appendEdit(
exint srcelem,
602 const OBJ_ID &obj_id,
603 const SEC_ID &sec_id,
606 void appendEdit(
exint srcelem,
607 const OBJ_ID &obj_id,
608 const SEC_ID &sec_id,
611 void appendEdit(
exint srcelem,
612 const OBJ_ID &obj_id,
613 const SEC_ID &sec_id,
616 void appendEdit(
exint srcelem,
617 const OBJ_ID &obj_id,
618 const SEC_ID &sec_id,
621 void appendEdit(
exint srcelem,
622 const OBJ_ID &obj_id,
623 const SEC_ID &sec_id,
626 void appendEdit(
exint srcelem,
627 const OBJ_ID &obj_id,
628 const SEC_ID &sec_id,
631 void appendEdit(
exint srcelem,
632 const OBJ_ID &obj_id,
633 const SEC_ID &sec_id,
636 void appendEdit(
exint srcelem,
637 const OBJ_ID &obj_id,
638 const SEC_ID &sec_id,
641 void appendEdit(
exint srcelem,
642 const OBJ_ID &obj_id,
643 const SEC_ID &sec_id,
646 void appendEdit(
exint srcelem,
647 const OBJ_ID &obj_id,
648 const SEC_ID &sec_id,
651 void appendEdit(
exint srcelem,
652 const OBJ_ID &obj_id,
653 const SEC_ID &sec_id,
656 void appendEdit(
exint srcelem,
657 const OBJ_ID &obj_id,
658 const SEC_ID &sec_id,
661 void appendEdit(
exint srcelem,
662 const OBJ_ID &obj_id,
663 const SEC_ID &sec_id,
666 void appendEdit(
exint srcelem,
667 const OBJ_ID &obj_id,
668 const SEC_ID &sec_id,
670 const
UT_Array<const
char *> *data);
671 void appendEdit(
exint srcelem,
672 const OBJ_ID &obj_id,
673 const SEC_ID &sec_id,
693 #define VEX_GEOATTRIBEDIT_CASE(vtype, type, name, isarray) \
694 UT_Array<VEX_DataCommandAttribEdit<PREC, OBJ_ID, SEC_ID, type>> * \
697 if (myType == vtype && myIsArray == isarray)\
698 return (UT_Array<VEX_DataCommandAttribEdit<PREC, OBJ_ID, SEC_ID, type>>*) myCmdList;\
701 #define VEX_GEOATTRIBEDIT_CASE_DIRECT(ty, name) \
702 VEX_GEOATTRIBEDIT_CASE(VEX_VexTypeResolver<VEX##ty<PREC>>::type,VEX##ty<PREC>,name,false)
703 #define VEX_GEOATTRIBEDIT_CASE_ARRAY(ty, name) \
704 VEX_GEOATTRIBEDIT_CASE(VEX_VexTypeResolver<VEX##ty<PREC>>::type,const UT_Array<VEX##ty<PREC>>*,name,true)
730 #undef VEX_GEOATTRIBEDIT_CASE_ARRAY
731 #undef VEX_GEOATTRIBEDIT_CASE_DIRECT
732 #undef VEX_GEOATTRIBEDIT_CASE
804 template <VEX_Precision PREC>
806 template <VEX_Precision PREC>
809 template <VEX_Precision PREC>
815 VEXint<PREC> ptnum0, VEXint<PREC> ptnum1,
837 template <VEX_Precision PREC>
847 void appendEdit(
exint srcelem,
861 template <VEX_Precision PREC>
871 const char *hardenString(
const char *str);
899 return myPointAdd.isEmpty() &&
900 myPrimAdd.isEmpty() &&
901 myVertexAdd.isEmpty() &&
902 myVertexRewire.isEmpty() &&
903 myAttribEdit.isEmpty() &&
904 myUsdEdit.isEmpty() &&
905 myEdgeGroupEdit.isEmpty() &&
906 myAgentChannelEdit.isEmpty() &&
907 myAgentXformEdit.isEmpty() &&
908 myAgentClipEdit.isEmpty() &&
909 myAgentLayerEdit.isEmpty() &&
910 myAgentAddClip.isEmpty() &&
911 myPrimChannelEdit.isEmpty() &&
912 myPointRemove.isEmpty() &&
913 myPointWithPrimRemove.isEmpty() &&
914 myPrimRemove.isEmpty() &&
915 myPrimWithPointRemove.isEmpty() &&
916 myVertexRemove.isEmpty() &&
917 myLocalVariables.empty() &&
932 VEXint<PREC> addPoint(
exint srcelem, VEXint<PREC> srcpt);
933 VEXint<PREC> addVertex(
exint srcelem, VEXint<PREC> primnum,
939 VEXint<PREC> ptnum0, VEXint<PREC> ptnum1,
942 void addLocalVariable(
exint srcelem,
const char *attrib,
const char *local);
946 void rewireVertex(
exint srcelem, VEXint<PREC> primum,
947 VEXint<PREC> vtxidx, VEXint<PREC> ptnum);
950 void removePoint(
exint srcelem, VEXint<PREC> ptnum,
bool includeprims);
951 void removePrim(
exint srcelem, VEXint<PREC> primnum,
bool includepoints);
952 void removeVertex(
exint srcelem, VEXint<PREC> primnum);
954 void setAgentChannelValue(
exint srcelem, VEXint<PREC> primnum,
956 VEXint<PREC> channelidx);
958 void setAgentTransform(
exint srcelem, VEXint<PREC> primnum,
962 void setAgentTransforms(
exint srcelem, VEXint<PREC> primnum,
966 void setAgentClips(
exint srcelem, VEXint<PREC> primnum,
967 const UT_Array<VEXint<PREC>> &clipids,
970 const UT_Array<VEXint<PREC>> &clipxformgroupids,
971 const UT_Array<VEXint<PREC>> &cliplayerids,
972 const UT_Array<VEXint<PREC>> &cliplayermodes,
974 const UT_Array<VEXint<PREC>> &cliplayerparents);
976 void setAgentLayers(
exint srcelem, VEXint<PREC> primnum,
977 const UT_Array<VEXint<PREC>> &layer_ids,
982 VEXint<PREC> primnum,
985 const bool keep_ref);
987 void primChannelInsertKey(
exint srcelem,
988 VEXint<PREC> primnum,
991 void primChannelDestroyKey(
exint srcelem,
992 VEXint<PREC> primnum,
995 void primChannelClear(
exint srcelem, VEXint<PREC> primnum);
997 void primChannelSetKeyValue(
exint srcelem, VEXint<PREC> primnum,
998 float time,
float value,
1001 void primChannelSetKeySlope(
exint srcelem, VEXint<PREC> primnum,
1002 float time,
float slope,
1005 void primChannelSetKeyAccel(
exint srcelem, VEXint<PREC> primnum,
VEX_GeoCommandAgentAddClip(exint srcelem, VEXint< PREC > primnum, const UT_StringHolder &clip_name, const UT_StringHolder &clip_path, bool keep_ref)
VEX_Type
VEX variable types.
UT_Array< VEX_GeoCommandPrimAdd< PREC > > myPrimAdd
const UT_Array< VEXfloat< PREC > > & clipweights() const
#define VEX_GEOATTRIBEDIT_CASE_ARRAY(ty, name)
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
VEX_GeoCommandAgentClipEdit(exint srcelem, VEXint< PREC > primnum, const UT_Array< VEXint< PREC >> &clipids, const UT_Array< VEXfloat< PREC >> &cliptimes, const UT_Array< VEXfloat< PREC >> &clipweights, const UT_Array< VEXint< PREC >> &clipxformgroupids, const UT_Array< VEXint< PREC >> &cliplayerids, const UT_Array< VEXint< PREC >> &cliplayermodes, const UT_Array< VEXfloat< PREC >> &cliplayerweights, const UT_Array< VEXint< PREC >> &cliplayerparents)
UT_Array< VEX_GeoCommandAgentXformEdit< PREC > > myAgentXformEdit
void set(VEXmat3< PREC > v)
VEX_GeoCommandEdgeGroupEdit()
VEXint< PREC > primnum() const
UT_StringMap< VariableEntry > myLocalVariables
UT_Array< VEX_GeoEdgeGroupEdit< PREC > * > myEdgeGroupEdit
const UT_Array< VEXint< PREC > > & cliplayerids() const
VEX_GeoCommandAgentLayerEdit(exint srcelem, VEXint< PREC > primnum, const UT_Array< VEXint< PREC >> &layer_ids, bool is_collision)
VEX_GeoCommandAgentAddClip()
GA_API const UT_StringHolder accel
imath_half_bits_t half
if we're in a C-only context, alias the half bits type to half
void set(VEXint< PREC > v)
const SEC_ID & secID() const
UT_PageArray< VEXint< PREC >, 1, true, false, 10, exint > BlockArray
GT_API const UT_StringHolder time
const OBJ_ID & objID() const
VEXint< PREC > primnum() const
GLsizei const GLchar *const * path
VEX_GeoEdgeGroupEdit(const UT_StringHolder &groupname)
UT_Array< VEX_GeoCommandEdgeGroupEdit< PREC > > myCmdList
UT_StringSet * myNewVisualizers
UT_Array< VEXint< PREC > > myClipXformGroupIds
constexpr VEX_Precision VEX_64
VEX_GeoCommandAgentChannelEdit()
UT_Array< VEXfloat< PREC > > myClipTimes
VEX_API VEX_GeoPrimType typeFromString(const char *)
UT_Array< VEXint< PREC > > myClipLayerIds
VEX_GeoCommandPrimAdd(exint srcelem, VEX_GeoPrimType primtype)
VEXint< PREC > ptnum() const
VEX_GeoCommandPointAdd(exint srcelem, VEXint< PREC > srcpt)
UT_Array< VEX_GeoCommandAgentChannelEdit< PREC > > myAgentChannelEdit
#define VEX_GEOATTRIBEDIT_CASE_DIRECT(ty, name)
const UT_StringHolder & name() const
GLfloat GLfloat GLfloat v2
const UT_StringHolder & groupName() const
VEX_GeoDictType dict() const
VEX_GeoCommandVertexRewire()
GLfloat GLfloat GLfloat GLfloat v3
VEX_GeoCommandObjectRemove()
VEX_GeoCommandAgentChannelEdit(exint srcelem, VEXint< PREC > primnum, const VEXfloat< PREC > &value, VEXint< PREC > channelidx)
typename VEX_PrecisionResolver< P >::vec3_type VEXvec3
VEX_GeoTypeInfo typeinfo() const
UT_Array< VEX_GeoCommandObjectRemove< PREC > > myPrimRemove
VEX_GeoCommandPrimChannelEdit()
VEXint< PREC > primnum() const
#define VEX_GEOATTRIBEDIT_CASE(vtype, type, name, isarray)
void set(VEXmat4< PREC > v)
VEXint< PREC > data() const
UT_Array< VEXint< PREC > > myClipLayerParents
UT_Array< VEX_UsdEdit< PREC > * > myUsdEdit
VEX_AttribEditIndexMap myUsdEditIndexMap
UT_Array< VEX_GeoCommandAgentClipEdit< PREC > > myAgentClipEdit
void set(VEXfloat< PREC > v)
VEX_GeoCommandEdgeGroupEdit(exint srcelem, VEXint< PREC > ptnum0, VEXint< PREC > ptnum1, VEXint< PREC > data)
UT_StringHolder myGroupName
const UT_Array< VEX_GeoCommandEdgeGroupEdit< PREC > > & cmd() const
VEXfloat< PREC > value() const
VEX_GeoCommand(exint srcelem)
bool shouldcreate() const
VEX_GeoCommandObjectRemove(exint srcelem, VEXint< PREC > obj_id)
VEXint< PREC > primnum() const
typename VEX_PrecisionResolver< P >::float_type VEXfloat
void set(VEXmat2< PREC > v)
VEX_DataCommandAttribEdit()
SYS_FORCE_INLINE const UT_StringHolder & UTmakeUnsafeRef(const UT_StringRef &ref)
Convert a UT_StringRef into a UT_StringHolder that is a shallow reference.
VEX_GeoCommandAgentClipEdit()=default
VEXint< PREC > primnum() const
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
UT_Array< VEX_GeoCommandPrimChannelEdit< PREC > > myPrimChannelEdit
UT_Array< VEX_GeoCommandPointAdd< PREC > > myPointAdd
UT_StringHolder myClipPath
VEX_AttribEditIndexMap myAttribEditIndexMap
VEXint< PREC > srcpt() const
UT_Array< VEXint< PREC > > myClipIds
UT_StringHolder myClipName
constexpr VEX_Precision VEX_32
typename VEX_PrecisionResolver< P >::mat4_type VEXmat4
GLuint const GLchar * name
VEX_API std::size_t hash_value(const VEX_AttribEditId &id)
const UT_Array< VEXint< PREC > > & clipxformgroupids() const
VEXint< PREC > ptNum0() const
VEX_GeoCommandPrimChannelEdit(exint srcelem, VEXint< PREC > primnum, VEX_GeoPrimChannelOperation operation, float time=0.0, float value=0.0, VEX_GeoPrimChannelKeyHalf half=VEX_GeoPrimChannelKeyHalf::InOut)
void set(VEXvec2< PREC > v)
VEX_GeoCommandVertexAdd()
VEX_GeoPrimChannelKeyHalf
VEXint< PREC > ptNum1() const
const UT_Array< VEXint< PREC > > & layerIds() const
UT_Array< VEX_GeoCommandObjectRemove< PREC > > myVertexRemove
const UT_Array< VEXint< PREC > > & cliplayermodes() const
VEX_DataCommandAttribEdit(exint srcelem, const OBJ_ID &obj_id, const SEC_ID &sec_id, VEX_GeoMode mode, T data)
VEX_EXTERN_TEMPLATE(VEX_AttribEdit< VEX_32, VEXint< VEX_32 >, VEXint< VEX_32 >>)
VEX_API VEX_GeoMode modeFromString(const char *)
VEX_GeoCommandAgentLayerEdit()=default
typename VEX_PrecisionResolver< P >::mat2_type VEXmat2
VEXint< PREC > primnum() const
VEX_GeoTypeInfo myTypeInfo
typename VEX_PrecisionResolver< P >::vec2_type VEXvec2
VEX_GeoCommandPointAdd(exint srcelem, VEXvec3< PREC > pos)
VEX_AttribEditId(VEX_GeoDictType dict, const UT_StringRef &path, const UT_StringRef &name, UseUnsafeStringsType)
const UT_Array< VEXfloat< PREC > > & cliplayerweights() const
VEXint< PREC > ptnum() const
UT_Array< VEX_GeoCommandVertexAdd< PREC > > myVertexAdd
UT_Array< VEXint< PREC > > myClipLayerModes
UT_Array< VEXfloat< PREC > > myClipLayerWeights
bool operator==(const VEX_AttribEditId &other) const
UT_Array< VEX_GeoCommandObjectRemove< PREC > > myPointWithPrimRemove
VEX_GeoPrimType type() const
UT_Array< VEX_GeoCommandVertexRewire< PREC > > myVertexRewire
VEX_AttribEditId(VEX_GeoDictType dict, const UT_StringHolder &path, const UT_StringHolder &name)
UT_Array< VEX_GeoCommandObjectRemove< PREC > > myPrimWithPointRemove
typename VEX_PrecisionResolver< P >::vec4_type VEXvec4
UT_Array< VEX_GeoCommandAgentLayerEdit< PREC > > myAgentLayerEdit
VEXint< PREC > channelIdx() const
UT_Array< VEXfloat< PREC > > myClipWeights
typename VEX_PrecisionResolver< P >::int_type VEXint
VEXint< PREC > vtxidx() const
VEX_API VEX_GeoDictType dictFromString(const char *)
const UT_StringHolder & path() const
VEX_GeoCommandVertexAdd(exint srcelem, VEXint< PREC > primnum, VEXint< PREC > ptnum)
const UT_Array< VEXint< PREC > > & clipids() const
const VEXint< PREC > primnum() const
const UT_Array< VEXfloat< PREC > > & cliptimes() const
UT_Array< VEX_GeoCommandAgentAddClip< PREC > > myAgentAddClip
const DefaultValue & defaultValue() const
VEX_GeoPrimChannelKeyHalf myHalf
void set(VEXvec4< PREC > v)
const UT_Array< VEXint< PREC > > & cliplayerparents() const
VEX_GeoPrimChannelOperation
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T clip(const T &p, const Box< T > &box) IMATH_NOEXCEPT
typename VEX_PrecisionResolver< P >::mat3_type VEXmat3
void sort(I begin, I end, const Pred &pred)
VEXvec3< PREC > pos() const
UT_Array< VEX_GeoAttribEdit< PREC > * > myAttribEdit
UT_Array< VEX_GeoCommandObjectRemove< PREC > > myPointRemove
VEX_GeoCommandAgentClipEdit & operator=(const VEX_GeoCommandAgentClipEdit &)=default
VEX_GeoCommandVertexRewire(exint srcelem, VEXint< PREC > primnum, VEXint< PREC > vtxidx, VEXint< PREC > newptnum)
VEX_GeoPrimChannelOperation myOperation
void set(VEXvec3< PREC > v)
VEXint< PREC > objID() const
VEX_API VEX_GeoTypeInfo typeinfoFromString(const char *)