57 for (
int i = 0; i < list.
entries(); i++)
85 myPrimIDAttr =
""_UTsh;
100 if (myGroup != src.myGroup)
return false;
101 if (mySelectionIdx != src.mySelectionIdx)
return false;
102 if (myDiff != src.myDiff)
return false;
103 if (myDoPos != src.myDoPos)
return false;
104 if (myDoClr != src.myDoClr)
return false;
105 if (myDoNml != src.myDoNml)
return false;
106 if (myDoUVW != src.myDoUVW)
return false;
107 if (myDoVoxel != src.myDoVoxel)
return false;
108 if (myDoSlerp != src.myDoSlerp)
return false;
109 if (myPtIDAttr != src.myPtIDAttr)
return false;
110 if (myPrimIDAttr != src.myPrimIDAttr)
return false;
111 if (myMorph != src.myMorph)
return false;
112 if (myNblends != src.myNblends)
return false;
127 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
130 graph->
evalOpParm(mySelectionIdx, nodeidx,
"selectionidx", time, 0);
133 graph->
evalOpParm(myDiff, nodeidx,
"diff", time, 0);
136 graph->
evalOpParm(myDoPos, nodeidx,
"dopos", time, 0);
139 graph->
evalOpParm(myDoClr, nodeidx,
"doclr", time, 0);
142 graph->
evalOpParm(myDoNml, nodeidx,
"donml", time, 0);
145 graph->
evalOpParm(myDoUVW, nodeidx,
"douvw", time, 0);
148 graph->
evalOpParm(myDoVoxel, nodeidx,
"dovoxel", time, 0);
151 graph->
evalOpParm(myDoSlerp, nodeidx,
"doslerp", time, 0);
152 myPtIDAttr =
""_UTsh;
154 graph->
evalOpParm(myPtIDAttr, nodeidx,
"ptidattr", time, 0);
155 myPrimIDAttr =
""_UTsh;
157 graph->
evalOpParm(myPrimIDAttr, nodeidx,
"primidattr", time, 0);
160 graph->
evalOpParm(myMorph, nodeidx,
"morph", time, 0);
164 graph->
evalOpParm(length, nodeidx,
"nblends", time, 0);
165 if (length < 0) length = 0;
166 myNblends.setSize(length);
173 auto && _curentry = myNblends(i);
177 graph->
evalOpParmInst(_curentry.blend, nodeidx,
"blend#", parmidx, offsets, time, 0, 2-1);
198 template <
typename T>
205 if (idx.
size() != instance.
size()+1)
248 else if (instance[0] < myNblends.entries())
250 auto && _data = myNblends(instance[0]);
274 { doGetParmValue(idx, instance, value); }
276 { doGetParmValue(idx, instance, value); }
278 { doGetParmValue(idx, instance, value); }
280 { doGetParmValue(idx, instance, value); }
282 { doGetParmValue(idx, instance, value); }
284 { doGetParmValue(idx, instance, value); }
286 { doGetParmValue(idx, instance, value); }
288 { doGetParmValue(idx, instance, value); }
290 { doGetParmValue(idx, instance, value); }
292 { doGetParmValue(idx, instance, value); }
294 { doGetParmValue(idx, instance, value); }
296 template <
typename T>
303 if (idx.
size() != instance.
size()+1)
348 if (newsize < 0) newsize = 0;
349 myNblends.setSize(newsize);
355 myNblends.setSizeIfNeeded(instance[0]+1);
356 auto && _data = myNblends(instance[0]);
371 { doSetParmValue(idx, instance, value); }
373 { doSetParmValue(idx, instance, value); }
375 { doSetParmValue(idx, instance, value); }
377 { doSetParmValue(idx, instance, value); }
379 { doSetParmValue(idx, instance, value); }
381 { doSetParmValue(idx, instance, value); }
383 { doSetParmValue(idx, instance, value); }
385 { doSetParmValue(idx, instance, value); }
387 { doSetParmValue(idx, instance, value); }
389 { doSetParmValue(idx, instance, value); }
391 { doSetParmValue(idx, instance, value); }
409 if (fieldnum.
size() < 1)
416 return "selectionidx";
438 if (fieldnum.
size() == 1)
454 if (fieldnum.
size() < 1)
455 return PARM_UNSUPPORTED;
483 if (fieldnum.
size() == 1)
484 return PARM_MULTIPARM;
530 loadData(is, rampdata);
548 int typelen = colon - data.
buffer();
562 {
int64 iv =
v; UTwrite(os, &iv); }
564 { UTwrite<fpreal64>(os, &
v); }
566 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
568 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
569 UTwrite<fpreal64>(os, &v.
z()); }
571 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
572 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
584 if (s) s->save(ostr);
586 saveData(os, result);
593 ostr << s->getDataTypeToken();
598 saveData(os, result);
602 void save(std::ostream &os)
const
606 saveData(os, myGroup);
607 saveData(os, mySelectionIdx);
608 saveData(os, myDiff);
609 saveData(os, myDoPos);
610 saveData(os, myDoClr);
611 saveData(os, myDoNml);
612 saveData(os, myDoUVW);
613 saveData(os, myDoVoxel);
614 saveData(os, myDoSlerp);
615 saveData(os, myPtIDAttr);
616 saveData(os, myPrimIDAttr);
617 saveData(os, myMorph);
620 UTwrite(os, &length);
623 auto && _curentry = myNblends(i);
625 saveData(os, _curentry.blend);
641 loadData(is, myGroup);
642 loadData(is, mySelectionIdx);
643 loadData(is, myDiff);
644 loadData(is, myDoPos);
645 loadData(is, myDoClr);
646 loadData(is, myDoNml);
647 loadData(is, myDoUVW);
648 loadData(is, myDoVoxel);
649 loadData(is, myDoSlerp);
650 loadData(is, myPtIDAttr);
651 loadData(is, myPrimIDAttr);
652 loadData(is, myMorph);
656 myNblends.setSize(length);
659 auto && _curentry = myNblends(i);
661 loadData(is, _curentry.blend);
674 if (!thissop)
return getGroup();
676 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
684 if (!thissop)
return getSelectionIdx();
686 OP_Utils::evalOpParm(result, thissop,
"selectionidx", cookparms.
getCookTime(), 0);
694 if (!thissop)
return getDiff();
696 OP_Utils::evalOpParm(result, thissop,
"diff", cookparms.
getCookTime(), 0);
704 if (!thissop)
return getDoPos();
706 OP_Utils::evalOpParm(result, thissop,
"dopos", cookparms.
getCookTime(), 0);
714 if (!thissop)
return getDoClr();
716 OP_Utils::evalOpParm(result, thissop,
"doclr", cookparms.
getCookTime(), 0);
724 if (!thissop)
return getDoNml();
726 OP_Utils::evalOpParm(result, thissop,
"donml", cookparms.
getCookTime(), 0);
734 if (!thissop)
return getDoUVW();
736 OP_Utils::evalOpParm(result, thissop,
"douvw", cookparms.
getCookTime(), 0);
744 if (!thissop)
return getDoVoxel();
746 OP_Utils::evalOpParm(result, thissop,
"dovoxel", cookparms.
getCookTime(), 0);
754 if (!thissop)
return getDoSlerp();
756 OP_Utils::evalOpParm(result, thissop,
"doslerp", cookparms.
getCookTime(), 0);
764 if (!thissop)
return getPtIDAttr();
766 OP_Utils::evalOpParm(result, thissop,
"ptidattr", cookparms.
getCookTime(), 0);
774 if (!thissop)
return getPrimIDAttr();
776 OP_Utils::evalOpParm(result, thissop,
"primidattr", cookparms.
getCookTime(), 0);
784 if (!thissop)
return getMorph();
786 OP_Utils::evalOpParm(result, thissop,
"morph", cookparms.
getCookTime(), 0);
794 if (!thissop)
return getNblends().entries();
796 OP_Utils::evalOpParm(result, thissop,
"nblends", cookparms.
getCookTime(), 0);
800 {
return opinstNblends_blend(cookparms, &_idx); }
804 if (!thissop)
return (myNblends(_idx[0]).
blend);
806 _parmidx[1-1] = _idx[1-1] + 0;
809 OP_Utils::evalOpParmInst(result, thissop,
"blend#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
816 int64 mySelectionIdx;
void setGroup(const UT_StringHolder &val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
GLenum GLuint GLenum GLsizei const GLchar * buf
void setDoSlerp(bool val)
void setSelectionIdx(int64 val)
static void loadData(UT_IStream &is, bool &v)
SOP_Node * getNode() const
fpreal64 opNblends_blend(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setNblends(const UT_Array< Nblends > &val)
bool load(UT_IStream &is)
exint opNblends(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_StringHolder createString(const UT_Array< Nblends > &list) const
const UT_StringHolder & getPtIDAttr() const
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
SYS_FORCE_INLINE const char * buffer() const
int64 opSelectionIdx(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLsizei GLsizei * length
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
An output stream object that owns its own string buffer storage.
bool operator!=(const SOP_BlendShapesParms &src) const
bool operator==(const Nblends &src) const
**But if you need a result
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool opDoVoxel(const SOP_NodeVerb::CookParms &cookparms) const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Matrix4D v)
static void saveData(std::ostream &os, UT_Vector3D v)
static void saveData(std::ostream &os, UT_Vector2D v)
bool operator!=(const Nblends &src) const
bool opDoSlerp(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLsizei const GLuint const GLintptr * offsets
static void loadData(UT_IStream &is, UT_Vector2I &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
UT_StringHolder opPtIDAttr(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
bool opMorph(const SOP_NodeVerb::CookParms &cookparms) const
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
const UT_StringHolder & getPrimIDAttr() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, int64 &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void saveData(std::ostream &os, UT_Vector4D v)
bool opDoPos(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
fpreal64 opinstNblends_blend(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opDoClr(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
bool opDoUVW(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const SOP_BlendShapesParms &src) const
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void coerceValue(T &result, const S &src) const
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
DEP_MicroNode * depnode() const
bool isParmColorRamp(exint idx) const override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
Utility class for containing a color ramp.
static void loadData(UT_IStream &is, UT_Vector3I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void save(std::ostream &os) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
bool opDoNml(const SOP_NodeVerb::CookParms &cookparms) const
int64 getSelectionIdx() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
fpreal getCookTime() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const char * findChar(int c) const
ParmType getNestParmType(TempIndex fieldnum) const override
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
void setPrimIDAttr(const UT_StringHolder &val)
const UT_StringHolder & getGroup() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
bool opDiff(const SOP_NodeVerb::CookParms &cookparms) const
void setPtIDAttr(const UT_StringHolder &val)
const UT_Array< Nblends > & getNblends() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void copyFrom(const OP_NodeParms *src) override
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
UT_StringHolder opPrimIDAttr(const SOP_NodeVerb::CookParms &cookparms) const
void setDoVoxel(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept