34 #include "SOP_Expand.proto.h"
49 using namespace UT::Literal;
50 using namespace HDK_Sample;
70 SOP_Expand::theSOPTypeName,
72 SOP_Expand::myConstructor,
73 SOP_Expand::buildTemplates(),
101 static const char *theDsFile = R
"THEDSFILE(
109 parmtag { "script_action" "import soputils\nkwargs['geometrytype'] = kwargs['node'].parmTuple('grouptype')\nkwargs['inputindex'] = 0\nsoputils.selectGroupParm(kwargs)" }
110 parmtag { "script_action_help" "Select geometry from an available viewport.\nShift-click to turn on Select Groups." }
111 parmtag { "script_action_icon" "BUTTONS_reselect" }
125 label "Uniform Scale"
134 SOP_Expand::buildTemplates()
174 virtual void cook(
const CookParms &cookparms)
const;
188 SOP_Expand::cookVerb()
const
197 auto &&sopparms = cookparms.
parms<SOP_ExpandParms>();
235 case SOP_ExpandEnums::Grouptype::POINTS:
241 case SOP_ExpandEnums::Grouptype::PRIMS:
255 point_group = point_group_closure.get();
269 GA_Range point_range = detail->getPointRange(point_group);
280 if (!point_range.isEmpty())
281 centroid /= point_range.getEntries();
297 detail->setPos3(pt_off, pos);
305 case SOP_ExpandEnums::Grouptype::POINTS:
310 cookparms.
select(*point_group);
315 case SOP_ExpandEnums::Grouptype::PRIMS:
320 cookparms.
select(*prim_group);
332 detail->getP()->bumpDataId();
void setChoiceListPtr(const UT_StringRef &name, PRM_ChoiceList *list)
UT_ErrorSeverity sopAddWarning(int code, const char *msg=0, const UT_SourceLocation *loc=0) const
virtual CookMode cookMode(const SOP_NodeParms *parms) const
virtual void cook(const CookParms &cookparms) const
This is the function that does the actual work.
void newSopOperator(OP_OperatorTable *table)
bool addOperator(OP_Operator *op, std::ostream *err=nullptr)
A range of elements in an index-map.
GA_API const UT_StringHolder scale
virtual UT_StringHolder name() const
Constructs a PRM_Template list from an embedded .ds file or an istream.
PRM_Template * templates() const
const GA_PrimitiveGroup * parsePrimitiveGroups(const char *pat, const GroupCreator &creator, bool numok=true, bool ordered=false, bool strict=false, GA_Index prim_offset=GA_Index(0), ParseInfo *info=0)
static const SOP_NodeVerb::Register< SOP_ExpandVerb > theVerb
static GA_PointGroupUPtr getDetachedPointClosure(const GEO_Detail &gdp, const GA_Group &group)
void select(GA_GroupType gtype=GA_GROUP_PRIMITIVE) const
GLenum GLenum GLsizei void * table
static PRM_ChoiceList groupMenu
GA_API const UT_StringHolder parms
virtual SOP_NodeParms * allocParms() const
bool selectionEnabled() const
virtual ~SOP_ExpandVerb()
UT_UniquePtr< GA_PointGroup > GA_PointGroupUPtr
const GA_PointGroup * parsePointGroups(const char *pat, const GroupCreator &creator, bool numok=true, bool ordered=false, bool strict=false, GA_Index point_offset=GA_Index(0), ParseInfo *info=0)
GU_DetailHandle & gdh() const
The initial state of gdh depends on the cookMode()
SYS_FORCE_INLINE bool isstring() const