THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/11/2010 at 10:28, xxxxxxxx wrote:
Frankly, it's been several years since I worked through this issue, so my memory on the subject is a little iffy :) ... but what I am basically doing is some of:
if( pBaseMat->GetChannelState(CHANNEL_COLOR) )
{
pChannel = pBaseMat->GetChannel(CHANNEL_COLOR);
bc = pChannel->GetData();
preset = Vector(1.0, 1.0, 1.0);
vVal = bc.GetVector(BASECHANNEL_COLOR_EX, preset);
rBright = bc.GetReal(BASECHANNEL_BRIGHTNESS_EX, 1.0);
pMat->diffuse[0] = vVal.x * rBright;
pMat->diffuse[1] = vVal.y * rBright;
pMat->diffuse[2] = vVal.z * rBright;
txName = bc.GetString(BASECHANNEL_TEXTURE);
cmpGetCString7(txName, pMat->szMap_Kd, MAX_MAPNAME_LEN);
pMat->kd = true;
}
...and similar code for other channels (transparency, luminance, etc). Somewhere in the mix of all that is an issue - if it's a Plugin material, or a Banzi/Banji type shader (they don't have those channels).
EDIT: Hmm... actually, I was casting it to a Material* (not BaseMaterial), so that's probably where the issue was. It's only a " Material " if the type is Mmaterial (GetChannelState() is a member of the Material class).