forked from sideeffects/HoudiniEngineForMaya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOutputGeometryPart.h
146 lines (129 loc) · 4.4 KB
/
OutputGeometryPart.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#ifndef __OutputGeometryPart_h__
#define __OutputGeometryPart_h__
#include <maya/MIntArray.h>
#include <maya/MFloatPointArray.h>
#include <maya/MFloatArray.h>
#include <maya/MFnArrayAttrsData.h>
#include <maya/MVectorArray.h>
#include <maya/MString.h>
class Asset;
class OutputGeometryPart
{
public:
OutputGeometryPart(
HAPI_NodeId nodeId,
HAPI_PartId partId
);
~OutputGeometryPart();
bool needCompute(
AssetNodeOptions::AccessorDataBlock &options
) const;
MStatus compute(
const MTime &time,
const MPlug &partPlug,
MDataBlock& data,
MDataHandle& handle,
AssetNodeOptions::AccessorDataBlock &options,
bool &needToSyncOutputs
);
protected:
void update();
private:
void computeMaterial(
const MTime &time,
const MPlug &materialPlug,
MDataBlock& data,
MDataHandle &materialHandle
);
void computeMesh(
const MTime &time,
const MPlug &hasMeshPlug,
const MPlug &meshPlug,
MDataBlock& data,
MDataHandle &hasMeshHandle,
MDataHandle &meshHandle,
AssetNodeOptions::AccessorDataBlock &options
);
void computeParticle(
const MTime &time,
const MPlug &hasParticlePlug,
const MPlug &particlePlug,
MDataBlock& data,
MDataHandle &hasParticlesHandle,
MDataHandle &particleHandle
);
void computeCurves(
const MTime &time,
const MPlug &curvesPlug,
const MPlug &curvesIsBezierPlug,
MDataBlock& data,
MDataHandle &curvesHandle,
MDataHandle &curvesIsBezierHandle
);
void computeVolume(
const MTime &time,
const MPlug &volumePlug,
MDataBlock& data,
MDataHandle &volumeHandle
);
void computeVolumeTransform(
const MTime &time,
MDataHandle &volumeTransformHandle
);
void computeInstancer(
const MTime &time,
const MPlug &hasInstancerPlug,
const MPlug &instancePlug,
MDataBlock& data,
MDataHandle &hasInstancerHandle,
MDataHandle &instanceHandle
);
void computeExtraAttributes(
const MTime &time,
const MPlug &extraAttributesPlug,
MDataBlock& data,
MDataHandle &extraAttributesHandle,
AssetNodeOptions::AccessorDataBlock &options,
bool &needToSyncOutputs
);
void computeGroups(
const MTime &time,
const MPlug &groupsPlug,
MDataBlock& data,
MDataHandle &groupsHandle,
AssetNodeOptions::AccessorDataBlock &options,
bool &needToSyncOutputs
);
template<typename T>
bool getAttributeData(
std::vector<T> &array,
const char* name,
HAPI_AttributeOwner owner
);
template<typename T>
bool convertParticleAttribute(
T arrayDataFn,
const char* houdiniName
);
bool computeExtraAttribute(
const MPlug &extraAttributePlug,
MDataBlock& data,
MDataHandle &extraAttributeHandle,
HAPI_AttributeOwner attributeOwner,
const char* attributeName
);
void markAttributeUsed(const std::string &attributeName);
bool isAttributeUsed(const std::string &attributeName);
void clearAttributesUsed();
private:
HAPI_NodeId myNodeId;
HAPI_PartId myPartId;
std::vector<std::string> myAttributesUsed;
HAPI_GeoInfo myGeoInfo;
HAPI_PartInfo myPartInfo;
HAPI_VolumeInfo myVolumeInfo;
HAPI_CurveInfo myCurveInfo;
bool myLastOutputGeometryGroups;
bool myLastOutputCustomAttributes;
};
#endif