aboutsummaryrefslogtreecommitdiff
path: root/mayaPlug/shaveVrayRenderer.h
blob: 146603dac551a0a3c3d5eb5afc3d988ab7b717d0 (plain) (blame)
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
#ifndef shaveVrayRenderer_h
#define shaveVrayRenderer_h

// Shave and a Haircut
// (c) 2019 Epic Games
// US Patent 6720962

#include <maya/MSelectionList.h>
#include <maya/MString.h>
#include <maya/MStringArray.h>
#include <maya/MTypes.h>

#include "shaveConstant.h"
#include "shaveVrayNode.h"
#include "shaveRenderer.h"

class shaveHairShape;

#ifdef USE_VRAY

class shaveVrayRenderer : public shaveRenderer
{
public:
					shaveVrayRenderer();
	virtual			~shaveVrayRenderer();

	virtual	void	renderStart();
	virtual	void	renderEnd();
	//
	// these will not do any job - vrayKeyframeCallback will be used instead 
	//
	virtual	void	frameStart(const shaveGlobals::Globals& g);
	virtual	void	timeChange(const MTime& newTime);
	virtual	void	frameEnd(const shaveGlobals::Globals& g);

	
	virtual	bool	isGeomNode(const shaveHairShape* nodePtr) const;

	virtual	void	render(
					float frame,
					shaveConstant::ShutterState shutter,
					const MDagPath& camera
				);

	//
	//This should be used instead of frameStart - timeChange - frameEnd
	//will be called before each keyframe is created 
	//but after the current time is moved for the current keyframe.
	void vrayKeyframeCallback();

//************************************************
//
//		Helper Methods
//
//************************************************

	MString     fileName;
	bool		exportOK;
	bool		ioError;

	MSelectionList list;

protected:
	enum TimeState
	{
		kAwaitingNothing,
		kAwaitingShutterOpen,
		//kAwaitingShutterOpenSwap,
		kAwaitingCenterFrame,
		kAwaitingShutterClose,
		kAwaitingShutterBoth
	};

	TimeState	mTimeState;
	//bool		mIsAnimation;
	//MTime		mFirstFrame;
	//bool		mIsFirstFrame;

	MString     tempDra;
	
};

#endif //USE_VRAY

#endif