HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
HUSD_ApexScene.h
Go to the documentation of this file.
1
/*
2
* Copyright 2025 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
#ifndef __HUSD_ApexScene_h__
18
#define __HUSD_ApexScene_h__
19
20
#include "
HUSD_API.h
"
21
22
#include "
HUSD_Path.h
"
23
24
#include <
SYS/SYS_Types.h
>
25
#include <
UT/UT_Array.h
>
26
#include <
UT/UT_NonCopyable.h
>
27
#include <
UT/UT_Set.h
>
28
#include <
UT/UT_StringHolder.h
>
29
#include <
UT/UT_StringMap.h
>
30
#include <
UT/UT_UniquePtr.h
>
31
32
class
APEXA_SceneInvoke
;
33
class
GU_ConstDetailHandle
;
34
class
GU_DetailHandle
;
35
class
HUSD_AutoAnyLock
;
36
class
HUSD_AutoWriteLock
;
37
class
HUSD_FindPrims
;
38
39
/// Stores an APEX scene loaded from USD (a HoudiniApexScene prim), along with
40
/// information about the USD primitives bound to APEX scene outputs.
41
/// This can be safely cached between LOP cooks to avoid rebuilding APEX scenes
42
/// unless the input stage has changed.
43
class
HUSD_API
HUSD_ApexScene
44
{
45
public
:
46
HUSD_ApexScene
();
47
~
HUSD_ApexScene
();
48
49
UT_NON_COPYABLE
(
HUSD_ApexScene
)
50
51
/// Options for how to convert USD prims to geometry for APEX rig inputs.
52
struct
HUSD_API
GeoImportOptions
53
{
54
/// If non-empty, adds a prim attribute with the source USD prim's path.
55
UT_StringHolder
myPathAttrib
;
56
};
57
58
/// Assembles APEX scenes from the specified list of HoudiniApexScene
59
/// prims.
60
/// This performs validation checks to ensure that e.g. a prim isn't driven
61
/// by the output of more than one scene.
62
static
bool
loadScenes(
63
const
HUSD_AutoAnyLock
&read_lock,
64
const
HUSD_FindPrims
&find_prims,
65
const
GeoImportOptions
&import_options,
66
UT_Array<HUSD_ApexScene>
&scenes);
67
68
/// Assemble the input geometry for an APEX scene from the specified
69
/// HoudiniApexScene prim.
70
static
GU_DetailHandle
loadSceneGeometry(
71
const
HUSD_AutoAnyLock
&read_lock,
72
const
HUSD_Path
&scene_path,
73
const
GeoImportOptions
&import_options);
74
75
/// Evaluates the scene at the specified list of samples, and updates any
76
/// prims bound to a scene output.
77
bool
evaluateOutputs(
78
HUSD_AutoWriteLock
&write_lock,
79
const
UT_SortedSet<fpreal>
&
samples
,
80
const
UT_StringRef
&xform_description,
81
bool
use_xform_common_api);
82
83
struct
ShapeOutputInfo;
84
struct
XformOutputInfo;
85
86
private
:
87
/// Loads the APEX scene from packed folders.
88
bool
loadFromGeometry(
const
GU_ConstDetailHandle
&scene_gdh);
89
90
UT_UniquePtr<APEXA_SceneInvoke>
myScene;
91
UT_Array<ShapeOutputInfo>
myShapeOutputs;
92
UT_Array<XformOutputInfo>
myXformOutputs;
93
94
/// Map from xforming prim paths to their unique index from 0-N.
95
UT_Map<HUSD_Path, exint>
myXformingPrimIndex;
96
/// Index of the closest parent xforming prim, or -1.
97
UT_Array<exint>
myXformingPrimParents;
98
};
99
100
#endif
HUSD_Path.h
UT_Map< HUSD_Path, exint >
HUSD_Path
Definition:
HUSD_Path.h:31
APEXA_SceneInvoke
Definition:
APEXA_SceneInvoke.h:26
HUSD_API
#define HUSD_API
Definition:
HUSD_API.h:31
HUSD_ApexScene
Definition:
HUSD_ApexScene.h:43
UT_StringRef
Definition:
UT_StringHolder.h:223
UT_Array.h
HUSD_AutoWriteLock
Definition:
HUSD_DataHandle.h:293
UT_Array
Definition:
BV_KDOPTree.h:18
UT_UniquePtr
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition:
UT_UniquePtr.h:39
UT_StringHolder
Definition:
UT_StringHolder.h:1074
UT_Set.h
SYS_Types.h
HUSD_FindPrims
Definition:
HUSD_FindPrims.h:40
GU_ConstDetailHandle
Definition:
GU_DetailHandle.h:180
UT_NON_COPYABLE
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
Definition:
UT_NonCopyable.h:31
HUSD_API.h
UT_NonCopyable.h
HUSD_AutoAnyLock
Definition:
HUSD_DataHandle.h:220
samples
GLsizei samples
Definition:
glcorearb.h:1298
GU_DetailHandle
Definition:
GU_DetailHandle.h:42
UT_UniquePtr.h
UT_StringHolder.h
HUSD_ApexScene::GeoImportOptions::myPathAttrib
UT_StringHolder myPathAttrib
If non-empty, adds a prim attribute with the source USD prim's path.
Definition:
HUSD_ApexScene.h:55
UT_StringMap.h
HUSD_ApexScene::GeoImportOptions
Options for how to convert USD prims to geometry for APEX rig inputs.
Definition:
HUSD_ApexScene.h:52
UT_SortedSet< fpreal >
HUSD
HUSD_ApexScene.h
Generated on Tue Oct 27 2026 02:18:48 for HDK by
1.8.6