HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LOP_PRMShared.h
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  *
8  * COMMENTS:
9  * This enum defines common LOP parameters and callbacks.
10  *
11 */
12 
13 #include "LOP_API.h"
14 
15 #ifndef __LOP_PRMShared__
16 #define __LOP_PRMShared__
17 
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>
27 
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;
37 
38 enum {
42 };
43 
54 
72 
86 
106 
107 // Select a single primitive in the viewport or using the prim picker dialog.
109 // Select a single primitive using only the prim picker dialog.
111 // Spare data for a parameter that supports multiple primitive path strings.
113 // Select multiple primitives using the viewport or prim picker dialog.
115 // As above, but with a multiline text editor.
117 // Select multiple primitives using only the prim picker dialog.
119 // Select multiple primitives using the viewport or prim picker dialog,
120 // including allowing selecting instance proxy prims.
122 // As above, but with a multiline text editor.
124 // Spare data indicating a file parameter specifies a USD file for reading.
126 // Spare data indicating a file parameter specifies a USD file for writing.
128 
129 // Version of lopPrimPathSpareData that only supports selection using the
130 // primitive picker dialog. This can be used for nodes in other contexts that
131 // reference a LOP using a parameter called "loppath".
133 
134 // Material LOPs
138 
140  int which_input,
141  const UT_String &primpattern,
142  PRM_Name *menu_entries,
143  int max_menu_entries);
144 
146  int which_input,
147  const UT_String &primpattern,
148  const UT_String &variantset,
149  PRM_Name *menu_entries,
150  int max_menu_entries);
151 
152 extern LOP_API void lopBuildUsdExpansionRulesMenu(void *,
153  PRM_Name *menu_entries,
154  int max_menu_entries,
155  const PRM_SpareData *,
156  const PRM_Parm *);
157 
159  const UT_StringRef &merge_style_str);
160 
172 };
173 
175 public:
176  static const LOP_XformComponents &identity();
177 
178  void combine(const LOP_XformComponents &other);
179  void applyXform(UT_Matrix4D &xform);
180 
188 };
189 extern LOP_API const PRM_Template *lopXformTemplates();
192  fpreal t, LOP_XformComponents *accumulate = nullptr);
193 extern LOP_API UT_Matrix4D lopBuildMultiparmXform(OP_Node &node, int inst,
194  fpreal t, LOP_XformComponents *accumulate = nullptr);
195 
196 // Evaluate the lopSetStageMetadataName parameter on the node, and return true
197 // if the parm is set to "on", or set to "auto" and the node has no input.
198 extern LOP_API bool lopSetStageMetadata(LOP_Node *node, fpreal t);
199 
200 // Parm templates for setting arbitrary context options.
202 extern LOP_API void lopSetContextOptions(OP_Node &node,
203  OP_Context &context,
204  OP_ContextOptionsWriteScope &options);
206 // Return true if there are any time dependent context options, even if we
207 // don't set them. We still need to be time dependent.
209  OP_Context &context,
210  OP_ContextOptionsWriteScope &options);
213  OP_Context &context,
214  OP_ContextOptionsWriteScope &options);
215 
216 // Parm templates for defining a collection using every available algorithm,
217 // rather than just a primitive pattern string.
219  PRM_Name &collapser_parm_name);
221  PRM_Name &collection_parm_name,
222  const char *multiparm_prefix = nullptr,
223  const char *default_prim_pattern = nullptr);
224 
225 // Class to hold evaluated parm templates so we can evaluate all our parms
226 // before using the parm values to populate an HUSD_FindPrims.
228 {
229 public:
231  // Find by pattern string.
233  // Find by bounding box.
236  // Find by primitive type.
238  // Find by primitive type.
240  // Find by VEXpression.
242  // Find by primitive kind.
244 };
246 
247 // Evaluate an adhoc collection multiparm and use it to fill in a
248 // LOP_CollectionParms array.
249 extern LOP_API void lopGetCollectionParms(LOP_Node &node,
250  const PRM_Template &collection_parm_template,
251  fpreal t, LOP_CollectionParms &collection_parms);
252 // Take a populated LOP_CollectionParms array and use it to fill in an
253 // HUSD_FindParms object.
254 extern LOP_API bool lopGetCollection(LOP_Node &node,
255  const LOP_CollectionParms &collection_parms,
256  fpreal t, HUSD_FindPrims &findprims);
257 
258 // Return a template for a multiparm that lets the user configure an asset
259 // resolver using strings.
261 // Populate a map of asset resolver configuration strings from the
262 // lopResolverStringsTemplate multiparm on the specified node.
264  UT_StringMap<UT_StringHolder> &resolverstrings);
265 
266 // Return a template for a multiparm that lets the user configure the variant
267 // selection fallback rules for a stage.
269 // Populate a map of variant sets to an array of variant set selection values
270 // that should be used for that variant set if no explicit selections has been
271 // authored on a prim.
273  UT_StringMap<UT_StringArray> &variantselections,
274  bool add_empty_selections = false);
275 
276 // Checks if the layer at a given file path exists, using the resolver context
277 // of the supplied data lock.
279  HUSD_AutoAnyLock &lock,
280  const UT_StringRef &filepath,
281  const UT_StringRef &handle_missing_files,
282  bool *skip_this_file);
283 
284 // Take a single string, tokenize it, and return an array of valid USD
285 // primitive path strings. Return true if any paths are being returned.
286 extern LOP_API bool lopTokenizePrimitivePaths(const UT_StringRef &str,
287  UT_StringArray &primpaths,
288  UT_StringSet *uniqueprimpaths = nullptr);
289 
290 #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
UT_ErrorSeverity
Definition: UT_Error.h:25
LOP_API PRM_Name lopLoadPayloadsName
LOP_API const UT_StringHolder lopAttrControlConnectInputToken
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_Name lopShowLopStageName
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
HUSD_MergeStyle
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_XformParms
LOP_API PRM_SpareData lopPrimPathDialogSpareData