forked from sideeffects/HoudiniEngineForMaya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOutputGeometryPart.h
112 lines (95 loc) · 2.96 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
#ifndef __OutputGeometryPart_h__
#define __OutputGeometryPart_h__
#include <maya/MIntArray.h>
#include <maya/MFloatPointArray.h>
#include <maya/MFloatArray.h>
#include <maya/MVectorArray.h>
#include <maya/MString.h>
class Asset;
class MFnArrayAttrsData;
class OutputGeometryPart
{
public:
OutputGeometryPart(
int assetId,
int objectId,
int geoId,
int partId
);
~OutputGeometryPart();
MStatus compute(
const MTime &time,
MDataHandle& handle,
bool hasGeoChanged,
bool hasMaterialChanged,
bool &needToSyncOutputs
);
protected:
void update();
private:
void computeMaterial(
const MTime &time,
MDataHandle &materialHandle
);
void computeMesh(
const MTime &time,
MDataHandle &hasMeshHandle,
MDataHandle &meshHandle
);
void computeParticle(
const MTime &time,
MDataHandle &hasParticlesHandle,
MDataHandle &particleHandle
);
void computeCurves(
const MTime &time,
MDataHandle &curvesHandle,
MDataHandle &curvesIsBezierHandle
);
void computeVolume(
const MTime &time,
MDataHandle &volumeHandle
);
void computeVolumeTransform(
const MTime &time,
MDataHandle &volumeTransformHandle
);
void computeExtraAttributes(
const MTime &time,
MDataHandle &extraAttributesHandle
);
template<typename T>
bool getAttributeData(
std::vector<T> &array,
const char* name,
HAPI_AttributeOwner owner
);
template<typename T, typename U>
void convertParticleAttribute(
MFnArrayAttrsData &arrayDataFn,
const MString &mayaName,
U &buffer,
const char* houdiniName,
int particleCount
);
bool convertGenericDataAttribute(
MDataHandle &dataHandle,
const char* attributeName,
const HAPI_AttributeInfo &attributeInfo
);
void markAttributeUsed(const std::string &attributeName);
bool isAttributeUsed(const std::string &attributeName);
void clearAttributesUsed();
private:
int myAssetId;
int myObjectId;
int myGeoId;
int myPartId;
std::vector<std::string> myAttributesUsed;
HAPI_PartInfo myPartInfo;
HAPI_VolumeInfo myVolumeInfo;
HAPI_CurveInfo myCurveInfo;
HAPI_MaterialInfo myMaterialInfo;
bool myNeverBuilt;
};
#endif