-
Notifications
You must be signed in to change notification settings - Fork 60
/
OutputGeometryPart.h
121 lines (104 loc) · 4.54 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
#ifndef __OutputGeometryPart_h__
#define __OutputGeometryPart_h__
#include <maya/MFloatArray.h>
#include <maya/MFloatPointArray.h>
#include <maya/MFnArrayAttrsData.h>
#include <maya/MIntArray.h>
#include <maya/MString.h>
#include <maya/MVectorArray.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,
AssetNodeOptions::AccessorDataBlock &options);
void computeCurves(const MTime &time,
const MPlug &curvesPlug,
const MPlug &curvesIsBezierPlug,
MDataBlock &data,
MDataHandle &curvesHandle,
MDataHandle &curvesIsBezierHandle,
AssetNodeOptions::AccessorDataBlock &options);
void computeVolume(const MTime &time,
const MPlug &volumePlug,
MDataBlock &data,
MDataHandle &volumeHandle,
const bool preserveScale);
void computeVolumeTransform(const MTime &time,
MDataHandle &volumeTransformHandle,
const bool preserveScale);
void computeInstancer(const MTime &time,
const MPlug &hasInstancerPlug,
const MPlug &instancePlug,
MDataBlock &data,
MDataHandle &hasInstancerHandle,
MDataHandle &instanceHandle,
const bool preserveScale);
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 preserveScale);
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