diff options
Diffstat (limited to 'mayaPlug/shaveAPI.cpp')
| -rw-r--r-- | mayaPlug/shaveAPI.cpp | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/mayaPlug/shaveAPI.cpp b/mayaPlug/shaveAPI.cpp new file mode 100644 index 0000000..242b951 --- /dev/null +++ b/mayaPlug/shaveAPI.cpp @@ -0,0 +1,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); +} |