forked from sideeffects/HoudiniEngineForMaya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAsset.h
104 lines (76 loc) · 2.47 KB
/
Asset.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
#ifndef __Asset_h__
#define __Asset_h__
#include <maya/MObjectArray.h>
#include <maya/MObject.h>
#include <maya/MString.h>
#include <maya/MTime.h>
#include <HAPI/HAPI.h>
#include "OutputObject.h"
#include <vector>
class Inputs;
class MFnDependencyNode;
class Asset {
public:
Asset(
const MString &otlFilePath,
const MString &assetName,
const MObject &node
);
~Asset();
bool isValid() const;
MString getOTLFilePath() const;
MString getAssetName() const;
OutputObject* findObjectByName(MString name);
OutputObject* findObjectById(int id);
HAPI_AssetInfo getAssetInfo() { return myAssetInfo; }
// Getters for infos
HAPI_ObjectInfo getObjectInfo(int id);
void resetSimulation();
MString getCookMessages();
MTime getTime() const;
void setTime(
const MTime &mayaTime
);
void setInputs(const MPlug& plug, MDataBlock& data);
MStatus compute(
const MPlug& plug,
MDataBlock& data,
bool splitGeosByGroup,
bool cookTemplatedGeos,
bool &needToSyncOutputs
);
void getParmValues(
MDataBlock &dataBlock,
const MFnDependencyNode &nodeFn,
const std::vector<MObject>* attrs
);
void setParmValues(
MDataBlock &dataBlock,
const MFnDependencyNode &nodeFn,
const std::vector<MObject>* attrs
);
public:
HAPI_NodeInfo myNodeInfo;
private:
void update();
void computeInstancerObjects(
const MPlug& plug,
MDataBlock& data,
bool &needToSyncOutputs
);
void computeGeometryObjects(
const MPlug& plug,
MDataBlock& data,
bool &needToSyncOutputs
);
private:
typedef std::vector<HAPI_ObjectInfo> ObjectInfos;
typedef std::vector<OutputObject*> OutputObjects;
MTime myTime;
HAPI_AssetInfo myAssetInfo;
ObjectInfos myObjectInfos;
MObject myNode; //The Maya asset node
Inputs* myAssetInputs;
OutputObjects myObjects; //the OutputObject class contains a 1 to 1 map with HAPI_ObjectInfos.
};
#endif