#include <expmtlControl.h>
This is the inteface class to implement in order to support exposure controls.
ExposureMaterialControl* exp = GetExposureMaterialControl(mtl);
BaseInterface* GetInterface(Interface_ID id) { if (id == EXPOSURE_MATERIAL_CONTROL) return (ExposureMaterialControl*)(this); return Mtl::GetInterface(id); //If the interface ID is not recognized, call the superclass method }
Also, if you want your material's ExposureMaterialControl methods to be exposed to MAXScript, you can derive from ExposureMaterialControlImp.
Public Types |
|
| enum | { kGetNoExposureControl = 0, kSetNoExposureControl = 1, kGetInvertSelfIllum = 2, kSetInvertSelfIllum = 3, kGetInvertReflect = 4, kSetInvertReflect = 5, kGetInvertRefract = 6, kSetInvertRefract = 7 } |
Public Member Functions |
|
| ExposureMaterialControl () | |
| BEGIN_FUNCTION_MAP | PROP_FNS (kGetNoExposureControl, GetNoExposure, kSetNoExposureControl, SetNoExposure, TYPE_BOOL) |
| PROP_FNS (kGetInvertSelfIllum, GetInvertSelfIllum, kSetInvertSelfIllum, SetInvertSelfIllum, TYPE_BOOL) | |
| PROP_FNS (kGetInvertReflect, GetInvertReflect, kSetInvertReflect, SetInvertReflect, TYPE_BOOL) | |
| PROP_FNS (kGetInvertRefract, GetInvertRefract, kSetInvertRefract, SetInvertRefract, TYPE_BOOL) | |
| END_FUNCTION_MAP BOOL | GetNoExposure () const |
| virtual void | SetNoExposure (BOOL on) |
| BOOL | GetInvertSelfIllum () const |
| virtual void | SetInvertSelfIllum (BOOL on) |
| BOOL | GetInvertReflect () const |
| virtual void | SetInvertReflect (BOOL on) |
| BOOL | GetInvertRefract () const |
| virtual void | SetInvertRefract (BOOL on) |
| ULONG | isNoExposure () const |
| bool | isInvertSelfIllum () const |
| bool | isInvertReflect () const |
| bool | isInvertRefract () const |
| IOResult | Save (ISave *isave) |
| IOResult | Load (ILoad *iload) |
Protected Types |
|
| enum | { DATA_CHUNK = 0x322 } |
Protected Member Functions |
|
| IOResult | write (ISave *isave, bool &b) |
| IOResult | read (ILoad *iload, bool &b) |
Protected Attributes |
|
| bool | mNoExposure |
| bool | mInvertSelfIllum |
| bool | mInvertReflect |
| bool | mInvertRefract |
| anonymous enum |
| kGetNoExposureControl | |
| kSetNoExposureControl | |
| kGetInvertSelfIllum | |
| kSetInvertSelfIllum | |
| kGetInvertReflect | |
| kSetInvertReflect | |
| kGetInvertRefract | |
| kSetInvertRefract |
{
kGetNoExposureControl = 0,
kSetNoExposureControl = 1,
kGetInvertSelfIllum = 2,
kSetInvertSelfIllum = 3,
kGetInvertReflect = 4,
kSetInvertReflect = 5,
kGetInvertRefract = 6,
kSetInvertRefract = 7
};
anonymous enum [protected] |
{
DATA_CHUNK = 0x322
};
| ExposureMaterialControl | ( | ) | [inline] |
:
mNoExposure(false),
mInvertSelfIllum(false),
mInvertReflect(false),
mInvertRefract(false) {}
| BEGIN_FUNCTION_MAP PROP_FNS | ( | kGetNoExposureControl | , |
| GetNoExposure | , | ||
| kSetNoExposureControl | , | ||
| SetNoExposure | , | ||
| TYPE_BOOL | |||
| ) |
| PROP_FNS | ( | kGetInvertSelfIllum | , |
| GetInvertSelfIllum | , | ||
| kSetInvertSelfIllum | , | ||
| SetInvertSelfIllum | , | ||
| TYPE_BOOL | |||
| ) |
| PROP_FNS | ( | kGetInvertReflect | , |
| GetInvertReflect | , | ||
| kSetInvertReflect | , | ||
| SetInvertReflect | , | ||
| TYPE_BOOL | |||
| ) |
| PROP_FNS | ( | kGetInvertRefract | , |
| GetInvertRefract | , | ||
| kSetInvertRefract | , | ||
| SetInvertRefract | , | ||
| TYPE_BOOL | |||
| ) |
| END_FUNCTION_MAP BOOL GetNoExposure | ( | ) | const [inline] |
{ return mNoExposure; }
| virtual void SetNoExposure | ( | BOOL | on | ) | [inline, virtual] |
| on | - if true the material should have no exposure |
{ mNoExposure = on != 0; }
| BOOL GetInvertSelfIllum | ( | ) | const [inline] |
{ return mInvertSelfIllum; }
| virtual void SetInvertSelfIllum | ( | BOOL | on | ) | [inline, virtual] |
| on | - the new value of Invert Self Illumination property |
{ mInvertSelfIllum = on != 0; }
| BOOL GetInvertReflect | ( | ) | const [inline] |
{ return mInvertReflect; }
| virtual void SetInvertReflect | ( | BOOL | on | ) | [inline, virtual] |
| on | - the new state of the InvertReflect property |
{ mInvertReflect = on != 0; }
| BOOL GetInvertRefract | ( | ) | const [inline] |
{ return mInvertRefract; }
| virtual void SetInvertRefract | ( | BOOL | on | ) | [inline, virtual] |
| on | - the new state of the InvertReflect property |
{ mInvertRefract = on != 0; }
| ULONG isNoExposure | ( | ) | const [inline] |
{ return mNoExposure ? MTLREQ_NOEXPOSURE : 0; }
| bool isInvertSelfIllum | ( | ) | const [inline] |
{ return !mNoExposure & mInvertSelfIllum; }
| bool isInvertReflect | ( | ) | const [inline] |
{ return !mNoExposure & mInvertReflect; }
| bool isInvertRefract | ( | ) | const [inline] |
{ return !mNoExposure & mInvertRefract; }
MyMaterial::Save(ISave* isave) {
// Do my saving here
isave->BeginChunk(PARENT_DATA_CHUNK);
ExposureMaterialControl::Save(isave);
isave->EndChunk();
}
{
isave->BeginChunk(DATA_CHUNK);
IOResult res;
if ((res = write(isave, mNoExposure)) == IO_OK
&& (res = write(isave, mInvertSelfIllum)) == IO_OK
&& (res = write(isave, mInvertReflect)) == IO_OK)
res = write(isave, mInvertRefract);
isave->EndChunk();
return res;
}
MyMaterial::Load(ILoad* iload) {
IOResult res;
USHORT id;
while (IO_OK==(res=iload->OpenChunk())) {
switch(id = iload->CurChunkID()) {
// Any other data chunks need to go here too
case PARENT_DATA_CHUNK:
res = ExposureMaterialControl::Load(iload);
break;
}
iload->CloseChunk();
if (res!=IO_OK)
return res;
}
return IO_OK;
}
{
IOResult res;
USHORT id;
while (IO_OK==(res=iload->OpenChunk())) {
switch(id = iload->CurChunkID()) {
case DATA_CHUNK:
if ((res = read(iload, mNoExposure)) == IO_OK
&& (res = read(iload, mInvertSelfIllum)) == IO_OK
&& (res = read(iload, mInvertReflect)) == IO_OK)
res = read(iload, mInvertRefract);
break;
}
iload->CloseChunk();
if (res!=IO_OK)
return res;
}
return IO_OK;
}
bool
mNoExposure [protected] |
bool
mInvertSelfIllum [protected] |
bool
mInvertReflect [protected] |
bool
mInvertRefract [protected] |