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 <HUSD/HUSD_Xform.h>
20 #include <OP/OP_Error.h>
21 #include <PRM/PRM_ChoiceList.h>
22 #include <PRM/PRM_Default.h>
23 #include <PRM/PRM_Name.h>
24 #include <PRM/PRM_SpareData.h>
25 #include <PRM/PRM_Template.h>
26 #include <UT/UT_BoundingBox.h>
27 #include <UT/UT_Matrix4.h>
28 
29 class LOP_Node;
30 class HUSD_AutoAnyLock;
31 class HUSD_FindPrims;
32 class HUSD_FindProps;
33 class OP_Node;
34 class OP_Context;
36 class PRM_Parm;
37 class UT_String;
38 
40  Auto = 0,
41  Yes = 1,
42  No = 2
43 };
44 
45 // Keep this enum in sync with lopHandleDisallowedPrimTypesChoices.
47  Ignore = 0,
48  Warn = 1,
49  Error = 2
50 };
51 
67 
72 
76 
81 
101 
116 
139 
140 // Select a single primitive in the viewport or using the prim picker dialog.
142 // Select a single primitive using only the prim picker dialog.
144 // Spare data for a parameter that supports multiple primitive path strings.
146 // Select multiple primitives using the viewport or prim picker dialog.
148 // As above, but with a multiline text editor.
150 // Select multiple primitives using only the prim picker dialog.
152 // Select multiple primitives using the viewport or prim picker dialog,
153 // including allowing selecting instance proxy prims.
155 // As above, but with a multiline text editor.
157 // Spare data indicating a file parameter specifies a USD file for reading.
159 // Spare data indicating a file parameter specifies a USD file for writing.
161 
162 // Version of lopPrimPathSpareData that only supports selection using the
163 // primitive picker dialog. This can be used for nodes in other contexts that
164 // reference a LOP using a parameter called "loppath".
166 
167 // Material LOPs
172 
174  int which_input,
175  bool allow_instance_proxies,
176  const UT_String &primpattern,
177  PRM_Name *menu_entries,
178  int max_menu_entries);
179 
181  int which_input,
182  bool allow_instance_proxies,
183  const UT_String &primpattern,
184  const UT_String &variantset,
185  PRM_Name *menu_entries,
186  int max_menu_entries);
187 
188 extern LOP_API void lopBuildUsdExpansionRulesMenu(void *,
189  PRM_Name *menu_entries,
190  int max_menu_entries,
191  const PRM_SpareData *,
192  const PRM_Parm *);
193 
195  const UT_StringRef &merge_style_str);
196 
208 };
209 
211 public:
212  static const LOP_XformComponents &identity();
213 
214  void combine(const LOP_XformComponents &other);
216 
224 };
226  bool invisible = false, bool nocook = false);
229  fpreal t, LOP_XformComponents *accumulate = nullptr);
230 extern LOP_API UT_Matrix4D lopBuildMultiparmXform(OP_Node &node, int inst,
231  fpreal t, LOP_XformComponents *accumulate = nullptr);
232 
233 // Convert the string from an xform style menu parameter to the corresponding
234 // HUSD_XformStyle constant.
236 
237 // Evaluate the lopSetStageMetadataName parameter on the node, and return true
238 // if the parm is set to "on", or set to "auto" and the node has no input.
239 extern LOP_API bool lopSetStageMetadata(LOP_Node *node, fpreal t);
240 
241 // Parm templates for setting arbitrary context options.
243 extern LOP_API void lopSetContextOptions(OP_Node &node,
244  OP_Context &context,
245  OP_ContextOptionsWriteScope &options);
247 // Return true if there are any time dependent context options, even if we
248 // don't set them. We still need to be time dependent.
250  OP_Context &context,
251  OP_ContextOptionsWriteScope &options);
254  OP_Context &context,
255  OP_ContextOptionsWriteScope &options);
256 
257 // Parm templates for defining a collection using every available algorithm,
258 // rather than just a primitive pattern string.
260  PRM_Name &collapser_parm_name);
262  PRM_Name &collection_parm_name,
263  const char *multiparm_prefix = nullptr,
264  const char *default_prim_pattern = nullptr,
265  const char *allow_instance_matching_parm_name = nullptr);
266 
267 // Class to hold evaluated parm templates so we can evaluate all our parms
268 // before using the parm values to populate an HUSD_FindPrims.
270 {
271 public:
273  // Find by pattern string.
275  // Find by bounding box.
278  // Find by primitive type.
280  // Find by primitive type.
282  // Find by VEXpression.
284  // Find by primitive kind.
286 };
288 
289 // Evaluate an adhoc collection multiparm and use it to fill in a
290 // LOP_CollectionParms array.
291 extern LOP_API void lopGetCollectionParms(LOP_Node &node,
292  const PRM_Template &collection_parm_template,
293  fpreal t, LOP_CollectionParms &collection_parms);
294 // Take a populated LOP_CollectionParms array and use it to fill in an
295 // HUSD_FindParms object.
296 extern LOP_API bool lopGetCollection(LOP_Node &node,
297  const LOP_CollectionParms &collection_parms,
298  fpreal t, HUSD_FindPrims &findprims);
299 
300 // Return a template for a multiparm that lets the user configure an asset
301 // resolver using strings.
303 // Populate a map of asset resolver configuration strings from the
304 // lopResolverStringsTemplate multiparm on the specified node.
306  UT_StringMap<UT_StringHolder> &resolverstrings,
307  const PRM_Name *asset_path_parm);
308 
309 // Return a template for a multiparm that lets the user configure the variant
310 // selection fallback rules for a stage.
312 // Populate a map of variant sets to an array of variant set selection values
313 // that should be used for that variant set if no explicit selections has been
314 // authored on a prim.
316  UT_StringMap<UT_StringArray> &variantselections,
317  bool add_empty_selections = false);
318 
319 // Checks if the layer at a given file path exists, using the resolver context
320 // of the supplied data lock.
322  HUSD_AutoAnyLock &lock,
323  const UT_StringRef &filepath,
324  const UT_StringRef &handle_missing_files,
325  bool *skip_this_file);
326 
327 // Take a single string, tokenize it, and return an array of valid USD
328 // primitive path strings. Return true if any paths are being returned.
329 extern LOP_API bool lopTokenizePrimitivePaths(const UT_StringRef &str,
330  UT_StringArray &primpaths,
331  UT_StringSet *uniqueprimpaths = nullptr);
332 
333 #endif
LOP_API const UT_StringHolder lopHandleDisallowedPrimTypeIgnoreToken
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_Default lopHandleDisallowedPrimTypesDefault
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 lopHandleDisallowedPrimTypeErrorToken
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 PRM_ChoiceList lopRefPrimMenu
LOP_API const PRM_Template & lopTimeBasedContextOptionsTemplate()
LOP_API PRM_Name lopHandleDisallowedPrimTypesName
HUSD_XformStyle
Definition: HUSD_Xform.h:37
LOP_API PRM_ChoiceList lopTargetLayerMenu
LOP_API PRM_Default lopParentPrimTypeDefault
LOP_HandleDisallowedPrimType
Definition: LOP_PRMShared.h:46
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_Name lopAllowedPrimTypesName
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 const UT_StringHolder lopIgnoreMissingFilesToken
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 PRM_Default lopInEditLayerBlockLabelDefault
LOP_API PRM_ChoiceList lopHandleDisallowedPrimTypesMenu
LOP_API const UT_StringHolder lopHandleDisallowedPrimTypeWarnToken
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_SetStageMetadata
Definition: LOP_PRMShared.h:39
LOP_API PRM_ChoiceList lopMatBindPurposeMenu
LOP_API const UT_StringHolder lopAttrControlDisconnectInputToken
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 void lopBuildUsdPrimVariantSetsMenu(LOP_Node &node, int which_input, bool allow_instance_proxies, const UT_String &primpattern, PRM_Name *menu_entries, int max_menu_entries)
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_Name lopRefRenderVarsName
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 const UT_StringHolder lopErrorOnMissingFilesToken
LOP_API const UT_StringHolder lopAttrControlSetNotAuthoredToken
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 const UT_StringHolder lopAttrControlAppendToken
LOP_API const PRM_Template * lopXformTemplates(bool invisible=false, bool nocook=false)
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_Name lopModifiedPrimCountToStartNewLayerName
LOP_API const UT_StringHolder lopMultiPrimSelectTooltip
LOP_API PRM_SpareData lopUsdWriteFilePathSpareData
LOP_API const UT_StringHolder lopWarnOnMissingFilesToken
LOP_API PRM_ChoiceList lopAttributeColorSpaceMenu
LOP_API const UT_StringHolder lopAttrControlNoneToken
LOP_API PRM_Name lopInsertionPointDescriptorName
LOP_API bool lopGetResolverContextStringsFromMultiparm(OP_Node &node, UT_StringMap< UT_StringHolder > &resolverstrings, const PRM_Name *asset_path_parm)
Error
Definition: oidn.hpp:578
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:283
LOP_API PRM_Name lopInEditLayerBlockLabelName
LOP_API PRM_Name lopPrimPatternName
LOP_API PRM_SpareData lopMultilinePrimPatternWithProxiesSpareData
LOP_API const UT_StringHolder lopAttrControlPrependToken
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)
GU_API void xform(CE_Context &context, bool recompile, int npts, const cl::Buffer &outPos, const cl::Buffer &inPos, const cl::Buffer &surfacexform, const cl::Buffer *grp=nullptr)
LOP_API HUSD_MergeStyle lopMergeStyleFromString(const UT_StringRef &merge_style_str)
LOP_API const UT_StringHolder lopAttrControlAnimationBlockToken
LOP_API PRM_ChoiceList lopSetStageMetadataMenu
LOP_API PRM_Template lopCollectionParmTemplate(PRM_Name &collection_parm_name, const char *multiparm_prefix=nullptr, const char *default_prim_pattern=nullptr, const char *allow_instance_matching_parm_name=nullptr)
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 const UT_StringHolder lopAllowMissingFilesToken
LOP_API PRM_ChoiceList lopPrimKindQueryMenu
LOP_API PRM_ChoiceList lopParentLayerMenu
static const LOP_XformComponents & identity()
LOP_API HUSD_XformStyle lopXformStyleFromString(const UT_StringRef &str)
LOP_API const PRM_Template & lopResolverContextStringsTemplate()
LOP_API PRM_Name lopCollectionCollapserName
LOP_API void lopBuildUsdPrimVariantsMenu(LOP_Node &node, int which_input, bool allow_instance_proxies, const UT_String &primpattern, const UT_String &variantset, PRM_Name *menu_entries, int max_menu_entries)
LOP_API PRM_ChoiceList lopAllPrimTypeToggleMenu
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 const UT_StringHolder lopAttrControlRemoveToken
LOP_API PRM_SpareData lopPrimPathDialogSpareData