-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathPartioVisualizer.h
More file actions
60 lines (48 loc) · 1.67 KB
/
Copy pathPartioVisualizer.h
File metadata and controls
60 lines (48 loc) · 1.67 KB
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
#ifndef PartioVisualizer_H
#define PartioVisualizer_H
#include <maya/MPxLocatorNode.h>
#include <maya/MComputation.h>
#include <maya/MNodeMessage.h>
#include <vector>
#include "extern/partio/src/lib/Partio.h"
#include <maya/MMessage.h>
class Shader;
class PartioVisualizer : public MPxLocatorNode
{
public:
PartioVisualizer();
virtual ~PartioVisualizer();
static void* creator();
static MStatus initialize();
virtual void postConstructor();
virtual MStatus compute( const MPlug& plug, MDataBlock& data );
virtual void draw( M3dView & view, const MDagPath & path, M3dView::DisplayStyle style, M3dView::DisplayStatus status);
virtual MBoundingBox boundingBox() const;
virtual bool isBounded() const;
public:
static MTypeId id;
static MString drawDbClassification;
static MObject m_activeAttr;
static MObject m_radius;
static MObject m_minVal;
static MObject m_maxVal;
static MObject m_frameIndex;
static MObject m_color;
static MObject m_particleFile;
static MObject m_colorAttrName;
static MObject m_colorMapType;
static MObject m_update;
Partio::ParticlesDataMutable* m_partioData;
Partio::ParticleAttribute m_posAttr;
Partio::ParticleAttribute m_userColorAttr;
std::vector<float> m_dummyVel;
MBoundingBox m_bbox;
protected:
MCallbackId m_attrNameCallbackId;
int m_currentFrame;
std::string convertFileName(const std::string &inputFileName, const unsigned int currentFrame);
std::string zeroPadding(const unsigned int number, const unsigned int length);
bool readParticles(const std::string &fileName, const std::string &attrName);
static void attribteNameChangedCB(MNodeMessage::AttributeMessage msg, MPlug & plug, MPlug & otherPlug, void* clientData);
};
#endif