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 
58 
63 
83 
98 
120 
121 // Select a single primitive in the viewport or using the prim picker dialog.
123 // Select a single primitive using only the prim picker dialog.
125 // Spare data for a parameter that supports multiple primitive path strings.
127 // Select multiple primitives using the viewport or prim picker dialog.
129 // As above, but with a multiline text editor.
131 // Select multiple primitives using only the prim picker dialog.
133 // Select multiple primitives using the viewport or prim picker dialog,
134 // including allowing selecting instance proxy prims.
136 // As above, but with a multiline text editor.
138 // Spare data indicating a file parameter specifies a USD file for reading.
140 // Spare data indicating a file parameter specifies a USD file for writing.
142 
143 // Version of lopPrimPathSpareData that only supports selection using the
144 // primitive picker dialog. This can be used for nodes in other contexts that
145 // reference a LOP using a parameter called "loppath".
147 
148 // Material LOPs
153 
155  int which_input,
156  bool allow_instance_proxies,
157  const UT_String &primpattern,
158  PRM_Name *menu_entries,
159  int max_menu_entries);
160 
162  int which_input,
163  bool allow_instance_proxies,
164  const UT_String &primpattern,
165  const UT_String &variantset,
166  PRM_Name *menu_entries,
167  int max_menu_entries);
168 
169 extern LOP_API void lopBuildUsdExpansionRulesMenu(void *,
170  PRM_Name *menu_entries,
171  int max_menu_entries,
172  const PRM_SpareData *,
173  const PRM_Parm *);
174 
176  const UT_StringRef &merge_style_str);
177 
189 };
190 
192 public:
193  static const LOP_XformComponents &identity();
194 
195  void combine(const LOP_XformComponents &other);
196  void applyXform(UT_Matrix4D &xform);
197 
205 };
206 extern LOP_API const PRM_Template *lopXformTemplates();
209  fpreal t, LOP_XformComponents *accumulate = nullptr);
210 extern LOP_API UT_Matrix4D lopBuildMultiparmXform(OP_Node &node, int inst,
211  fpreal t, LOP_XformComponents *accumulate = nullptr);
212 
213 // Evaluate the lopSetStageMetadataName parameter on the node, and return true
214 // if the parm is set to "on", or set to "auto" and the node has no input.
215 extern LOP_API bool lopSetStageMetadata(LOP_Node *node, fpreal t);
216 
217 // Parm templates for setting arbitrary context options.
219 extern LOP_API void lopSetContextOptions(OP_Node &node,
220  OP_Context &context,
221  OP_ContextOptionsWriteScope &options);
223 // Return true if there are any time dependent context options, even if we
224 // don't set them. We still need to be time dependent.
226  OP_Context &context,
227  OP_ContextOptionsWriteScope &options);
230  OP_Context &context,
231  OP_ContextOptionsWriteScope &options);
232 
233 // Parm templates for defining a collection using every available algorithm,
234 // rather than just a primitive pattern string.
236  PRM_Name &collapser_parm_name);
238  PRM_Name &collection_parm_name,
239  const char *multiparm_prefix = nullptr,
240  const char *default_prim_pattern = nullptr);
241 
242 // Class to hold evaluated parm templates so we can evaluate all our parms
243 // before using the parm values to populate an HUSD_FindPrims.
245 {
246 public:
248  // Find by pattern string.
250  // Find by bounding box.
253  // Find by primitive type.
255  // Find by primitive type.
257  // Find by VEXpression.
259  // Find by primitive kind.
261 };
263 
264 // Evaluate an adhoc collection multiparm and use it to fill in a
265 // LOP_CollectionParms array.
266 extern LOP_API void lopGetCollectionParms(LOP_Node &node,
267  const PRM_Template &collection_parm_template,
268  fpreal t, LOP_CollectionParms &collection_parms);
269 // Take a populated LOP_CollectionParms array and use it to fill in an
270 // HUSD_FindParms object.
271 extern LOP_API bool lopGetCollection(LOP_Node &node,
272  const LOP_CollectionParms &collection_parms,
273  fpreal t, HUSD_FindPrims &findprims);
274 
275 // Return a template for a multiparm that lets the user configure an asset
276 // resolver using strings.
278 // Populate a map of asset resolver configuration strings from the
279 // lopResolverStringsTemplate multiparm on the specified node.
281  UT_StringMap<UT_StringHolder> &resolverstrings,
282  const PRM_Name *asset_path_parm);
283 
284 // Return a template for a multiparm that lets the user configure the variant
285 // selection fallback rules for a stage.
287 // Populate a map of variant sets to an array of variant set selection values
288 // that should be used for that variant set if no explicit selections has been
289 // authored on a prim.
291  UT_StringMap<UT_StringArray> &variantselections,
292  bool add_empty_selections = false);
293 
294 // Checks if the layer at a given file path exists, using the resolver context
295 // of the supplied data lock.
297  HUSD_AutoAnyLock &lock,
298  const UT_StringRef &filepath,
299  const UT_StringRef &handle_missing_files,
300  bool *skip_this_file);
301 
302 // Take a single string, tokenize it, and return an array of valid USD
303 // primitive path strings. Return true if any paths are being returned.
304 extern LOP_API bool lopTokenizePrimitivePaths(const UT_StringRef &str,
305  UT_StringArray &primpaths,
306  UT_StringSet *uniqueprimpaths = nullptr);
307 
308 #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 PRM_ChoiceList lopRefPrimMenu
LOP_API const PRM_Template & lopTimeBasedContextOptionsTemplate()
LOP_API PRM_ChoiceList lopTargetLayerMenu
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 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 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 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 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 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 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)
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:278
LOP_API PRM_Name lopInEditLayerBlockLabelName
LOP_API const PRM_Template * lopXformTemplates()
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)
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 const UT_StringHolder lopAllowMissingFilesToken
LOP_API PRM_ChoiceList lopPrimKindQueryMenu
LOP_API PRM_ChoiceList lopParentLayerMenu
static const LOP_XformComponents & identity()
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_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