All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: LOP_PRMShared.h
7  *
9  * This enum defines common LOP parameters and callbacks.
10  *
11 */
13 #include "LOP_API.h"
15 #ifndef __LOP_PRMShared__
16 #define __LOP_PRMShared__
18 #include <HUSD/HUSD_Merge.h>
19 #include <OP/OP_Error.h>
20 #include <PRM/PRM_ChoiceList.h>
21 #include <PRM/PRM_Default.h>
22 #include <PRM/PRM_Name.h>
23 #include <PRM/PRM_SpareData.h>
24 #include <PRM/PRM_Template.h>
25 #include <UT/UT_BoundingBox.h>
26 #include <UT/UT_Matrix4.h>
28 class LOP_Node;
29 class HUSD_AutoAnyLock;
30 class HUSD_FindPrims;
31 class HUSD_FindProps;
32 class OP_Node;
33 class OP_Context;
35 class PRM_Parm;
36 class UT_String;
38 enum {
42 };
105 // Select a single primitive in the viewport or using the prim picker dialog.
107 // Select a single primitive using only the prim picker dialog.
109 // Spare data for a parameter that supports multiple primitive path strings.
111 // Select multiple primitives using the viewport or prim picker dialog.
113 // As above, but with a multiline text editor.
115 // Select multiple primitives using only the prim picker dialog.
117 // Select multiple primitives using the viewport or prim picker dialog,
118 // including allowing selecting instance proxy prims.
120 // As above, but with a multiline text editor.
122 // Spare data indicating a file parameter specifies a USD file for reading.
124 // Spare data indicating a file parameter specifies a USD file for writing.
127 // Version of lopPrimPathSpareData that only supports selection using the
128 // primitive picker dialog. This can be used for nodes in other contexts that
129 // reference a LOP using a parameter called "loppath".
132 // Material LOPs
138  int which_input,
139  const UT_String &primpattern,
140  PRM_Name *menu_entries,
141  int max_menu_entries);
144  int which_input,
145  const UT_String &primpattern,
146  const UT_String &variantset,
147  PRM_Name *menu_entries,
148  int max_menu_entries);
150 extern LOP_API void lopBuildUsdExpansionRulesMenu(void *,
151  PRM_Name *menu_entries,
152  int max_menu_entries,
153  const PRM_SpareData *,
154  const PRM_Parm *);
157  const UT_StringRef &merge_style_str);
170 };
173 public:
174  static const LOP_XformComponents &identity();
176  void combine(const LOP_XformComponents &other);
177  void applyXform(UT_Matrix4D &xform);
186 };
187 extern LOP_API const PRM_Template *lopXformTemplates();
190  fpreal t, LOP_XformComponents *accumulate = nullptr);
191 extern LOP_API UT_Matrix4D lopBuildMultiparmXform(OP_Node &node, int inst,
192  fpreal t, LOP_XformComponents *accumulate = nullptr);
194 // Evaluate the lopSetStageMetadataName parameter on the node, and return true
195 // if the parm is set to "on", or set to "auto" and the node has no input.
196 extern LOP_API bool lopSetStageMetadata(LOP_Node *node, fpreal t);
198 // Parm templates for setting arbitrary context options.
200 extern LOP_API void lopSetContextOptions(OP_Node &node,
201  OP_Context &context,
202  OP_ContextOptionsWriteScope &options);
204 // Return true if there are any time dependent context options, even if we
205 // don't set them. We still need to be time dependent.
207  OP_Context &context,
208  OP_ContextOptionsWriteScope &options);
211  OP_Context &context,
212  OP_ContextOptionsWriteScope &options);
214 // Parm templates for defining a collection using every available algorithm,
215 // rather than just a primitive pattern string.
217  PRM_Name &collapser_parm_name);
219  PRM_Name &collection_parm_name,
220  const char *multiparm_prefix = nullptr,
221  const char *default_prim_pattern = nullptr);
223 // Class to hold evaluated parm templates so we can evaluate all our parms
224 // before using the parm values to populate an HUSD_FindPrims.
226 {
227 public:
229  // Find by pattern string.
231  // Find by bounding box.
234  // Find by primitive type.
236  // Find by primitive type.
238  // Find by VEXpression.
240  // Find by primitive kind.
242 };
245 // Evaluate an adhoc collection multiparm and use it to fill in a
246 // LOP_CollectionParms array.
247 extern LOP_API void lopGetCollectionParms(LOP_Node &node,
248  const PRM_Template &collection_parm_template,
249  fpreal t, LOP_CollectionParms &collection_parms);
250 // Take a populated LOP_CollectionParms array and use it to fill in an
251 // HUSD_FindParms object.
252 extern LOP_API bool lopGetCollection(LOP_Node &node,
253  const LOP_CollectionParms &collection_parms,
254  fpreal t, HUSD_FindPrims &findprims);
256 // Return a template for a multiparm that lets the user configure an asset
257 // resolver using strings.
259 // Populate a map of asset resolver configuration strings from the
260 // lopResolverStringsTemplate multiparm on the specified node.
262  UT_StringMap<UT_StringHolder> &resolverstrings);
264 // Return a template for a multiparm that lets the user configure the variant
265 // selection fallback rules for a stage.
267 // Populate a map of variant sets to an array of variant set selection values
268 // that should be used for that variant set if no explicit selections has been
269 // authored on a prim.
271  UT_StringMap<UT_StringArray> &variantselections,
272  bool add_empty_selections = false);
274 // Checks if the layer at a given file path exists, using the resolver context
275 // of the supplied data lock.
277  HUSD_AutoAnyLock &lock,
278  const UT_StringRef &filepath,
279  const UT_StringRef &handle_missing_files,
280  bool *skip_this_file);
282 // Take a single string, tokenize it, and return an array of valid USD
283 // primitive path strings. Return true if any paths are being returned.
284 extern LOP_API bool lopTokenizePrimitivePaths(const UT_StringRef &str,
285  UT_StringArray &primpaths,
286  UT_StringSet *uniqueprimpaths = nullptr);
288 #endif
LOP_API const UT_StringHolder lopAttrControlMultiplyToken
UT_StringHolder myPrimPurpose
UT_StringHolder myPattern
LOP_API PRM_ChoiceList lopParentPrimTypeMenu
LOP_API PRM_Name lopMatBindPurposeMultiName
LOP_API PRM_Template lopCollectionCollapserParmTemplate(PRM_Name &collapser_parm_name)
LOP_API PRM_Name lopHandleMissingFilesName
LOP_API PRM_ChoiceList lopPrimKindWithAutoMenu
LOP_API void lopGetCollectionParms(LOP_Node &node, const PRM_Template &collection_parm_template, fpreal t, LOP_CollectionParms &collection_parms)
LOP_API PRM_ChoiceList lopSecondInputCollectionsMenu
LOP_API const UT_StringHolder lopSinglePrimSelectTooltip
LOP_API UT_Matrix4D lopBuildXform(OP_Node &node, fpreal t, LOP_XformComponents *accumulate=nullptr)
LOP_API PRM_Default lopHandleMissingFilesDefault
LOP_API PRM_Name lopPrimPathName
LOP_API void lopBuildUsdPrimVariantSetsMenu(LOP_Node &node, int which_input, const UT_String &primpattern, PRM_Name *menu_entries, int max_menu_entries)
LOP_API PRM_ChoiceList lopRefPrimMenu
LOP_API const PRM_Template & lopTimeBasedContextOptionsTemplate()
LOP_API PRM_Default lopParentPrimTypeDefault
LOP_API PRM_Default lopPrimKindWithAutoDefault
Transformation order of scales, rotates, and translates.
Definition: UT_XformOrder.h:23
LOP_API UT_Matrix4D lopBuildMultiparmXform(OP_Node &node, int inst, fpreal t, LOP_XformComponents *accumulate=nullptr)
LOP_API const UT_StringHolder lopAttrControlAddToken
void applyXform(UT_Matrix4D &xform)
LOP_API PRM_ChoiceList lopAllPrimTypeMenu
UT_StringHolder myPrimType
LOP_API PRM_ChoiceList lopAttributeTypeMenu
LOP_API void lopBuildUsdExpansionRulesMenu(void *, PRM_Name *menu_entries, int max_menu_entries, const PRM_SpareData *, const PRM_Parm *)
UT_BoundingBoxD myBBox
LOP_API PRM_Default lopPrimSpecifierDefault
Definition: UT_Error.h:25
LOP_API PRM_Name lopLoadPayloadsName
LOP_API PRM_ChoiceList lopPrimPathMenu
LOP_API PRM_Name lopParentPrimTypeName
LOP_API PRM_Default lopEditPrimPathDefault
LOP_API PRM_Default lopPrimPatternDefault
LOP_API PRM_ChoiceList lopPrimPurposeMenu
LOP_API PRM_Default lopSetStageMetadataDefault
LOP_API PRM_Default lopPrimPurposeDefault
LOP_API PRM_SpareData lopUsdReadFilePathSpareData
LOP_API void lopSetContextOptions(OP_Node &node, OP_Context &context, OP_ContextOptionsWriteScope &options)
LOP_API PRM_Name lopSetStageMetadataName
UT_Array< LOP_CollectionParmSet > LOP_CollectionParms
LOP_API PRM_SpareData lopNonVisualPrimPatternSpareData
LOP_API OP_ERROR lopCheckForMissingFile(LOP_Node &node, HUSD_AutoAnyLock &lock, const UT_StringRef &filepath, const UT_StringRef &handle_missing_files, bool *skip_this_file)
LOP_API PRM_ChoiceList lopMatBindPurposeMenu
LOP_API const UT_StringHolder lopAttrControlDisconnectInputToken
LOP_API void lopBuildUsdPrimVariantsMenu(LOP_Node &node, int which_input, const UT_String &primpattern, const UT_String &variantset, PRM_Name *menu_entries, int max_menu_entries)
LOP_API const PRM_Template & lopVariantSelectionFallbackTemplate()
UT_XformOrder myOrder
LOP_API PRM_SpareData lopMultiPrimPathSpareData
LOP_API PRM_Default lopPrimKindQueryDefault
LOP_API PRM_ChoiceList lopAttributeInterpolationMenu
LOP_API PRM_Default lopPrimKindDefault
LOP_API bool lopGetCollection(LOP_Node &node, const LOP_CollectionParms &collection_parms, fpreal t, HUSD_FindPrims &findprims)
LOP_API PRM_Name lopPrimKindName
LOP_API PRM_Name lopPathName
LOP_API PRM_ChoiceList lopPrimDrawModeMenu
UT_StringHolder myTargetMethod
LOP_API const PRM_Template * lopMultiparmXformTemplates()
LOP_API const UT_StringHolder lopAttrControlSetExistingToken
LOP_API PRM_Name lopPrimSpecifierName
LOP_API PRM_Default lopMatBindPurposeDefault
LOP_API PRM_Name lopCollectionName
LOP_API PRM_SpareData lopPrimPatternSpareData
LOP_API bool lopSetTimeBasedContextOptions(OP_Node &node, OP_Context &context, OP_ContextOptionsWriteScope &options)
LOP_API bool lopTokenizePrimitivePaths(const UT_StringRef &str, UT_StringArray &primpaths, UT_StringSet *uniqueprimpaths=nullptr)
LOP_API PRM_ChoiceList lopPrimSpecifierMenu
UT_StringHolder myContainmentStr
LOP_API const UT_StringHolder lopAttrControlBlockToken
LOP_API PRM_ChoiceList lopPrimKindMenu
LOP_API PRM_Default lopParentPrimTypeScopeDefault
LOP_API PRM_Name lopResolverContextAssetPathName
void combine(const LOP_XformComponents &other)
#define LOP_API
Definition: LOP_API.h:10
LOP_API PRM_ChoiceList lopFirstInputCollectionsMenu
LOP_API PRM_Default lopRefPrimDefault
LOP_API PRM_Name lopEditRootLayerName
LOP_API PRM_Name lopPrimCountName
LOP_API PRM_SpareData lopPrimPathSpareData
GLdouble t
Definition: glad.h:2397
LOP_API const UT_StringHolder lopAttrControlSetToken
LOP_API PRM_Name lopPropPatternName
LOP_API PRM_Template lopCollectionParmTemplate(PRM_Name &collection_parm_name, const char *multiparm_prefix=nullptr, const char *default_prim_pattern=nullptr)
LOP_API const UT_StringHolder lopMultiPrimSelectTooltip
LOP_API PRM_SpareData lopUsdWriteFilePathSpareData
LOP_API PRM_ChoiceList lopAttributeColorSpaceMenu
LOP_API const UT_StringHolder lopAttrControlNoneToken
LOP_API PRM_Name lopInsertionPointDescriptorName
UT_StringHolder myVexExpr
LOP_API PRM_ChoiceList lopMergeStyleMenu
LOP_API const PRM_Template & lopPatternMatchingContextOptionsTemplate()
fpreal64 fpreal
Definition: SYS_Types.h:277
LOP_API const PRM_Template * lopXformTemplates()
LOP_API PRM_Name lopPrimPatternName
LOP_API PRM_SpareData lopMultilinePrimPatternWithProxiesSpareData
Definition: HUSD_Merge.h:28
LOP_API bool lopApplyVariantSelectionFallbacksFromMultiparm(OP_Node &node, UT_StringMap< UT_StringArray > &variantselections, bool add_empty_selections=false)
LOP_API void lopSetPatternMatchingContextOptions(OP_Node &node, OP_Context &context, OP_ContextOptionsWriteScope &options)
LOP_API HUSD_MergeStyle lopMergeStyleFromString(const UT_StringRef &merge_style_str)
LOP_API PRM_ChoiceList lopSetStageMetadataMenu
bool accumulate(const PointDataTreeT &points, const std::string &attribute, typename PromoteType< ValueT >::Highest &total, const FilterT &filter, typename PointDataTreeT::template ValueConverter< ResultTreeT >::Type *totalTree)
Evaluates the total value of a point attribute and returns whether the value is valid. Optionally constructs localised total value trees.
LOP_API PRM_SpareData lopMultilinePrimPatternSpareData
LOP_API bool lopGetResolverContextStringsFromMultiparm(OP_Node &node, UT_StringMap< UT_StringHolder > &resolverstrings)
LOP_API PRM_ChoiceList lopPrimKindQueryMenu
static const LOP_XformComponents & identity()
LOP_API const PRM_Template & lopResolverContextStringsTemplate()
LOP_API PRM_Name lopCollectionCollapserName
LOP_API PRM_SpareData lopPrimPatternWithProxiesSpareData
LOP_API PRM_ChoiceList lopHandleMissingFilesMenu
LOP_API const PRM_Template & lopContextOptionsTemplate()
LOP_API PRM_ChoiceList lopConcretePrimTypeMenu
UT_StringHolder myPrimKind
LOP_API bool lopSetStageMetadata(LOP_Node *node, fpreal t)
LOP_API PRM_Default lopAddPrimPathDefault
LOP_API PRM_SpareData lopNonVisualPrimPathSpareData
LOP_API PRM_SpareData lopPrimPathDialogSpareData