aboutsummaryrefslogtreecommitdiff
path: root/mayaPlug/shaveVrayCmd.h
blob: 28957818c055ec6601580db53b6a2fc5ba05b1b5 (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
#ifndef _HAIR_VRAY_COMMAND_H_
#define _HAIR_VRAY_COMMAND_H_

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

/**********************************************************************
 *<
	FILE:			shaveVrayCmd.h  

	DESCRIPTION:	Maya node

	HISTORY:		created  01-04-2010 

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

// Check for 64-bit OS and define the Bits64_ macro required by Maya headers
#ifdef X64
#ifndef Bits64_
#define Bits64_
#endif
#endif

#include <maya/MPxCommand.h>
#include <maya/MArgList.h>
#include <maya/MCommandResult.h>
#include <maya/MSyntax.h>
#include <maya/MNodeMessage.h>

class shaveVrayCmd : public MPxCommand {
	//friend void shaveVrayShaderChangeCbk(MNodeMessage::AttributeMessage msg, MPlug &plug, MPlug &otherPlug, void *clientData);
public:
	// command
	//
	static MString cmd;

	// flags
	//
	//attaches shader to selected or all existing shave shapes 
	static char* sf_create;
	static char* lf_create;

	//deletes shader attached to selected or all existing shave shapes
	static char* sf_delete;
	static char* lf_delete;

	//can be used with -create/delete flag
	static char* sf_all;		
	static char* lf_all;

#if 0
	static char* sf_addCbk;
	static char* lf_addCbk;

	static char* sf_delCbk;
	static char* lf_delCbk;
#endif

	shaveVrayCmd(){}
	virtual ~shaveVrayCmd(){}

	static void *creator() {return new shaveVrayCmd;}
	static MSyntax newSyntax();

	virtual MStatus	doIt(const MArgList&);

protected:

	bool attachShaderTo  (MObject shShape);
	bool detachShaderFrom(MObject shShape);
	bool setupLayers(MObject shaveShape, MObject vrayShape);
	bool resetLayers(MObject vrayShape);
#if 0
	bool registerLayersCallback();
	bool deregisterLayersCallack();
#endif
	bool registerShaderChangeCallback(MObject shape);
	bool deregisterShaderChangeCallacks();
};

#endif