23 namespace SOP_PackFolderEnums
69 if (useinput != src.
useinput)
return false;
72 if (visible != src.
visible)
return false;
89 for (
int i = 0; i < list.
entries(); i++)
95 buf.
appendSprintf(
"%s", (list(i).useinput) ?
"true" :
"false");
118 myOnlyPackUnpacked =
false;
119 myIgnoreEmpty =
false;
133 if (myFolder != src.myFolder)
return false;
134 if (myMethod != src.myMethod)
return false;
135 if (myPack != src.myPack)
return false;
136 if (myOnlyPackUnpacked != src.myOnlyPackUnpacked)
return false;
137 if (myIgnoreEmpty != src.myIgnoreEmpty)
return false;
138 if (myNames != src.myNames)
return false;
156 graph->
evalOpParm(myFolder, nodeidx,
"folder", time, 0);
159 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
162 graph->
evalOpParm(myPack, nodeidx,
"pack", time, 0);
163 myOnlyPackUnpacked =
false;
164 if (
true && ( (
true&&!(((getPack()!=1)))) ) )
165 graph->
evalOpParm(myOnlyPackUnpacked, nodeidx,
"onlypackunpacked", time, 0);
166 myIgnoreEmpty =
false;
168 graph->
evalOpParm(myIgnoreEmpty, nodeidx,
"ignoreempty", time, 0);
172 graph->
evalOpParm(length, nodeidx,
"names", time, 0);
173 if (length < 0) length = 0;
174 myNames.setSize(length);
181 auto && _curentry = myNames(i);
183 _curentry.useinput =
true;
185 graph->
evalOpParmInst(_curentry.useinput, nodeidx,
"useinput#", parmidx, offsets, time, 0, 2-1);
186 _curentry.name =
""_UTsh;
188 graph->
evalOpParmInst(_curentry.name, nodeidx,
"name#", parmidx, offsets, time, 0, 2-1);
189 _curentry.type =
""_UTsh;
191 graph->
evalOpParmInst(_curentry.type, nodeidx,
"type#", parmidx, offsets, time, 0, 2-1);
192 _curentry.visible = 0;
194 graph->
evalOpParmInst(_curentry.visible, nodeidx,
"visible#", parmidx, offsets, time, 0, 2-1);
195 _curentry.treatasfolder = 0;
196 if (
true && ( (
true&&!(((_curentry.type==
"shp"))||((_curentry.type==
"skel"))||((_curentry.type==
"rig"))||((_curentry.type==
"ctrl"))||((_curentry.type==
"char"))||((_curentry.type==
"graph")))) ) )
197 graph->
evalOpParmInst(_curentry.treatasfolder, nodeidx,
"treatasfolder#", parmidx, offsets, time, 0, 2-1);
218 template <
typename T>
225 if (idx.
size() != instance.
size()+1)
247 else if (instance[0] < myNames.entries())
249 auto && _data = myNames(instance[0]);
285 { doGetParmValue(idx, instance, value); }
287 { doGetParmValue(idx, instance, value); }
289 { doGetParmValue(idx, instance, value); }
291 { doGetParmValue(idx, instance, value); }
293 { doGetParmValue(idx, instance, value); }
295 { doGetParmValue(idx, instance, value); }
297 { doGetParmValue(idx, instance, value); }
299 { doGetParmValue(idx, instance, value); }
301 { doGetParmValue(idx, instance, value); }
303 { doGetParmValue(idx, instance, value); }
305 { doGetParmValue(idx, instance, value); }
307 template <
typename T>
314 if (idx.
size() != instance.
size()+1)
338 if (newsize < 0) newsize = 0;
339 myNames.setSize(newsize);
345 myNames.setSizeIfNeeded(instance[0]+1);
346 auto && _data = myNames(instance[0]);
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); }
393 { doSetParmValue(idx, instance, value); }
411 if (fieldnum.
size() < 1)
422 return "onlypackunpacked";
424 return "ignoreempty";
426 if (fieldnum.
size() == 1)
439 return "treatasfolder#";
450 if (fieldnum.
size() < 1)
451 return PARM_UNSUPPORTED;
465 if (fieldnum.
size() == 1)
466 return PARM_MULTIPARM;
503 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
505 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
507 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
520 loadData(is, rampdata);
538 int typelen = colon - data.
buffer();
552 {
int64 iv =
v; UTwrite(os, &iv); }
554 { UTwrite<fpreal64>(os, &
v); }
556 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
558 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
559 UTwrite<fpreal64>(os, &v.
z()); }
561 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
562 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
574 if (s) s->save(ostr);
576 saveData(os, result);
583 ostr << s->getDataTypeToken();
588 saveData(os, result);
592 void save(std::ostream &os)
const
596 saveData(os, myFolder);
597 saveData(os, myMethod);
598 saveData(os, myPack);
599 saveData(os, myOnlyPackUnpacked);
600 saveData(os, myIgnoreEmpty);
603 UTwrite(os, &length);
606 auto && _curentry = myNames(i);
608 saveData(os, _curentry.useinput);
609 saveData(os, _curentry.name);
610 saveData(os, _curentry.type);
611 saveData(os, _curentry.visible);
612 saveData(os, _curentry.treatasfolder);
628 loadData(is, myFolder);
629 loadData(is, myMethod);
630 loadData(is, myPack);
631 loadData(is, myOnlyPackUnpacked);
632 loadData(is, myIgnoreEmpty);
636 myNames.setSize(length);
639 auto && _curentry = myNames(i);
641 loadData(is, _curentry.useinput);
642 loadData(is, _curentry.name);
643 loadData(is, _curentry.type);
644 loadData(is, _curentry.visible);
645 loadData(is, _curentry.treatasfolder);
658 if (!thissop)
return getFolder();
660 OP_Utils::evalOpParm(result, thissop,
"folder", cookparms.
getCookTime(), 0);
668 if (!thissop)
return getMethod();
670 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
678 if (!thissop)
return getPack();
680 OP_Utils::evalOpParm(result, thissop,
"pack", cookparms.
getCookTime(), 0);
688 if (!thissop)
return getOnlyPackUnpacked();
690 OP_Utils::evalOpParm(result, thissop,
"onlypackunpacked", cookparms.
getCookTime(), 0);
698 if (!thissop)
return getIgnoreEmpty();
700 OP_Utils::evalOpParm(result, thissop,
"ignoreempty", cookparms.
getCookTime(), 0);
708 if (!thissop)
return getNames().entries();
710 OP_Utils::evalOpParm(result, thissop,
"names", cookparms.
getCookTime(), 0);
714 {
return opinstNames_useinput(cookparms, &_idx); }
718 if (!thissop)
return (myNames(_idx[0]).useinput);
720 _parmidx[1-1] = _idx[1-1] + 1;
723 OP_Utils::evalOpParmInst(result, thissop,
"useinput#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
727 {
return opinstNames_name(cookparms, &_idx); }
731 if (!thissop)
return (myNames(_idx[0]).
name);
733 _parmidx[1-1] = _idx[1-1] + 1;
736 OP_Utils::evalOpParmInst(result, thissop,
"name#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
740 {
return opinstNames_type(cookparms, &_idx); }
744 if (!thissop)
return (myNames(_idx[0]).
type);
746 _parmidx[1-1] = _idx[1-1] + 1;
749 OP_Utils::evalOpParmInst(result, thissop,
"type#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
753 {
return opinstNames_visible(cookparms, &_idx); }
757 if (!thissop)
return (myNames(_idx[0]).visible);
759 _parmidx[1-1] = _idx[1-1] + 1;
762 OP_Utils::evalOpParmInst(result, thissop,
"visible#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
766 {
return opinstNames_treatasfolder(cookparms, &_idx); }
770 if (!thissop)
return (myNames(_idx[0]).treatasfolder);
772 _parmidx[1-1] = _idx[1-1] + 1;
775 OP_Utils::evalOpParmInst(result, thissop,
"treatasfolder#", _parmidx, cookparms.
getCookTime(), 0, 2-1);
784 bool myOnlyPackUnpacked;
int64 opNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
exint getNestNumParms(TempIndex idx) const override
void setOnlyPackUnpacked(bool val)
GLenum GLuint GLenum GLsizei const GLchar * buf
SOP_Node * getNode() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool opNames_useinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool opIgnoreEmpty(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
bool load(UT_IStream &is)
bool operator!=(const SOP_PackFolderParms &src) const
T clampMaxValue(fpreal maxvalue, const T &src) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void saveData(std::ostream &os, UT_Matrix4D v)
bool opPack(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 setIgnoreEmpty(bool val)
bool opinstNames_useinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool getOnlyPackUnpacked() const
void setFolder(const UT_StringHolder &val)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
static void saveData(std::ostream &os, UT_StringHolder s)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
GLuint GLsizei GLsizei * length
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
**But if you need a result
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
T clampMinValue(fpreal minvalue, const T &src) 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.
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool opOnlyPackUnpacked(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLsizei const GLuint const GLintptr * offsets
constexpr SYS_FORCE_INLINE T & x() noexcept
int64 opNames_visible(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
UT_StringHolder opFolder(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getFolder() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void saveData(std::ostream &os, UT_Matrix2D v)
static void saveData(std::ostream &os, int64 v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
UT_StringHolder opNames_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint read(bool *array, exint sz=1)
const OP_GraphProxy * graph() const
bool operator==(const SOP_PackFolderParms &src) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, UT_Vector2D v)
void setMethod(Method val)
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
static void saveData(std::ostream &os, UT_Vector4D v)
UT_StringHolder createString(const UT_Array< Names > &list) const
bool operator!=(const Names &src) const
static void saveData(std::ostream &os, UT_Vector3D v)
GLuint const GLchar * name
void save(std::ostream &os) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
int64 opinstNames_visible(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
void setNames(const UT_Array< Names > &val)
exint entries() const
Alias of size(). size() is preferred.
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void coerceValue(T &result, const S &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
DEP_MicroNode * depnode() const
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
SYS_FORCE_INLINE void append(char character)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
fpreal getCookTime() const
const char * getNestParmName(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
const char * findChar(int c) const
UT_StringHolder opinstNames_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool operator==(const Names &src) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool getIgnoreEmpty() const
bool isParmColorRamp(exint idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
int64 opinstNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
UT_StringHolder opNames_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
exint opNames(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
const UT_Array< Names > & getNames() const
static void saveData(std::ostream &os, bool v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
OP_NodeParms & operator=(const OP_NodeParms &)=default
UT_StringHolder opinstNames_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
constexpr SYS_FORCE_INLINE T & x() noexcept