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_PointInstancer.h
Go to the documentation of this file.
1
/*
2
* Copyright 2024 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 __HUSD_PointInstancer_h__
19
#define __HUSD_PointInstancer_h__
20
21
#include <
GU/GU_Detail.h
>
22
23
#include <
GA/GA_Types.h
>
24
25
#include <
HUSD/HUSD_API.h
>
26
#include <
HUSD/HUSD_DataHandle.h
>
27
#include <
HUSD/HUSD_TimeCode.h
>
28
29
#include <
UT/UT_StringHolder.h
>
30
31
32
class
HUSD_API
HUSD_PointInstancer
33
{
34
public
:
35
enum
IdSource
36
{
37
IDSOURCENONE
,
38
IDSOURCEATTRIBUTE
,
39
IDSOURCEPOINTNUMBER
,
40
IDSOURCEATTRIBUTEORPOINTNUMBER
41
};
42
43
enum
ProtoSource
44
{
45
PROTOSOURCENONE
,
46
PROTOSOURCEATTRIBUTE
,
47
PROTOSOURCEPRIMPATH
48
};
49
50
enum
CopyStyle
51
{
52
COPYSTYLEINVALID
,
53
COPYSTYLEOVERWRITE
,
// Overwrite existing array value with new length based on only existing points in sops
54
COPYSTYLESPARSE
// look up existing usd values and sparsely update with data from sops (ie missing points in sops keep same value)
55
};
56
57
enum
HUSD_XformType
58
{
59
XFORMTYPENONE
,
60
XFORMTYPEWORLD
61
};
62
63
// USD -> SOP
64
static
bool
copyUsdPrimvarsToGeoAttrs(
HUSD_AutoAnyLock
&lock,
65
GU_Detail
*gdp,
66
const
GA_Offset
&offsetStart,
67
const
int
&numPoints,
68
const
UT_StringHolder
&primvarFilter,
69
const
HUSD_TimeCode
&timeCode,
70
const
UT_StringRef
&PROTOSOURCEPRIMPATH);
71
72
static
bool
copyUsdXformAttrsToGeoAttrs(
HUSD_AutoAnyLock
&lock,
73
GU_Detail
*gdp,
74
const
GA_Offset
&offsetStart,
75
const
int
&numPoints,
76
const
HUSD_TimeCode
&timeCode,
77
const
UT_StringRef
&PROTOSOURCEPRIMPATH,
78
bool
applyPrimXform=
false
,
79
bool
copyPositions=
true
,
80
bool
copyOrientations=
true
,
81
bool
copyScales=
true
,
82
bool
copyAccelerations=
true
,
83
bool
copyVelocities=
true
,
84
bool
copyAngularVelocities=
true
,
85
bool
createUsdXformAttrib=
true
);
86
87
static
bool
copyUsdIdAttrsToGeoAttrs(
HUSD_AutoAnyLock
&lock,
88
GU_Detail
*gdp,
89
const
GA_Offset
&offsetStart,
90
const
int
&numPoints,
91
const
HUSD_TimeCode
&timeCode,
92
const
UT_StringRef
&PROTOSOURCEPRIMPATH,
93
bool
useInvisIds=
true
,
94
IdSource idSource=IDSOURCENONE,
95
ProtoSource protoSource=PROTOSOURCENONE);
96
97
static
bool
createBoundingBoxGeoAttr(
HUSD_AutoAnyLock
&lock,
98
GU_Detail
*gdp,
99
const
GA_Offset
&offsetStart,
100
const
int
&numPoints,
101
const
HUSD_TimeCode
&timeCode,
102
const
UT_StringRef
&PROTOSOURCEPRIMPATH,
103
const
UT_StringArray
&purposes,
104
bool
applyPrimXform=
false
);
105
106
};
107
108
#endif // __HUSD_PointInstancer_h__
HUSD_PointInstancer::CopyStyle
CopyStyle
Definition:
HUSD_PointInstancer.h:50
HUSD_PointInstancer::IDSOURCENONE
Definition:
HUSD_PointInstancer.h:37
HUSD_PointInstancer::IdSource
IdSource
Definition:
HUSD_PointInstancer.h:35
HUSD_API
#define HUSD_API
Definition:
HUSD_API.h:31
UT_StringRef
Definition:
UT_StringHolder.h:198
GU_Detail.h
HUSD_PointInstancer::IDSOURCEPOINTNUMBER
Definition:
HUSD_PointInstancer.h:39
GA_Offset
GA_Size GA_Offset
Definition:
GA_Types.h:646
HUSD_PointInstancer::XFORMTYPENONE
Definition:
HUSD_PointInstancer.h:59
UT_StringHolder
Definition:
UT_StringHolder.h:1009
UT_StringArray
Definition:
UT_StringArray.h:24
HUSD_PointInstancer
Definition:
HUSD_PointInstancer.h:32
HUSD_PointInstancer::IDSOURCEATTRIBUTE
Definition:
HUSD_PointInstancer.h:38
HUSD_API.h
HUSD_TimeCode
Definition:
HUSD_TimeCode.h:24
HUSD_PointInstancer::PROTOSOURCENONE
Definition:
HUSD_PointInstancer.h:45
HUSD_AutoAnyLock
Definition:
HUSD_DataHandle.h:219
HUSD_PointInstancer::PROTOSOURCEATTRIBUTE
Definition:
HUSD_PointInstancer.h:46
HUSD_PointInstancer::ProtoSource
ProtoSource
Definition:
HUSD_PointInstancer.h:43
UT_StringHolder.h
GU_Detail
Definition:
GU_Detail.h:154
HUSD_PointInstancer::COPYSTYLEINVALID
Definition:
HUSD_PointInstancer.h:52
GA_Types.h
HUSD_PointInstancer::COPYSTYLEOVERWRITE
Definition:
HUSD_PointInstancer.h:53
HUSD_TimeCode.h
HUSD_DataHandle.h
HUSD_PointInstancer::HUSD_XformType
HUSD_XformType
Definition:
HUSD_PointInstancer.h:57
HUSD
HUSD_PointInstancer.h
Generated on Thu Sep 4 2025 02:37:51 for HDK by
1.8.6