aboutsummaryrefslogtreecommitdiff
path: root/mayaPlug/shaveVraySharedFunctions.h
blob: 0f84d19809ec6798bf0c9e937d78c0b96185677c (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
#ifndef _HAIR_VR_PRIM_SHARED_FUCTIONS_H_
#define _HAIR_VR_PRIM_SHARED_FUCTIONS_H_

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

/**********************************************************************
 *<
	FILE:			shaveVraySharedFunctions.h  

	DESCRIPTION:	Various shared functions

	HISTORY:		created  21-08-2008 ( as part of 3ds Max + VRay hair shaders)
					merged   31-03-2010 

 *>
 **********************************************************************/

#include "shaveVrayNode.h"

#ifdef USE_VRAY


#include <maya/MGlobal.h>
#include <maya/MPlug.h>
#include <maya/MObjectArray.h>
#include <maya/MTypeId.h>

/*
// This code seems unused...
#include <vraybase.h>
inline void GenOrthVectors(const VR::Vector& in, VR::Vector& u, VR::Vector& v)
{
	u = (in.x != 0.0f || in.y != 0.0f) ?
		normalize(VR::Vector(-in.y, in.x, 0.0f)) :
				  VR::Vector(1.0f, 0.0f, 0.0f);

	v = normalize(in^u);
}
// */

MObject getNodeByName(const char *nodeName);

void FindNodesByTypeId(MTypeId nodeType, MObjectArray& nodes);

void FindNodesByApiType(MFn::Type type, MObjectArray& nodes);

bool getSourcePlugFromPlug(const MPlug destPlug, MPlug &plug);

bool FindCurrentShaveShape(MObject &shShape);

bool FindConnectedShaveShape(MObject node, MObject &shShape);

bool FindAllShaveShapes(MObjectArray& shShapes);

bool EnumDownNodes(MObject thisNode, MObjectArray& nodes);

bool GetLibPathEnv(const MString vrayVersion, MString &path);

bool GetLibPath(const MString vrayVersion, MString &var);

#endif //USE_VRAY

#endif	//end of_HAIR_VR_PRIM_SHARED_FUCTIONS_H_