aboutsummaryrefslogtreecommitdiff
path: root/mayaPlug/shaveAPI.cpp
blob: 242b9510cf64e930201dfe6bb22091a090c586af (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
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
122
123
124
125
126
127
// Shave and a Haircut
// (c) 2019 Epic Games
// US Patent 6720962

#include <maya/MObjectArray.h>
#include <maya/MStatus.h>
#include <maya/MString.h>

#include "shaveAPI.h"
#include "shaveAPIimpl.h"

#include <assert.h>

#ifdef _WIN32
BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    switch (ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
		case DLL_PROCESS_DETACH:
			break;
    }
    return TRUE;
}
#endif


MStatus shaveAPI::exportAllHair(
	shaveAPI::HairInfo* hairInfo, bool renderableOnly
)
{
	return shaveAPIimpl::exportAllHair(hairInfo, renderableOnly);
}


#if 0
MStatus shaveAPI::exportDRAFile(MString filename)
{
	return shaveAPIimpl::exportDRAFile(filename);
}
#endif


MStatus shaveAPI::exportHair(
	MObjectArray& shaveNodes, shaveAPI::HairInfo* hairInfo
)
{

	MStatus stat = shaveAPIimpl::exportHair(shaveNodes, hairInfo);
#ifdef _WIN32
	assert(_CrtCheckMemory()); 
#endif
	return stat; 
}


MStatus shaveAPI::exportOcclusions(
	shaveAPI::SceneGeom* hairOcclusions,
	shaveAPI::SceneGeom* shadowOcclusions
)
{
	return shaveAPIimpl::exportOcclusions(hairOcclusions, shadowOcclusions);
}


void shaveAPI::freeHairInfo(shaveAPI::HairInfo* hairInfo)
{
	hairInfo->clear();
}


void shaveAPI::initHairInfo(shaveAPI::HairInfo* hairInfo)
{
}


//******************************************
//
//		HairInfo Interfaces
//
//******************************************

shaveAPI::HairInfo::HairInfo()
{
	shaveAPIimpl::initHairInfo(this);
}


shaveAPI::HairInfo::~HairInfo()
{
	clear();
}


void shaveAPI::HairInfo::clear()
{
	shaveAPIimpl::freeHairInfo(this);
}


//******************************************
//
//		SceneGeom Interfaces
//
//******************************************

shaveAPI::SceneGeom::SceneGeom()
{
	shaveAPIimpl::initSceneGeom(this);
}


shaveAPI::SceneGeom::~SceneGeom()
{
	clear();
}


void shaveAPI::SceneGeom::clear()
{
	shaveAPIimpl::freeSceneGeom(this);
}