XSLALumas
Attributes
-
ENGLISH NAME : LumasShader
-
NAME : XSLALumas
-
INCLUDE : Mpreview
-
INCLUDE : Xbase
-
PATH : sla/description/xslalumas.res
-
PLUGIN : sla
-
MAXON online help (may not exist): XSLALUMAS
Elements
Example Code
The following code does not use the correct values when setting the data. You should check directly in C4D for the correct values that you should use in place of the ones that are shown.
This code is just to show you how to access the values for getting and setting the parameters.
Python
import c4d
from c4d import gui
def main():
shader = c4d.BaseShader(c4d.Xlumas)
#You can set parameters two different ways.
#First way
shader[c4d.SLA_LUMAS_DIFFUSE_ACTIVE] = True
shader[c4d.SLA_LUMAS_DIFFUSE_ALGORITHM] = c4d.SLA_LUMAS_DIFFUSE_ALGO_INTERNAL
shader[c4d.SLA_LUMAS_DIFFUSE_ROUGHNESS] = 0.1
shader[c4d.SLA_LUMAS_DIFFUSE_ILLUMINATION] = 0.1
shader[c4d.SLA_LUMAS_DIFFUSE_CONTRAST] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR1_ACTIVE] = True
shader[c4d.SLA_LUMAS_SPECULAR1_INTENSITY] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR1_SIZE] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR1_CONTRAST] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR1_GLARE] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR1_FALLOFF] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR2_ACTIVE] = True
shader[c4d.SLA_LUMAS_SPECULAR2_INTENSITY] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR2_SIZE] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR2_CONTRAST] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR2_GLARE] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR2_FALLOFF] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR3_ACTIVE] = True
shader[c4d.SLA_LUMAS_SPECULAR3_INTENSITY] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR3_SIZE] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR3_CONTRAST] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR3_GLARE] = 0.1
shader[c4d.SLA_LUMAS_SPECULAR3_FALLOFF] = 0.1
shader[c4d.SLA_LUMAS_ANISO_ACTIVE] = True
shader[c4d.SLA_LUMAS_ANISO_PROJECTION] = c4d.SLA_LUMAS_ANISO_PROJECTION_PLANAR
shader[c4d.SLA_LUMAS_ANISO_PROJ_SCALE] = 0.1
shader[c4d.SLA_LUMAS_ANISO_X_ROUGH] = 0.1
shader[c4d.SLA_LUMAS_ANISO_Y_ROUGH] = 0.1
shader[c4d.SLA_LUMAS_ANISO_SPEC_CHANNEL_SPEC1] = True
shader[c4d.SLA_LUMAS_ANISO_SPEC_CHANNEL_SPEC2] = True
shader[c4d.SLA_LUMAS_ANISO_SPEC_CHANNEL_SPEC3] = True
shader[c4d.SLA_LUMAS_ANISO_AMPLITUDE] = 0.1
shader[c4d.SLA_LUMAS_ANISO_SCALE] = 0.1
shader[c4d.SLA_LUMAS_ANISO_LENGTH] = 0.1
shader[c4d.SLA_LUMAS_ANISO_ATTENUATION] = 0.1
shader[c4d.SLA_LUMAS_ANISO_SCRATCH_CHANNEL_SPEC1] = True
shader[c4d.SLA_LUMAS_ANISO_SCRATCH_CHANNEL_SPEC2] = True
shader[c4d.SLA_LUMAS_ANISO_SCRATCH_CHANNEL_SPEC3] = True
#Second way, using the base container.
bc = shader.GetDataInstance()
bc.SetBool(c4d.SLA_LUMAS_DIFFUSE_ACTIVE,True)
bc.SetInt32(c4d.SLA_LUMAS_DIFFUSE_ALGORITHM,c4d.SLA_LUMAS_DIFFUSE_ALGO_INTERNAL)
bc.SetFloat(c4d.SLA_LUMAS_DIFFUSE_ROUGHNESS,0.1)
bc.SetFloat(c4d.SLA_LUMAS_DIFFUSE_ILLUMINATION,0.1)
bc.SetFloat(c4d.SLA_LUMAS_DIFFUSE_CONTRAST,0.1)
bc.SetBool(c4d.SLA_LUMAS_SPECULAR1_ACTIVE,True)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR1_INTENSITY,0.1)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR1_SIZE,0.1)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR1_CONTRAST,0.1)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR1_GLARE,0.1)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR1_FALLOFF,0.1)
bc.SetBool(c4d.SLA_LUMAS_SPECULAR2_ACTIVE,True)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR2_INTENSITY,0.1)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR2_SIZE,0.1)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR2_CONTRAST,0.1)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR2_GLARE,0.1)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR2_FALLOFF,0.1)
bc.SetBool(c4d.SLA_LUMAS_SPECULAR3_ACTIVE,True)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR3_INTENSITY,0.1)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR3_SIZE,0.1)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR3_CONTRAST,0.1)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR3_GLARE,0.1)
bc.SetFloat(c4d.SLA_LUMAS_SPECULAR3_FALLOFF,0.1)
bc.SetBool(c4d.SLA_LUMAS_ANISO_ACTIVE,True)
bc.SetInt32(c4d.SLA_LUMAS_ANISO_PROJECTION,c4d.SLA_LUMAS_ANISO_PROJECTION_PLANAR)
bc.SetFloat(c4d.SLA_LUMAS_ANISO_PROJ_SCALE,0.1)
bc.SetFloat(c4d.SLA_LUMAS_ANISO_X_ROUGH,0.1)
bc.SetFloat(c4d.SLA_LUMAS_ANISO_Y_ROUGH,0.1)
bc.SetBool(c4d.SLA_LUMAS_ANISO_SPEC_CHANNEL_SPEC1,True)
bc.SetBool(c4d.SLA_LUMAS_ANISO_SPEC_CHANNEL_SPEC2,True)
bc.SetBool(c4d.SLA_LUMAS_ANISO_SPEC_CHANNEL_SPEC3,True)
bc.SetFloat(c4d.SLA_LUMAS_ANISO_AMPLITUDE,0.1)
bc.SetFloat(c4d.SLA_LUMAS_ANISO_SCALE,0.1)
bc.SetFloat(c4d.SLA_LUMAS_ANISO_LENGTH,0.1)
bc.SetFloat(c4d.SLA_LUMAS_ANISO_ATTENUATION,0.1)
bc.SetBool(c4d.SLA_LUMAS_ANISO_SCRATCH_CHANNEL_SPEC1,True)
bc.SetBool(c4d.SLA_LUMAS_ANISO_SCRATCH_CHANNEL_SPEC2,True)
bc.SetBool(c4d.SLA_LUMAS_ANISO_SCRATCH_CHANNEL_SPEC3,True)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../sla/description/xslalumas.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseShader *pShader = BaseShader::Alloc(Xlumas);
//You can set parameters two different ways.
//First way
//Some objects do not store all their data in the container. You need to use GetParameter()/SetParameter() instead.
DESCFLAGS_SET flags = DESCFLAGS_SET_PARAM_SET;
pShader->SetParameter(DescID(SLA_LUMAS_DIFFUSE_ACTIVE),GeData(true),flags);
pShader->SetParameter(DescID(SLA_LUMAS_DIFFUSE_ALGORITHM),GeData(SLA_LUMAS_DIFFUSE_ALGO_INTERNAL),flags);
pShader->SetParameter(DescID(SLA_LUMAS_DIFFUSE_ROUGHNESS),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_DIFFUSE_ILLUMINATION),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_DIFFUSE_CONTRAST),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR1_ACTIVE),GeData(true),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR1_INTENSITY),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR1_SIZE),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR1_CONTRAST),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR1_GLARE),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR1_FALLOFF),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR2_ACTIVE),GeData(true),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR2_INTENSITY),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR2_SIZE),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR2_CONTRAST),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR2_GLARE),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR2_FALLOFF),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR3_ACTIVE),GeData(true),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR3_INTENSITY),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR3_SIZE),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR3_CONTRAST),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR3_GLARE),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_SPECULAR3_FALLOFF),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_ACTIVE),GeData(true),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_PROJECTION),GeData(SLA_LUMAS_ANISO_PROJECTION_PLANAR),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_PROJ_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_X_ROUGH),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_Y_ROUGH),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_SPEC_CHANNEL_SPEC1),GeData(true),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_SPEC_CHANNEL_SPEC2),GeData(true),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_SPEC_CHANNEL_SPEC3),GeData(true),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_AMPLITUDE),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_LENGTH),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_ATTENUATION),GeData(0.1),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_SCRATCH_CHANNEL_SPEC1),GeData(true),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_SCRATCH_CHANNEL_SPEC2),GeData(true),flags);
pShader->SetParameter(DescID(SLA_LUMAS_ANISO_SCRATCH_CHANNEL_SPEC3),GeData(true),flags);
pShader->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pShader->GetDataInstance();
bc->SetBool(SLA_LUMAS_DIFFUSE_ACTIVE,true);
bc->SetInt32(SLA_LUMAS_DIFFUSE_ALGORITHM,SLA_LUMAS_DIFFUSE_ALGO_INTERNAL);
bc->SetFloat(SLA_LUMAS_DIFFUSE_ROUGHNESS,0.1);
bc->SetFloat(SLA_LUMAS_DIFFUSE_ILLUMINATION,0.1);
bc->SetFloat(SLA_LUMAS_DIFFUSE_CONTRAST,0.1);
bc->SetBool(SLA_LUMAS_SPECULAR1_ACTIVE,true);
bc->SetFloat(SLA_LUMAS_SPECULAR1_INTENSITY,0.1);
bc->SetFloat(SLA_LUMAS_SPECULAR1_SIZE,0.1);
bc->SetFloat(SLA_LUMAS_SPECULAR1_CONTRAST,0.1);
bc->SetFloat(SLA_LUMAS_SPECULAR1_GLARE,0.1);
bc->SetFloat(SLA_LUMAS_SPECULAR1_FALLOFF,0.1);
bc->SetBool(SLA_LUMAS_SPECULAR2_ACTIVE,true);
bc->SetFloat(SLA_LUMAS_SPECULAR2_INTENSITY,0.1);
bc->SetFloat(SLA_LUMAS_SPECULAR2_SIZE,0.1);
bc->SetFloat(SLA_LUMAS_SPECULAR2_CONTRAST,0.1);
bc->SetFloat(SLA_LUMAS_SPECULAR2_GLARE,0.1);
bc->SetFloat(SLA_LUMAS_SPECULAR2_FALLOFF,0.1);
bc->SetBool(SLA_LUMAS_SPECULAR3_ACTIVE,true);
bc->SetFloat(SLA_LUMAS_SPECULAR3_INTENSITY,0.1);
bc->SetFloat(SLA_LUMAS_SPECULAR3_SIZE,0.1);
bc->SetFloat(SLA_LUMAS_SPECULAR3_CONTRAST,0.1);
bc->SetFloat(SLA_LUMAS_SPECULAR3_GLARE,0.1);
bc->SetFloat(SLA_LUMAS_SPECULAR3_FALLOFF,0.1);
bc->SetBool(SLA_LUMAS_ANISO_ACTIVE,true);
bc->SetInt32(SLA_LUMAS_ANISO_PROJECTION,SLA_LUMAS_ANISO_PROJECTION_PLANAR);
bc->SetFloat(SLA_LUMAS_ANISO_PROJ_SCALE,0.1);
bc->SetFloat(SLA_LUMAS_ANISO_X_ROUGH,0.1);
bc->SetFloat(SLA_LUMAS_ANISO_Y_ROUGH,0.1);
bc->SetBool(SLA_LUMAS_ANISO_SPEC_CHANNEL_SPEC1,true);
bc->SetBool(SLA_LUMAS_ANISO_SPEC_CHANNEL_SPEC2,true);
bc->SetBool(SLA_LUMAS_ANISO_SPEC_CHANNEL_SPEC3,true);
bc->SetFloat(SLA_LUMAS_ANISO_AMPLITUDE,0.1);
bc->SetFloat(SLA_LUMAS_ANISO_SCALE,0.1);
bc->SetFloat(SLA_LUMAS_ANISO_LENGTH,0.1);
bc->SetFloat(SLA_LUMAS_ANISO_ATTENUATION,0.1);
bc->SetBool(SLA_LUMAS_ANISO_SCRATCH_CHANNEL_SPEC1,true);
bc->SetBool(SLA_LUMAS_ANISO_SCRATCH_CHANNEL_SPEC2,true);
bc->SetBool(SLA_LUMAS_ANISO_SCRATCH_CHANNEL_SPEC3,true);
pShader->Message(MSG_UPDATE);
}