HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XUSD_Utils.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Side Effects Software Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef __XUSD_Utils_h__
19 #define __XUSD_Utils_h__
20 
21 #include "HUSD_API.h"
22 #include "HUSD_DataHandle.h"
23 #include "HUSD_Utils.h"
24 #include "XUSD_PathSet.h"
26 #include <OP/OP_ItemId.h>
27 #include <UT/UT_CameraParms.h>
28 #include <UT/UT_StringHolder.h>
29 #include <UT/UT_StringArray.h>
30 #include <UT/UT_StringMap.h>
31 #include <UT/UT_StringMMPattern.h>
32 #include <UT/UT_Map.h>
33 #include <UT/UT_XformOrder.h>
34 #include <pxr/base/vt/value.h>
35 #include <pxr/usd/sdf/fileFormat.h>
36 #include <pxr/usd/sdf/layer.h>
38 #include <pxr/usd/sdf/path.h>
39 #include <pxr/usd/usd/prim.h>
40 #include <pxr/usd/usd/stage.h>
41 #include <pxr/usd/usd/timeCode.h>
43 #include <pxr/usd/usdGeom/camera.h>
47 
48 class HUSD_LayerOffset;
49 class HUSD_LoadMasks;
50 class HUSD_PathSet;
51 class HUSD_TimeCode;
52 class UT_OptionEntry;
53 class UT_JSONWriter;
54 
56 
57 class UsdGeomPrimvar;
58 class UsdGeomXformable;
59 class UsdGeomXformCache;
60 class XUSD_Data;
62 
63 #define HUSD_LOP_MUTING_IDENTIFIER_PREFIX "lop:"
64 
66 {
67 public:
69  { }
71  { }
72 
73  virtual int getPriority() const = 0;
74  virtual UsdStageRefPtr createStage(UsdStage::InitialLoadSet loadset,
75  int nodeid) const = 0;
76 };
77 
78 extern "C" {
81 };
82 
86 };
87 
89 {
90 public:
91  explicit XUSD_SavePathInfo()
93  myNodeBasedPath(false),
94  myTimeDependent(false),
96  myActuallySavedFile(false)
97  { }
98  explicit XUSD_SavePathInfo(const UT_StringHolder &finalpath)
100  myFinalPath(finalpath),
101  myOriginalPath(finalpath),
103  myNodeBasedPath(false),
104  myTimeDependent(false),
106  myActuallySavedFile(false)
107  { }
108  explicit XUSD_SavePathInfo(const UT_StringHolder &finalpath,
109  const UT_StringHolder &originalpath,
110  XUSD_ExternalRefType reference_type,
111  const std::string &reference_layer_id,
112  bool node_based_path,
113  bool time_dependent)
114  : myFinalPath(finalpath),
115  myOriginalPath(originalpath),
117  myReferenceType(reference_type),
118  myReferenceLayerId(reference_layer_id),
119  myNodeBasedPath(node_based_path),
120  myTimeDependent(time_dependent),
122  myActuallySavedFile(false)
123  { }
124 
129  std::string myReferenceLayerId;
134 };
135 
137 {
138 public:
142 };
143 
150 
151 // Helper function to convert a node id directly to a node path, and return
152 // true if the conversion was successful.
153 HUSD_API bool HUSDgetNodePath(int nodeid, UT_StringHolder &nodepath);
154 // Similar to the above method, but for the dedicated purpose of returning a
155 // std::string to pass to HUSDcreateAnonymousLayer.
156 HUSD_API std::string HUSDgetTag(const XUSD_DataLockPtr &datalock);
157 
170 
178 
181 
183 HUSD_API bool HUSDisDerivedType(const UsdPrim &prim,
184  const TfType &base_type);
185 
187 HUSD_API bool HUSDisPrimEditable(const UsdPrim &prim);
188 HUSD_API bool HUSDisPrimSelectable(const UsdPrim &prim,
189  UT_Map<HUSD_Path, bool> *cache = nullptr);
190 HUSD_API bool HUSDisPrimHiddenInUi(const UsdPrim &prim);
191 
192 // Path conversion functions.
197 
198 // Timecode conversion functions.
202  const HUSD_TimeCode &timecode);
204  const HUSD_TimeCode &timecode,
205  const UsdAttribute &attr);
207  const HUSD_TimeCode &timecode,
208  const UsdAttribute &attr);
210  const UT_XformOrder &order);
213 
214 
215 // Layer offset conversion.
217 HUSDgetSdfLayerOffset(const HUSD_LayerOffset &layeroffset);
219 HUSDgetLayerOffset(const SdfLayerOffset &layeroffset);
220 
221 // Other functions to convert from HUSD classes to USD equivalents.
225 HUSDgetUsdListPosition(const UT_StringRef &editopstr);
231 HUSDgetSdfSpecifier(const UT_StringRef &specifier, bool *valid = nullptr);
232 
233 // Determine if a layer comes from a SOP or not.
234 HUSD_API bool
235 HUSDisSopLayer(const std::string &identifier);
236 HUSD_API bool
237 HUSDisSopLayer(const SdfLayerHandle &layer);
238 
239 // Determine if a layer was created by LOPs or not.
240 HUSD_API bool
241 HUSDisLopLayer(const std::string &identifier);
242 HUSD_API bool
243 HUSDisLopLayer(const SdfLayerHandle &layer);
244 
245 // Determine if the specified layer should be saved to disk when saving a
246 // LOP network which sublayers or references this layer.
247 HUSD_API bool
248 HUSDshouldSaveLayerToDisk(const SdfLayerHandle &layer);
249 
250 // Figures out from the layer metadata where the layer should be saved. This
251 // method only works on layers that return true from HUSDshouldSaveLayerToDisk.
252 HUSD_API std::string
253 HUSDgetLayerSaveLocation(const SdfLayerHandle &layer,
254  bool *using_node_path = nullptr);
255 
256 // Get (creating if requested) the special prim that gets put on LOP layers
257 // to hold special layer information (save path, creator node, editor nodes,
258 // etc.) We store this on the custom data of a dedicated prim instead of on
259 // the layer root because custom data on the layer root can cause a whole lot
260 // of recomposition.
261 HUSD_API SdfPrimSpecHandle
262 HUSDgetLayerInfoPrim(const SdfLayerHandle &layer, bool create);
263 
264 // Get or set the save path custom data on a layer. Used by the above
265 // HUSDgetLayerSaveLocation as one of the methods to determine where a layer
266 // should be saved.
267 HUSD_API void
268 HUSDsetSavePath(const SdfLayerHandle &layer,
269  const UT_StringRef &savepath,
270  bool savepath_is_time_dependent,
271  const UT_StringRef &overrides_savepath = UT_StringRef());
272 HUSD_API bool
273 HUSDgetSavePath(const SdfLayerHandle &layer,
274  std::string &savepath);
275 HUSD_API bool
276 HUSDgetOverrideSavePath(const SdfLayerHandle &layer,
277  std::string &savepath);
278 HUSD_API bool
279 HUSDgetSavePathIsTimeDependent(const SdfLayerHandle &layer);
280 
281 // Add locked geos for volume file paths listed on the HoudiniLayerInfo.
282 HUSD_API void
284  const SdfLayerRefPtr &layer);
285 HUSD_API void
287  const SdfLayerRefPtr &layer);
288 
289 // When we do a "copy with replacement", the replace layers have their
290 // original paths stored in the "HoudiniSourcePath" custom data.
291 HUSD_API void
292 HUSDsetSourcePath(const SdfLayerHandle &layer,
293  const UT_StringRef &sourcePath);
294 HUSD_API bool
295 HUSDgetSourcePath(const SdfLayerHandle &layer,
296  std::string &sourcePath);
297 
298 // Get or set the save control token which modified how the USD ROP treats
299 // this layer when it is being saved with various options.
300 HUSD_API void
301 HUSDsetSaveControl(const SdfLayerHandle &layer,
302  const UT_StringRef &savecontrol);
303 HUSD_API bool
304 HUSDgetSaveControl(const SdfLayerHandle &layer,
305  std::string &savecontrol);
306 
307 HUSD_API void
308 HUSDsetCreatorNode(const SdfLayerHandle &layer, int node_id);
309 HUSD_API bool
310 HUSDgetCreatorNode(const SdfLayerHandle &layer, std::string &nodepath);
311 
312 HUSD_API void
313 HUSDsetSourceNode(const UsdPrim &prim, int node_id);
314 
315 HUSD_API void
316 HUSDclearEditorNodes(const SdfLayerHandle &layer);
317 HUSD_API void
318 HUSDaddEditorNode(const SdfLayerHandle &layer, int node_id);
319 
320 // Set the list of SdfPaths of all solo'ed lights. This information is stored
321 // as custom data on the HoudiniLayerInfo prim. These methods should only be
322 // used by HUSD_Overrides.
323 HUSD_API void
324 HUSDsetSoloLightPaths(const SdfLayerHandle &layer,
325  const HUSD_PathSet &paths);
326 HUSD_API bool
327 HUSDgetSoloLightPaths(const SdfLayerHandle &layer,
328  HUSD_PathSet &paths);
329 
330 // Warning: this function can traverse the stage, and so can be quite expensive.
331 // It looks for any light prim that is visible at the specified time code.
332 HUSD_API bool
333 HUSDhasAnyVisibleLights(const UsdStageRefPtr &stage, const HUSD_TimeCode &tc);
334 
335 // Set the list of SdfPaths of all solo'ed geometry. This information is stored
336 // as custom data on the HoudiniLayerInfo prim. These methods should only be
337 // used by HUSD_Overrides.
338 HUSD_API void
339 HUSDsetSoloGeometryPaths(const SdfLayerHandle &layer,
340  const HUSD_PathSet &paths);
341 HUSD_API bool
342 HUSDgetSoloGeometryPaths(const SdfLayerHandle &layer,
343  HUSD_PathSet &paths);
344 
345 // Get or set a flag on a layer that causes it to be treated as a SOP layer
346 // for the sake of flattening operations (which can optionally flatten SOP
347 // layers along with implicit layers).
348 HUSD_API void
349 HUSDsetTreatAsSopLayer(const SdfLayerHandle &layer, bool treatassoplayer);
350 HUSD_API bool
351 HUSDgetTreatAsSopLayer(const SdfLayerHandle &layer);
352 
353 // Set the Editor node for a specific USD primitive. This is stored as custom
354 // data on the primitive, and indicates the node that last modified this
355 // primitive, and so the node that we should use for any future requests to
356 // edit the prim.
357 HUSD_API void
358 HUSDaddPrimEditorNodeId(const UsdPrim &prim, int node_id);
359 HUSD_API void
360 HUSDaddPrimEditorNodeId(const SdfPrimSpecHandle &prim, int node_id);
361 HUSD_API void
363 HUSD_API void
364 HUSDclearPrimEditorNodeIds(const SdfPrimSpecHandle &prim);
365 HUSD_API void
366 HUSDaddPropertyEditorNodeId(const UsdProperty &property, int nodeid);
367 HUSD_API void
369 
370 HUSD_API void
372 
373 HUSD_API void
374 HUSDclearDataId(const UsdAttribute &attr);
375 
377 HUSDgetParentKind(const TfToken &kind);
378 
379 // Test if a prim and all existing ancestors of the provided path are active.
380 // If the ancestors don't exist at all, that is okay too. This test is primarily
381 // for use by HUSDcreatePrimInLayer which can still create the primitive
382 // in the active layer, but we don't actually want it to. Note that path
383 // must be an absolute SdfPath or this function will return false.
384 HUSD_API bool
386  const SdfPath &path);
387 
388 // Create a new primitive in the specified layer. The stage parameter may or
389 // may not include the layer. It is used only to look up any existing prims
390 // so we know which ancestors of the new prim should be defined and which
391 // should simply be over prims. If the requested prim already exists on the
392 // stage, this function does nothing.
393 HUSD_API SdfPrimSpecHandle
395  const SdfLayerHandle &layer,
396  const SdfPath &path,
397  const TfToken &kind,
398  SdfSpecifier specifier,
399  SdfSpecifier parent_prims_specifier,
400  const std::string &parent_prims_type);
401 
402 HUSD_API bool
403 HUSDcopySpec(const SdfLayerHandle &srclayer,
404  const SdfPath &srcpath,
405  const SdfLayerHandle &destlayer,
406  const SdfPath &destath,
407  const SdfPath &srcroot = SdfPath(),
408  const SdfPath &destroot = SdfPath(),
409  const fpreal frameoffset = 0,
410  const fpreal frameratescale = 1);
411 
412 // Wrapper around UsdUtilsModifyAssetPaths which restores the layer offsets of
413 // sublayers after updating the asset paths. The core function clears the layer
414 // offset of any sublayer path that gets updated.
415 HUSD_API void
416 HUSDmodifyAssetPaths(const SdfLayerHandle &layer,
417  const UsdUtilsModifyAssetPathFn &modifyFn,
418  bool keep_empty_assets_in_arrays = true);
419 
420 // This function duplicates the functionality of
421 // SdfLayer::UpdateExternalRefernce, but can retarget a bunch of references
422 // with a single method call, and thus a single traversal.
423 HUSD_API bool
424 HUSDupdateExternalReferences(const SdfLayerHandle &layer,
425  const std::map<std::string, std::string> &pathmap);
426 
427 // Calls SdfLayer::GetExternalReferences, but also gathers asset paths from
428 // clips defined on the layer.
429 HUSD_API std::map<std::string, XUSD_ExternalRefType>
431  bool sublayer_only = false);
432 
433 // Utility function used for stitching stages together and saving them.
434 HUSD_API void
436  XUSD_IdentifierToReferenceInfoMap &referenceinfomap,
437  bool recursive,
438  bool include_placeholders = false);
439 
440 // Calls the USD stitch function but with a callback that looks for SOP data
441 // ids on the attributes to avoid creating duplicate time samples.
442 HUSD_API void
443 HUSDstitchLayers(const SdfLayerHandle &strongLayer,
444  const SdfLayerHandle &weakLayer,
445  HUSD_PathSet *varyingDefaultPaths = nullptr);
446 // Stitch two stages together by stitching together their "corresponding"
447 // layers, as determined by the requested save paths for each layer.
448 HUSD_API bool
450  const UsdStageRefPtr &dest,
451  const UsdTimeCode &timecode,
452  const std::set<std::string> *strip_sublayer_identifiers,
453  XUSD_LayerSet &held_layers,
454  bool force_notifiable_file_format,
455  bool set_layer_override_save_paths,
456  XUSD_ExistenceTracker *existence_tracker,
457  HUSD_PathSet *varying_default_paths = nullptr);
458 
459 // This function returns the identifier that should be passed to
460 // UsdStage::CreateInMemory when creating a stage for use in a LOP
461 // network. This identifier is important as it allows Houdini to
462 // recognize the stage root layer as having been created by LOPs.
463 HUSD_API const std::string &
465 
466 // Create a new in-memory stage. Use this method instead of calling
467 // UsdStage::CreateInMemory directly, as we want to configure the stage
468 // with a reasonable identifier, and a path resolver context. The first
469 // version only sets the payload loading option, which must be set when
470 // the stage is constructed. The second version sets the payload loading
471 // option, the stage population maks, and the layer muting based on the
472 // values set in the provided load masks object.
473 HUSD_API UsdStageRefPtr
475  const UsdStageWeakPtr &context_stage = UsdStageWeakPtr(),
476  int resolver_context_nodeid = OP_INVALID_ITEM_ID,
477  const ArResolverContext *resolver_context = nullptr);
478 HUSD_API UsdStageRefPtr
479 HUSDcreateStageInMemory(const HUSD_LoadMasks *load_masks,
480  const UsdStageWeakPtr &context_stage = UsdStageWeakPtr(),
481  int resolver_context_nodeid = OP_INVALID_ITEM_ID,
482  const ArResolverContext *resolver_context = nullptr);
483 HUSD_API UsdStageRefPtr
485  const HUSD_LoadMasks *load_masks = nullptr,
486  const UsdStageWeakPtr &context_stage = UsdStageWeakPtr());
487 HUSD_API UsdStageRefPtr
488 HUSDcreateStageFromFile(const UT_StringRef &filepath,
489  const HUSD_LoadMasks *load_masks = nullptr,
490  const UsdStageWeakPtr &context_stage = UsdStageWeakPtr());
491 
492 // Copies meters per unit, up axis, fps, and tcps from the stage's root
493 // layer onto the supplied layer. New sublayers added to a stage should
494 // match these stage settings to avoid unintended mismatches for these
495 // critical setting. The tcps in particular can actually affect composition,
496 // and so matching the stage value (at least as a default) is extremely
497 // important.
498 HUSD_API void
500  const SdfLayerHandle &src);
501 
502 // Create a new anonymous layer. Use this method instead of calling
503 // SdfLayer::CreateAnonymous directly, as we want to configure the layer
504 // with root prim data from a source layer.
507  const SdfLayerHandle &context_layer = SdfLayerHandle(),
508  const std::string &tag = std::string());
509 
510 // Create a new anonymous layer that is a copy of the provided source layer.
511 // If the source layer is not anonymous, update any references to additional
512 // USD or asset files by making all paths absolute.
515  const std::string &tag = std::string());
516 
522 };
523 
524 // Combine layers together based on some options and custom data set on each
525 // layer in the stack (or referenced by a layer in the stack).
528  int flatten_flags,
529  SdfLayerRefPtrVector &explicit_layers);
530 
531 // Combine all layers in the stack by calling the USD flatten layers method.
533 HUSDflattenLayers(const UsdStageWeakPtr &stage);
534 
535 // Combine all the layers in an array (not yet on a stage). If there are
536 // many layers, break them into groups, and flatten these groups first, then
537 // flatten the groups together. USD flattening seems to have an O(N^2)
538 // component on the number of layers, which we can avoid with this approach.
540 HUSDflattenLayersInChunks(const std::vector<std::string> &sublayers,
541  const std::vector<SdfLayerOffset> &sublayeroffsets,
542  const UsdStageRefPtr &context_stage);
543 
544 // Check if the supplied layer is completely devoid of any useful information.
545 // This includes both primitives and layer level metadata. However the presence
546 // of only a HoudiniLayerInfo prim may still indicate an "empty" layer if it
547 // only contains creator node information.
548 HUSD_API bool
549 HUSDisLayerEmpty(const SdfLayerHandle &layer,
550  const UsdStageRefPtr &compare_stage_root_prim = UsdStageRefPtr(),
551  bool ignore_sublayers = false);
552 // Check if the supplied layer is a placeholder layer.
553 HUSD_API bool
554 HUSDisLayerPlaceholder(const SdfLayerHandle &layer);
555 // As above, but takes an identifier, which is used to find the layer handle.
556 HUSD_API bool
557 HUSDisLayerPlaceholder(const std::string &identifier);
558 // Return the special identifier we use to specify a LOP layer we want to mute.
559 HUSD_API std::string
560 HUSDgetLopLayerMutingIdentifier(const SdfLayerHandle &layer);
561 
562 // Test if a string is a stage variable expression. Optionally try to parse
563 // the expression, and raise an error if it is an invalid expression.
564 HUSD_API bool
566  bool check_for_errors);
567 
568 // Return the SdfPath that should be passed to create a reference to the
569 // specified layer. This gives priority to any passed in ref prim path
570 // string, then the layer's default prim (if one is set), then looks at
571 // the layer root prims and picks the first geometry primitive, or the
572 // first primitive if there are no geometry primitives. Raises an warning
573 // if it picks a primitive, but there are other primitives.
575 HUSDgetBestRefPrimPath(const UT_StringRef &reffilepath,
577  const UT_StringRef &refprimpath,
578  UsdStageRefPtr &stage);
579 HUSD_API void
580 HUSDclearBestRefPathCache(const std::string &layeridentifier = std::string());
581 
582 // Functions for checking the amount of time sampling of an attribute/xfrom:
588 HUSDgetLocalTransformTimeSampling(const UsdPrim &pr, bool* resets = nullptr);
591 
592 // Conveninece methods for updating the given time sampling.
593 HUSD_API void
595  HUSD_TimeSampling new_sampling );
596 HUSD_API void
598  const UsdAttribute &attrib);
599 HUSD_API void
601  const UsdGeomPrimvar &primvar);
602 HUSD_API void
604  const UsdPrim &prim);
605 HUSD_API void
607  const UsdPrim &prim);
608 
609 // Returns ture if an attribute (or any aspect of a local transform)
610 // has more than 1 time sample.
611 HUSD_API bool
613 HUSD_API bool
615 
616 // Converts a UT_Option into a VtValue.
618 
619 // Takes a set of paths, and compares them to a stage. In any case where all
620 // the children of a prim are in the set, remove the children, and add the
621 // parent prim instead. This finds the smallest possible set of prims on which
622 // to set an inheritable attribute such that it will affect the original set
623 // of paths. The "skip_point_instancers" flag can be set to true if point
624 // instancers should not be allowed to combine with its siblings, for cases
625 // where the point instancer instances need to be treated individually.
626 HUSD_API void
628  bool skip_point_instancers,
629  const UsdStageRefPtr &stage,
630  XUSD_PathSet &paths);
631 // Takes a set of paths, and compares them to a stage. In any case where all
632 // the children of a prim are in the set, remove that prim from the set,
633 // leaving only the children. This eliminates redundant parent entries in
634 // the set which are already covered by having all the children in the set.
635 HUSD_API void
637  const UsdStageRefPtr &stage,
638  XUSD_PathSet &paths);
639 
640 // Generates a unique suffix (stored in the `suffix` parameter) that can be used
641 // as the `opSuffix` argument to `UsdGeomXformable::AddTransformOp()`.
642 //
643 // If `test_base_xform` is `true` then there will be a first test to see if it
644 // would be valid to call `AddTransformOp` with no suffix (and, if so, `suffix`
645 // will be cleared to indicate this).
646 //
647 // In the above, "unique" is defined as "there is no existing attribute on the
648 // prim that has a matching name" and, thus, there is no risk of clobbering
649 // existing data". Note that this is different than a definition that says
650 // "there is no existing entry in the xformOpOrder list that has a matching name"
651 // (which would allow for the possiblity of attribute reuse).
652 HUSD_API void
654  UT_StringHolder &suffix,
655  const UsdGeomXformable &xformable,
657  bool test_base_xform = false);
658 
659 // Convert a UT map of strings to strings into an
660 // SdfFileFormat::FileFormatArguments equivalent. One trick here is that any
661 // arguments with "/"s in them will have all multi-slash sequences collapsed
662 // to a single slash. This is required so that as a layer identifier gets
663 // created from the FileFormatArguments, and the resulting identifier gets
664 // passed through the ArResolver's URI handling, then back into a
665 // FileFormatArguments structure, the argument values never change. The Ar
666 // library URI parser splits the whole identifier on "/"s, and then rebuilds
667 // the identifier from the components, putting only a single slash between
668 // each component.
669 HUSD_API void
671  const UT_StringMap<UT_StringHolder> &ut_args,
673 
674 // Calculate the time sampling of the bounding box of a prim. This can be
675 // either the world space bounding box (which takes ancestor xforms into
676 // account), or local space bounds, which ignore ancestor prims. The former
677 // test is useful to know if two prim bounding boxes have potentially
678 // animated overlapping. The latter is useful when we are interested in
679 // whether the extentsHint attribute of a prim need to be time varying.
681 HUSDgetBoundsTimeSampling(const UsdPrim& prim, bool world_space_bounds);
682 
683 // Convert a VtDictionary to a UT_Options
684 HUSD_API bool
685 HUSDconvertDictionary(UT_Options &options, const VtDictionary &dict,
686  const UT_StringMap<UT_StringHolder> *aliases = nullptr);
687 // Save out a VtDictionary as JSON.
688 HUSD_API bool
690  const UT_StringMap<UT_StringHolder> *aliases = nullptr);
691 // Save a single VtValue as JSON.
692 HUSD_API bool
694 
695 // Create a PcpVariantSelectionMap from an equivalent UT data structure.
696 HUSD_API void
698  const UT_StringMap<UT_StringArray> &utfallbacks,
699  PcpVariantFallbackMap &fallbacks);
700 // Create a UT data structure from an equivalent PcpVariantSelectionMap.
701 HUSD_API void
703  const PcpVariantFallbackMap &fallbacks,
704  UT_StringMap<UT_StringArray> &utfallbacks);
705 
706 // Get UT_CameraParms from a UsdGeomCamera
707 // by default imports all attributes into metadata
708 HUSD_API bool
709 HUSDgetCameraParms(const UsdGeomCamera &camprim,
710  const UsdTimeCode &tc,
711  UT_CameraParms &camparms);
712 
713 // Populate UT_CameraParms from a GfCamera
714 HUSD_API void
715 HUSDgetCameraParms(const GfCamera &gf_camera,
716  fpreal64 meters_per_unit,
717  UT_CameraParms &camparms);
718 
719 // get meters per unit from a stage
720 HUSD_API void
721 HUSDgetMetrics(const UsdStageRefPtr &stage, UT_StringHolder &upaxis,
722  fpreal64 &metersperunit);
723 
724 // Return the paths to all render settings prims on the stage.
725 HUSD_API void
726 HUSDgetAllRenderSettings(const UsdStageRefPtr &stage, UT_StringArray &paths);
727 
728 // Return a render settings path using the following priorities:
729 // 1. The provided explicit_path, if a prim exists there.
730 // 2. The settings prim specified in the renderSource attribute on the
731 // pass prim given in renderpass_path, if a prim exists there.
732 // 3. The current settings prim according to the stage metadata.
733 // 4. If there is exactly one settings prim on the stage, return it.
734 // If pick_first_of_many is true and there is more than one render
735 // settings prim, pick the first one.
736 // 5. Return an empty path.
738 HUSDgetBestRenderSettings(const UsdStageRefPtr &stage,
739  const UT_StringRef &explicit_path = UT_StringHolder::theEmptyString,
740  const UT_StringRef &renderpass_path = UT_StringHolder::theEmptyString,
741  bool pick_first_of_many = false);
742 
743 // Gets the ids for all instances in a point instancer prim. Returns true if
744 // the passed in prim is a point instancer, otherwise false. If the point
745 // instancer doesn't have an ids attribute, the default 0..N range of values
746 // is added based on the length of the protoIndices array.
747 HUSD_API bool
749  const HUSD_TimeCode &timecode,
751 
752 /// Intermediate format for USD camera parameters. This allows reusing the
753 /// UT_CameraParms conversion logic for multiple code paths (translating to USD,
754 /// Hydra, etc)
756 {
758  {
759  CustomAttrib() = default;
761  const TfToken &name,
762  const SdfValueTypeName &type,
763  const VtValue &value)
764  : myName(name), myType(type), myValue(value)
765  {
766  }
767 
771  };
772 
773  // Standard camera parameters.
775  double myShutterOpen = 0.0;
776  double myShutterClose = 0.0;
777  float myGuideScale = 1.0;
778  double myImagingDistance = 0.0;
779 
780  // Additional API schemas and custom attributes which should be added to the
781  // camera (corresponds to metadata on the UT camera)
784 };
785 
786 /// Convert from UT_CameraParms to USD camera parameters.
787 HUSD_API void
789  const UT_CameraParms &ut_parms,
791 
793 
794 #endif
HUSD_API UsdTimeCode HUSDgetNonDefaultUsdTimeCode(const HUSD_TimeCode &timecode)
HUSD_API bool HUSDgetSourcePath(const SdfLayerHandle &layer, std::string &sourcePath)
HUSD_API const SdfPath & HUSDgetHoudiniLayerInfoSdfPath()
HUSD_API void HUSDgetAllRenderSettings(const UsdStageRefPtr &stage, UT_StringArray &paths)
HUSD_API UsdStageRefPtr HUSDcreateStageInMemory(UsdStage::InitialLoadSet load, const UsdStageWeakPtr &context_stage=UsdStageWeakPtr(), int resolver_context_nodeid=OP_INVALID_ITEM_ID, const ArResolverContext *resolver_context=nullptr)
HUSD_API void HUSDaddEditorNode(const SdfLayerHandle &layer, int node_id)
HUSD_API const TfToken & HUSDgetSoloLightPathsToken()
HUSD_API void HUSDupdateWorldTransformTimeSampling(HUSD_TimeSampling &sampling, const UsdPrim &prim)
HUSD_API void HUSDaddExternalReferencesToLayerMap(const SdfLayerRefPtr &layer, XUSD_IdentifierToReferenceInfoMap &referenceinfomap, bool recursive, bool include_placeholders=false)
HUSD_API void HUSDupdateValueTimeSampling(HUSD_TimeSampling &sampling, const UsdAttribute &attrib)
HUSD_API std::map< std::string, XUSD_ExternalRefType > HUSDgetExternalReferences(const SdfLayerRefPtr &layer, bool sublayer_only=false)
Unsorted map container.
Definition: UT_Map.h:114
virtual UsdStageRefPtr createStage(UsdStage::InitialLoadSet loadset, int nodeid) const =0
HUSD_API void HUSDsetSaveControl(const SdfLayerHandle &layer, const UT_StringRef &savecontrol)
Object-based representation of a camera.
Definition: camera.h:32
HUSD_API void HUSDclearPrimEditorNodeIds(const UsdPrim &prim)
HUSD_API SdfLayerRefPtr HUSDflattenLayersInChunks(const std::vector< std::string > &sublayers, const std::vector< SdfLayerOffset > &sublayeroffsets, const UsdStageRefPtr &context_stage)
GfCamera myCamera
Definition: XUSD_Utils.h:774
bool myActuallySavedFile
Definition: XUSD_Utils.h:133
HUSD_API bool HUSDvalueMightBeTimeVarying(const UsdAttribute &attrib)
#define SYS_VISIBILITY_EXPORT
SdfLayerRefPtr myLayer
Definition: XUSD_Utils.h:139
A 4x4 matrix transformation.
Definition: xformOp.h:136
HUSD_API void HUSDupdateTimeSampling(HUSD_TimeSampling &sampling, HUSD_TimeSampling new_sampling)
HUSD_API bool HUSDisLopLayer(const std::string &identifier)
#define OP_INVALID_ITEM_ID
Definition: OP_ItemId.h:23
HUSD_API HUSD_LayerOffset HUSDgetLayerOffset(const SdfLayerOffset &layeroffset)
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
Transformation order of scales, rotates, and translates.
Definition: UT_XformOrder.h:23
GLsizei const GLfloat * value
Definition: glcorearb.h:824
UT_Map< std::string, SdfLayerRefPtr > XUSD_IdentifierToLayerMap
Definition: XUSD_Utils.h:145
HUSD_API std::string HUSDgetLayerSaveLocation(const SdfLayerHandle &layer, bool *using_node_path=nullptr)
HUSD_API Usd_PrimFlagsPredicate HUSDgetUsdPrimPredicate(HUSD_PrimTraversalDemands demands)
HUSD_API bool HUSDgetNodePath(int nodeid, UT_StringHolder &nodepath)
HUSD_API SdfPath HUSDgetBestRefPrimPath(const UT_StringRef &reffilepath, const SdfFileFormat::FileFormatArguments &args, const UT_StringRef &refprimpath, UsdStageRefPtr &stage)
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
HUSD_API void HUSDsetSoloLightPaths(const SdfLayerHandle &layer, const HUSD_PathSet &paths)
HUSD_API const TfToken & HUSDgetOverrideSavePathToken()
HUSD_API HUSD_Path HUSDgetBestRenderSettings(const UsdStageRefPtr &stage, const UT_StringRef &explicit_path=UT_StringHolder::theEmptyString, const UT_StringRef &renderpass_path=UT_StringHolder::theEmptyString, bool pick_first_of_many=false)
HUSD_API const TfToken & HUSDgetNodeTypeNameToken()
HUSD_API SdfLayerOffset HUSDgetSdfLayerOffset(const HUSD_LayerOffset &layeroffset)
#define HUSD_API
Definition: HUSD_API.h:31
std::string myReferenceLayerId
Definition: XUSD_Utils.h:129
HUSD_API bool HUSDisLayerEmpty(const SdfLayerHandle &layer, const UsdStageRefPtr &compare_stage_root_prim=UsdStageRefPtr(), bool ignore_sublayers=false)
HUSD_API SdfVariability HUSDgetSdfVariability(HUSD_Variability variability)
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:39
HUSD_API HUSD_TimeSampling HUSDgetLocalTransformTimeSampling(const UsdPrim &pr, bool *resets=nullptr)
HUSD_API void HUSDclearEditorNodes(const SdfLayerHandle &layer)
HUSD_API HUSD_TimeCode HUSDgetEffectiveTimeCode(const HUSD_TimeCode &timecode, const UsdAttribute &attr)
HUSD_API void HUSDclearBestRefPathCache(const std::string &layeridentifier=std::string())
InitialLoadSet
Definition: stage.h:148
HUSD_API const TfToken & HUSDgetIsAutoCreatedShaderToken()
HUSD_API bool HUSDisSopLayer(const std::string &identifier)
HUSD_API void HUSDsetSavePath(const SdfLayerHandle &layer, const UT_StringRef &savepath, bool savepath_is_time_dependent, const UT_StringRef &overrides_savepath=UT_StringRef())
HUSD_API HUSD_TimeSampling HUSDgetWorldTransformTimeSampling(const UsdPrim &pr)
HUSD_PrimTraversalDemands
Definition: HUSD_Utils.h:39
HUSD_API UsdListPosition HUSDgetUsdListPosition(const UT_StringRef &editopstr)
HUSD_API bool HUSDupdateExternalReferences(const SdfLayerHandle &layer, const std::map< std::string, std::string > &pathmap)
HUSD_API bool HUSDprimAndAllExistingAncestorsActive(const UsdStageWeakPtr &stage, const SdfPath &path)
UsdStagePtr UsdStageWeakPtr
Definition: common.h:38
HUSD_API bool HUSDgetSaveControl(const SdfLayerHandle &layer, std::string &savecontrol)
HUSD_API void HUSDgetMetrics(const UsdStageRefPtr &stage, UT_StringHolder &upaxis, fpreal64 &metersperunit)
HUSD_API UsdStagePopulationMask HUSDgetUsdStagePopulationMask(const HUSD_LoadMasks &load_masks)
HUSD_TimeSampling HUSDgetBoundsTimeSampling(const UsdPrim &prim, bool world_space_bounds)
HUSD_API const std::string & HUSDgetStageRootLayerIdentifier()
HUSD_API void HUSDsetSoloGeometryPaths(const SdfLayerHandle &layer, const HUSD_PathSet &paths)
GLenum GLuint GLint GLint layer
Definition: glcorearb.h:1299
HUSD_API SdfLayerRefPtr HUSDcreateAnonymousLayer(const SdfLayerHandle &context_layer=SdfLayerHandle(), const std::string &tag=std::string())
HUSD_API const TfToken & HUSDgetSourcePathToken()
double fpreal64
Definition: SYS_Types.h:201
HUSD_API void HUSDbumpPropertiesForHydra(const UsdAttributeVector &attrs)
HUSD_API bool HUSDgetSavePath(const SdfLayerHandle &layer, std::string &savepath)
XUSD_SavePathInfo(const UT_StringHolder &finalpath, const UT_StringHolder &originalpath, XUSD_ExternalRefType reference_type, const std::string &reference_layer_id, bool node_based_path, bool time_dependent)
Definition: XUSD_Utils.h:108
HUSD_API SdfPrimSpecHandle HUSDgetLayerInfoPrim(const SdfLayerHandle &layer, bool create)
HUSD_API bool HUSDconvertDictionary(UT_Options &options, const VtDictionary &dict, const UT_StringMap< UT_StringHolder > *aliases=nullptr)
HUSD_API bool HUSDcopySpec(const SdfLayerHandle &srclayer, const SdfPath &srcpath, const SdfLayerHandle &destlayer, const SdfPath &destath, const SdfPath &srcroot=SdfPath(), const SdfPath &destroot=SdfPath(), const fpreal frameoffset=0, const fpreal frameratescale=1)
HUSD_API bool HUSDisPrimHiddenInUi(const UsdPrim &prim)
HUSD_Variability
Definition: HUSD_Utils.h:90
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
Definition: token.h:70
UT_Map< std::string, XUSD_SavePathInfo > XUSD_IdentifierToSavePathMap
Definition: XUSD_Utils.h:149
HUSD_API void HUSDaddVolumeLockedGeos(XUSD_Data &outdata, const SdfLayerRefPtr &layer)
CustomAttrib(const TfToken &name, const SdfValueTypeName &type, const VtValue &value)
Definition: XUSD_Utils.h:760
HUSD_API const TfToken & HUSDgetSavePathToken()
UT_StringHolder myFinalPath
Definition: XUSD_Utils.h:125
HUSD_API bool HUSDgetCreatorNode(const SdfLayerHandle &layer, std::string &nodepath)
HUSD_API const TfToken & HUSDgetPrimEditorNodesToken()
HUSD_API bool HUSDisStageVariableExpression(const UT_StringRef &expr, bool check_for_errors)
std::function< std::string(const std::string &assetPath)> UsdUtilsModifyAssetPathFn
Definition: dependencies.h:105
HUSD_API bool HUSDgetSavePathIsTimeDependent(const SdfLayerHandle &layer)
HUSD_API UT_StringHolder HUSDgetSpecifier(const UsdPrim &prim)
HUSD_API void HUSDconvertVariantSelectionFallbacks(const UT_StringMap< UT_StringArray > &utfallbacks, PcpVariantFallbackMap &fallbacks)
std::vector< TfRefPtr< SdfLayer > > SdfLayerRefPtrVector
std::vector< class SdfPath > SdfPathVector
HUSD_API const TfToken & HUSDgetPreviewDefaultValueKeyPathToken()
HUSD_API bool HUSDgetCameraParms(const UsdGeomCamera &camprim, const UsdTimeCode &tc, UT_CameraParms &camparms)
static const UT_StringHolder theEmptyString
HUSD_API bool HUSDgetSoloLightPaths(const SdfLayerHandle &layer, HUSD_PathSet &paths)
HUSD_API SdfSpecifier HUSDgetSdfSpecifier(const UT_StringRef &specifier, bool *valid=nullptr)
constexpr std::enable_if< I< type_count_base< T >::value, int >::type tuple_type_size(){return subtype_count< typename std::tuple_element< I, T >::type >::value+tuple_type_size< T, I+1 >);}template< typename T > struct type_count< T, typename std::enable_if< is_tuple_like< T >::value >::type >{static constexpr int value{tuple_type_size< T, 0 >)};};template< typename T > struct subtype_count{static constexpr int value{is_mutable_container< T >::value?expected_max_vector_size:type_count< T >::value};};template< typename T, typename Enable=void > struct type_count_min{static const int value{0};};template< typename T >struct type_count_min< T, typename std::enable_if<!is_mutable_container< T >::value &&!is_tuple_like< T >::value &&!is_wrapper< T >::value &&!is_complex< T >::value &&!std::is_void< T >::value >::type >{static constexpr int value{type_count< T >::value};};template< typename T > struct type_count_min< T, typename std::enable_if< is_complex< T >::value >::type >{static constexpr int value{1};};template< typename T >struct type_count_min< T, typename std::enable_if< is_wrapper< T >::value &&!is_complex< T >::value &&!is_tuple_like< T >::value >::type >{static constexpr int value{subtype_count_min< typename T::value_type >::value};};template< typename T, std::size_t I >constexpr typename std::enable_if< I==type_count_base< T >::value, int >::type tuple_type_size_min(){return 0;}template< typename T, std::size_t I > constexpr typename std::enable_if< I< type_count_base< T >::value, int >::type tuple_type_size_min(){return subtype_count_min< typename std::tuple_element< I, T >::type >::value+tuple_type_size_min< T, I+1 >);}template< typename T > struct type_count_min< T, typename std::enable_if< is_tuple_like< T >::value >::type >{static constexpr int value{tuple_type_size_min< T, 0 >)};};template< typename T > struct subtype_count_min{static constexpr int value{is_mutable_container< T >::value?((type_count< T >::value< expected_max_vector_size)?type_count< T >::value:0):type_count_min< T >::value};};template< typename T, typename Enable=void > struct expected_count{static const int value{0};};template< typename T >struct expected_count< T, typename std::enable_if<!is_mutable_container< T >::value &&!is_wrapper< T >::value &&!std::is_void< T >::value >::type >{static constexpr int value{1};};template< typename T > struct expected_count< T, typename std::enable_if< is_mutable_container< T >::value >::type >{static constexpr int value{expected_max_vector_size};};template< typename T >struct expected_count< T, typename std::enable_if<!is_mutable_container< T >::value &&is_wrapper< T >::value >::type >{static constexpr int value{expected_count< typename T::value_type >::value};};enum class object_category:int{char_value=1, integral_value=2, unsigned_integral=4, enumeration=6, boolean_value=8, floating_point=10, number_constructible=12, double_constructible=14, integer_constructible=16, string_assignable=23, string_constructible=24, other=45, wrapper_value=50, complex_number=60, tuple_value=70, container_value=80,};template< typename T, typename Enable=void > struct classify_object{static constexpr object_category value{object_category::other};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_integral< T >::value &&!std::is_same< T, char >::value &&std::is_signed< T >::value &&!is_bool< T >::value &&!std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::integral_value};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value &&!std::is_same< T, char >::value &&!is_bool< T >::value >::type >{static constexpr object_category value{object_category::unsigned_integral};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_same< T, char >::value &&!std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::char_value};};template< typename T > struct classify_object< T, typename std::enable_if< is_bool< T >::value >::type >{static constexpr object_category value{object_category::boolean_value};};template< typename T > struct classify_object< T, typename std::enable_if< std::is_floating_point< T >::value >::type >{static constexpr object_category value{object_category::floating_point};};template< typename T >struct classify_object< T, typename std::enable_if<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&std::is_assignable< T &, std::string >::value >::type >{static constexpr object_category value{object_category::string_assignable};};template< typename T >struct classify_object< T, typename std::enable_if<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&!std::is_assignable< T &, std::string >::value &&(type_count< T >::value==1)&&std::is_constructible< T, std::string >::value >::type >{static constexpr object_category value{object_category::string_constructible};};template< typename T > struct classify_object< T, typename std::enable_if< std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::enumeration};};template< typename T > struct classify_object< T, typename std::enable_if< is_complex< T >::value >::type >{static constexpr object_category value{object_category::complex_number};};template< typename T > struct uncommon_type{using type=typename std::conditional<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&!std::is_assignable< T &, std::string >::value &&!std::is_constructible< T, std::string >::value &&!is_complex< T >::value &&!is_mutable_container< T >::value &&!std::is_enum< T >::value, std::true_type, std::false_type >::type;static constexpr bool value=type::value;};template< typename T >struct classify_object< T, typename std::enable_if<(!is_mutable_container< T >::value &&is_wrapper< T >::value &&!is_tuple_like< T >::value &&uncommon_type< T >::value)>::type >{static constexpr object_category value{object_category::wrapper_value};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&is_direct_constructible< T, double >::value &&is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::number_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&!is_direct_constructible< T, double >::value &&is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::integer_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&is_direct_constructible< T, double >::value &&!is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::double_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< is_tuple_like< T >::value &&((type_count< T >::value >=2 &&!is_wrapper< T >::value)||(uncommon_type< T >::value &&!is_direct_constructible< T, double >::value &&!is_direct_constructible< T, int >::value)||(uncommon_type< T >::value &&type_count< T >::value >=2))>::type >{static constexpr object_category value{object_category::tuple_value};};template< typename T > struct classify_object< T, typename std::enable_if< is_mutable_container< T >::value >::type >{static constexpr object_category value{object_category::container_value};};template< typename T, enable_if_t< classify_object< T >::value==object_category::char_value, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"CHAR";}template< typename T, enable_if_t< classify_object< T >::value==object_category::integral_value||classify_object< T >::value==object_category::integer_constructible, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"INT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::unsigned_integral, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"UINT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::floating_point||classify_object< T >::value==object_category::number_constructible||classify_object< T >::value==object_category::double_constructible, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"FLOAT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::enumeration, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"ENUM";}template< typename T, enable_if_t< classify_object< T >::value==object_category::boolean_value, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"BOOLEAN";}template< typename T, enable_if_t< classify_object< T >::value==object_category::complex_number, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"COMPLEX";}template< typename T, enable_if_t< classify_object< T >::value >=object_category::string_assignable &&classify_object< T >::value<=object_category::other, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"TEXT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value >=2, detail::enabler >=detail::dummy >std::string type_name();template< typename T, enable_if_t< classify_object< T >::value==object_category::container_value||classify_object< T >::value==object_category::wrapper_value, detail::enabler >=detail::dummy >std::string type_name();template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value==1, detail::enabler >=detail::dummy >inline std::string type_name(){return type_name< typename std::decay< typename std::tuple_element< 0, T >::type >::type >);}template< typename T, std::size_t I >inline typename std::enable_if< I==type_count_base< T >::value, std::string >::type tuple_name(){return std::string{};}template< typename T, std::size_t I >inline typename std::enable_if<(I< type_count_base< T >::value), std::string >::type tuple_name(){auto str=std::string{type_name< typename std::decay< typename std::tuple_element< I, T >::type >::type >)}+ ','+tuple_name< T, I+1 >);if(str.back()== ',') str.pop_back();return str;}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value >=2, detail::enabler > > std::string type_name()
Recursively generate the tuple type name.
Definition: CLI11.h:1729
HUSD_API HUSD_TimeSampling HUSDgetValueTimeSampling(const UsdAttribute &attrib)
HUSD_API void HUSDaddPropertyEditorNodeId(const UsdProperty &property, int nodeid)
HUSD_API bool HUSDhasAnyVisibleLights(const UsdStageRefPtr &stage, const HUSD_TimeCode &tc)
HUSD_TimeSampling
Definition: HUSD_Utils.h:104
HUSD_API std::string HUSDgetLopLayerMutingIdentifier(const SdfLayerHandle &layer)
HUSD_API const TfToken & HUSDgetEditorNodesToken()
HUSD_API const TfToken & HUSDgetSavePathIsTimeDependentToken()
GLdouble GLdouble GLint GLint order
Definition: glad.h:2676
HUSD_API void HUSDsetCreatorNode(const SdfLayerHandle &layer, int node_id)
Definition: prim.h:116
HUSD_API bool HUSDisLayerPlaceholder(const SdfLayerHandle &layer)
HUSD_API const TfType & HUSDfindType(const UT_StringRef &type_name)
SdfSpecifier
Definition: types.h:103
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
virtual ~XUSD_StageFactory()
Definition: XUSD_Utils.h:70
HUSD_API SdfLayerRefPtr HUSDflattenLayers(const UsdStageWeakPtr &stage)
HUSD_API void HUSDclearPropertyEditorNodeIds(const UsdProperty &property)
GLuint const GLchar * name
Definition: glcorearb.h:786
HUSD_API UsdTimeCode HUSDgetEffectiveUsdTimeCode(const HUSD_TimeCode &timecode, const UsdAttribute &attr)
HUSD_API const TfToken & HUSDgetTreatAsSopLayerToken()
Definition: path.h:280
HUSD_API SdfPrimSpecHandle HUSDcreatePrimInLayer(const UsdStageWeakPtr &stage, const SdfLayerHandle &layer, const SdfPath &path, const TfToken &kind, SdfSpecifier specifier, SdfSpecifier parent_prims_specifier, const std::string &parent_prims_type)
HUSD_API bool HUSDisPrimSelectable(const UsdPrim &prim, UT_Map< HUSD_Path, bool > *cache=nullptr)
HUSD_API void HUSDupdateLocalTransformTimeSampling(HUSD_TimeSampling &sampling, const UsdPrim &prim)
HUSD_API const TfToken & HUSDgetPreviewTagsToken()
TfTokenVector myAPISchemas
Definition: XUSD_Utils.h:782
HUSD_API const TfToken & HUSDgetSaveControlToken()
HUSD_API UsdStageRefPtr HUSDcreateStageFromFile(const UT_StringRef &filepath, const HUSD_LoadMasks *load_masks=nullptr, const UsdStageWeakPtr &context_stage=UsdStageWeakPtr())
UT_Array< CustomAttrib > myCustomAttribs
Definition: XUSD_Utils.h:783
SdfVariability
Definition: types.h:159
HUSD_API const TfToken & HUSDgetSourceNodeToken()
A map of string to various well defined value types.
Definition: UT_Options.h:87
HUSD_API void HUSDsetSourceNode(const UsdPrim &prim, int node_id)
GA_API const UT_StringHolder parms
HUSD_API bool HUSDgetOverrideSavePath(const SdfLayerHandle &layer, std::string &savepath)
SYS_VISIBILITY_EXPORT void newStageFactory(UT_Array< XUSD_StageFactory * > *factories)
UT_StringHolder myFinalPathWithVersionSpecifier
Definition: XUSD_Utils.h:127
HUSD_API UsdTimeCode HUSDgetCurrentUsdTimeCode()
HUSD_API bool HUSDisPrimEditable(const UsdPrim &prim)
HUSD_API UsdStageRefPtr HUSDcreateStageFromRootLayer(const SdfLayerRefPtr &rootlayer, const HUSD_LoadMasks *load_masks=nullptr, const UsdStageWeakPtr &context_stage=UsdStageWeakPtr())
std::vector< UsdAttribute > UsdAttributeVector
A std::vector of UsdAttributes.
Definition: attribute.h:31
HUSD_API const TfToken & HUSDgetCreatorNodeToken()
HUSD_API bool HUSDlocalTransformMightBeTimeVarying(const UsdPrim &prim)
HUSD_API const TfToken & HUSDgetSoloGeometryPathsToken()
HUSD_API bool HUSDconvertValue(UT_JSONWriter &w, const VtValue &value)
HUSD_API void HUSDconvertCameraParms(const UT_CameraParms &ut_parms, XUSD_CameraParms &parms)
Convert from UT_CameraParms to USD camera parameters.
virtual int getPriority() const =0
HUSD_API UsdTimeCode HUSDgetUsdTimeCode(const HUSD_TimeCode &timecode)
HUSD_API void HUSDsetSourcePath(const SdfLayerHandle &layer, const UT_StringRef &sourcePath)
fpreal64 fpreal
Definition: SYS_Types.h:283
HUSD_API void HUSDstitchLayers(const SdfLayerHandle &strongLayer, const SdfLayerHandle &weakLayer, HUSD_PathSet *varyingDefaultPaths=nullptr)
HUSD_API SdfPath HUSDgetSdfPath(const UT_StringRef &path)
HUSD_API void HUSDconvertToFileFormatArguments(const UT_StringMap< UT_StringHolder > &ut_args, SdfFileFormat::FileFormatArguments &sdf_args)
HUSD_API SdfLayerRefPtr HUSDcreateAnonymousCopy(SdfLayerRefPtr srclayer, const std::string &tag=std::string())
HUSD_FlattenLayerFlags
Definition: XUSD_Utils.h:517
HUSD_API bool HUSDgetTreatAsSopLayer(const SdfLayerHandle &layer)
HUSD_API const TfToken & HUSDgetHasAutoPreviewShaderToken()
HUSD_API void HUSDgetMinimalPathsForInheritableProperty(bool skip_point_instancers, const UsdStageRefPtr &stage, XUSD_PathSet &paths)
HUSD_API bool HUSDaddStageTimeSample(const UsdStageWeakPtr &src, const UsdStageRefPtr &dest, const UsdTimeCode &timecode, const std::set< std::string > *strip_sublayer_identifiers, XUSD_LayerSet &held_layers, bool force_notifiable_file_format, bool set_layer_override_save_paths, XUSD_ExistenceTracker *existence_tracker, HUSD_PathSet *varying_default_paths=nullptr)
HUSD_API bool HUSDgetPointInstancerIds(const UsdPrim &prim, const HUSD_TimeCode &timecode, UT_Array< int64 > &ids)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HUSD_API void HUSDmodifyAssetPaths(const SdfLayerHandle &layer, const UsdUtilsModifyAssetPathFn &modifyFn, bool keep_empty_assets_in_arrays=true)
HUSD_API bool HUSDshouldSaveLayerToDisk(const SdfLayerHandle &layer)
**If you just want to fire and args
Definition: thread.h:618
XUSD_ExternalRefType myReferenceType
Definition: XUSD_Utils.h:140
Definition: type.h:47
HUSD_API const TfToken & HUSDgetDataIdToken()
HUSD_API const SdfPath & HUSDgetHoudiniFreeCameraSdfPath()
Type
Enumerates the set of all transformation operation types.
Definition: xformOp.h:110
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
HUSD_API UsdHoudiniHoudiniXformCommonAPI::RotationOrder HUSDcastRotOrder(const UT_XformOrder &order)
UT_Map< std::string, XUSD_ReferenceInfo > XUSD_IdentifierToReferenceInfoMap
Definition: XUSD_Utils.h:147
HUSD_API void HUSDcopyMinimalRootPrimMetadata(const SdfLayerRefPtr &dest, const SdfLayerHandle &src)
HUSD_API void HUSDsetTreatAsSopLayer(const SdfLayerHandle &layer, bool treatassoplayer)
SdfLayerRefPtr myReferenceLayer
Definition: XUSD_Utils.h:141
HUSD_API const TfToken & HUSDgetVolumeFilePathsToken()
HUSD_API const TfToken & HUSDgetMaterialIdToken()
UsdListPosition
Definition: common.h:71
XUSD_SavePathInfo(const UT_StringHolder &finalpath)
Definition: XUSD_Utils.h:98
HUSD_API void HUSDclearDataId(const UsdAttribute &attr)
XUSD_ExternalRefType
Definition: XUSD_Utils.h:83
HUSD_API void HUSDgetMinimalMostNestedPathsForInheritableProperty(const UsdStageRefPtr &stage, XUSD_PathSet &paths)
HUSD_API void HUSDaddPrimEditorNodeId(const UsdPrim &prim, int node_id)
GLuint * ids
Definition: glcorearb.h:652
std::map< std::string, std::string > FileFormatArguments
Definition: fileFormat.h:102
Definition: value.h:89
std::map< std::string, std::vector< std::string > > PcpVariantFallbackMap
Definition: types.h:189
HUSD_API std::string HUSDgetTag(const XUSD_DataLockPtr &datalock)
HUSD_API VtValue HUSDoptionToVtValue(const UT_OptionEntry *option)
HUSD_API void HUSDgenerateUniqueTransformOpSuffix(UT_StringHolder &suffix, const UsdGeomXformable &xformable, UsdGeomXformOp::Type type=UsdGeomXformOp::TypeTransform, bool test_base_xform=false)
HUSD_API SdfLayerRefPtr HUSDflattenLayerPartitions(const UsdStageWeakPtr &stage, int flatten_flags, SdfLayerRefPtrVector &explicit_layers)
HUSD_API bool HUSDgetSoloGeometryPaths(const SdfLayerHandle &layer, HUSD_PathSet &paths)
UT_StringHolder myOriginalPath
Definition: XUSD_Utils.h:126
HUSD_API TfToken HUSDgetParentKind(const TfToken &kind)
HUSD_API const TfToken & HUSDgetDialogScriptToken()
XUSD_ExternalRefType myReferenceType
Definition: XUSD_Utils.h:128
GLenum src
Definition: glcorearb.h:1793
HUSD_API bool HUSDisDerivedType(const UsdPrim &prim, const TfType &base_type)
bool myWarnedAboutMixedTimeDependency
Definition: XUSD_Utils.h:132
HUSD_API SdfPathVector HUSDgetSdfPaths(const UT_StringArray &paths)
RotationOrder
Enumerates the rotation order of the 3-angle Euler rotation.