xbrick
Attributes
-
ENGLISH NAME : Brick
-
NAME : xbrick
-
INCLUDE : Mpreview
-
INCLUDE : Xbase
-
PATH : shader/description/xbrick.res
-
PLUGIN : shader
-
MAXON online help (may not exist): XBRICK
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.Xbrick)
#You can set parameters two different ways.
#First way
shader[c4d.BRICK_SCALE] = 0.1
shader[c4d.BRICK_WIDTH] = 0.1
shader[c4d.BRICK_HEIGHT] = 0.1
shader[c4d.BRICK_SHIFT] = 0.1
shader[c4d.BRICK_SHIFT_RESET] = 1
shader[c4d.BRICK_HALFWIDTH] = 1
shader[c4d.BRICK_HALFWIDTH_SHIFT] = 0.1
shader[c4d.BRICK_ALTCOL_BALANCE_HPERIOD] = True
shader[c4d.BRICK_DISPLACEMENTMODE_ENABLE] = True
shader[c4d.BRICK_DISPLACEMENTMODE_RANDOM_HEIGHT] = 0.1
shader[c4d.BRICK_DISPLACEMENTMODE_RANDOM_SLOPE] = 0.1
shader[c4d.BRICK_DISPLACEMENTMODE_SLOPE_MODE] = c4d.BRICK_DISPLACEMENTMODE_MODE_SLOPE_RANDOM
shader[c4d.BRICK_DISPLACEMENTMODE_SEED] = 1
shader[c4d.BRICK_TEX_OFFSET] = 0.1
shader[c4d.BRICK_TEX_OFFSET_RANDOM] = True
shader[c4d.BRICK_TEX_SCALE] = 0.1
shader[c4d.BRICK_TEX_FLIP] = True
shader[c4d.BRICK_TEX_OPACITY] = 0.1
shader[c4d.BRICK_TEX_BLENDMODE] = c4d.BRICK_BLENDMODE_NORMAL
shader[c4d.BRICK_ALTTEX_OFFSET] = 0.1
shader[c4d.BRICK_ALTTEX_OFFSET_RANDOM] = True
shader[c4d.BRICK_ALTTEX_SCALE] = 0.1
shader[c4d.BRICK_ALTTEX_FLIP] = True
shader[c4d.BRICK_ALTTEX_OPACITY] = 0.1
shader[c4d.BRICK_ALTTEX_BLENDMODE] = c4d.BRICK_BLENDMODE_NORMAL
shader[c4d.BRICK_ALTCOL_VPERIOD] = 1
shader[c4d.BRICK_ALTCOL_HPERIOD] = 1
shader[c4d.BRICK_COL_NOISE_SCALE] = 0.1
shader[c4d.BRICK_COL_DETAILS_INTENSITY] = 0.1
shader[c4d.BRICK_COL_DETAILS_SCALE] = 0.1
shader[c4d.BRICK_GAPTEX_SCALE] = 0.1
shader[c4d.BRICK_GAPTEX_FLIP] = True
shader[c4d.BRICK_GAPTEX_OPACITY] = 0.1
shader[c4d.BRICK_GAPTEX_BLENDMODE] = c4d.BRICK_BLENDMODE_NORMAL
shader[c4d.BRICK_GAPCOL_NOISE_SCALE] = 0.1
shader[c4d.BRICK_DEPTH] = 0.1
shader[c4d.BRICK_GAPSIZE] = 0.1
shader[c4d.BRICK_GAPNOTCH] = 0.1
shader[c4d.BRICK_NOISE_INTENSITY] = 0.1
shader[c4d.BRICK_NOISE_SCALE] = 0.1
shader[c4d.BRICK_DIRT_ENABLE] = True
shader[c4d.BRICK_DIRT_ENABLE_BRICK] = True
shader[c4d.BRICK_DIRT_ENABLE_GAP] = True
shader[c4d.BRICK_DIRT_OPACITY] = 0.1
shader[c4d.BRICK_DIRT_GAP_BLEND] = 0.1
shader[c4d.BRICK_DIRT_BRICK_BLEND] = 0.1
shader[c4d.BRICK_DIRT_COL_SCALE] = 0.1
shader[c4d.BRICK_DIRT_ALPHA_SHIFT] = c4d.Vector(1.0,1.0,1.0)
shader[c4d.BRICK_DIRT_ALPHA_SCALE] = 0.1
shader[c4d.BRICK_DIRT_ALPHA_OCT] = 0.1
shader[c4d.BRICK_DIRTTEX_SHIFT] = c4d.Vector(1.0,1.0,1.0)
shader[c4d.BRICK_DIRTTEX_SCALE] = 0.1
shader[c4d.BRICK_DIRTTEX_FLIP] = True
shader[c4d.BRICK_DIRTTEX_MULTIPLYCOLOR] = True
shader[c4d.BRICK_DIRTTEX_ALPHA_INVERT] = True
shader[c4d.BRICK_DIRTTEX_ALPHA_CONTRAST] = 0.1
shader[c4d.BRICK_DIRTTEX_ALPHA_BIAS] = 0.1
shader[c4d.BRICK_DIRTTEX_RAIN] = 0.1
shader[c4d.BRICK_DIRTTEX_RAIN_SAMPLES] = 1
shader[c4d.BRICK_DIRTTEX_RAIN_DOCOLOR] = True
#Second way, using the base container.
bc = shader.GetDataInstance()
bc.SetFloat(c4d.BRICK_SCALE,0.1)
bc.SetFloat(c4d.BRICK_WIDTH,0.1)
bc.SetFloat(c4d.BRICK_HEIGHT,0.1)
bc.SetFloat(c4d.BRICK_SHIFT,0.1)
bc.SetInt32(c4d.BRICK_SHIFT_RESET,1)
bc.SetInt32(c4d.BRICK_HALFWIDTH,1)
bc.SetFloat(c4d.BRICK_HALFWIDTH_SHIFT,0.1)
bc.SetBool(c4d.BRICK_ALTCOL_BALANCE_HPERIOD,True)
bc.SetBool(c4d.BRICK_DISPLACEMENTMODE_ENABLE,True)
bc.SetFloat(c4d.BRICK_DISPLACEMENTMODE_RANDOM_HEIGHT,0.1)
bc.SetFloat(c4d.BRICK_DISPLACEMENTMODE_RANDOM_SLOPE,0.1)
bc.SetInt32(c4d.BRICK_DISPLACEMENTMODE_SLOPE_MODE,c4d.BRICK_DISPLACEMENTMODE_MODE_SLOPE_RANDOM)
bc.SetInt32(c4d.BRICK_DISPLACEMENTMODE_SEED,1)
bc.SetFloat(c4d.BRICK_TEX_OFFSET,0.1)
bc.SetBool(c4d.BRICK_TEX_OFFSET_RANDOM,True)
bc.SetFloat(c4d.BRICK_TEX_SCALE,0.1)
bc.SetBool(c4d.BRICK_TEX_FLIP,True)
bc.SetFloat(c4d.BRICK_TEX_OPACITY,0.1)
bc.SetInt32(c4d.BRICK_TEX_BLENDMODE,c4d.BRICK_BLENDMODE_NORMAL)
bc.SetFloat(c4d.BRICK_ALTTEX_OFFSET,0.1)
bc.SetBool(c4d.BRICK_ALTTEX_OFFSET_RANDOM,True)
bc.SetFloat(c4d.BRICK_ALTTEX_SCALE,0.1)
bc.SetBool(c4d.BRICK_ALTTEX_FLIP,True)
bc.SetFloat(c4d.BRICK_ALTTEX_OPACITY,0.1)
bc.SetInt32(c4d.BRICK_ALTTEX_BLENDMODE,c4d.BRICK_BLENDMODE_NORMAL)
bc.SetInt32(c4d.BRICK_ALTCOL_VPERIOD,1)
bc.SetInt32(c4d.BRICK_ALTCOL_HPERIOD,1)
bc.SetFloat(c4d.BRICK_COL_NOISE_SCALE,0.1)
bc.SetFloat(c4d.BRICK_COL_DETAILS_INTENSITY,0.1)
bc.SetFloat(c4d.BRICK_COL_DETAILS_SCALE,0.1)
bc.SetFloat(c4d.BRICK_GAPTEX_SCALE,0.1)
bc.SetBool(c4d.BRICK_GAPTEX_FLIP,True)
bc.SetFloat(c4d.BRICK_GAPTEX_OPACITY,0.1)
bc.SetInt32(c4d.BRICK_GAPTEX_BLENDMODE,c4d.BRICK_BLENDMODE_NORMAL)
bc.SetFloat(c4d.BRICK_GAPCOL_NOISE_SCALE,0.1)
bc.SetFloat(c4d.BRICK_DEPTH,0.1)
bc.SetFloat(c4d.BRICK_GAPSIZE,0.1)
bc.SetFloat(c4d.BRICK_GAPNOTCH,0.1)
bc.SetFloat(c4d.BRICK_NOISE_INTENSITY,0.1)
bc.SetFloat(c4d.BRICK_NOISE_SCALE,0.1)
bc.SetBool(c4d.BRICK_DIRT_ENABLE,True)
bc.SetBool(c4d.BRICK_DIRT_ENABLE_BRICK,True)
bc.SetBool(c4d.BRICK_DIRT_ENABLE_GAP,True)
bc.SetFloat(c4d.BRICK_DIRT_OPACITY,0.1)
bc.SetFloat(c4d.BRICK_DIRT_GAP_BLEND,0.1)
bc.SetFloat(c4d.BRICK_DIRT_BRICK_BLEND,0.1)
bc.SetFloat(c4d.BRICK_DIRT_COL_SCALE,0.1)
bc.SetVector(c4d.BRICK_DIRT_ALPHA_SHIFT, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.BRICK_DIRT_ALPHA_SCALE,0.1)
bc.SetFloat(c4d.BRICK_DIRT_ALPHA_OCT,0.1)
bc.SetVector(c4d.BRICK_DIRTTEX_SHIFT, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.BRICK_DIRTTEX_SCALE,0.1)
bc.SetBool(c4d.BRICK_DIRTTEX_FLIP,True)
bc.SetBool(c4d.BRICK_DIRTTEX_MULTIPLYCOLOR,True)
bc.SetBool(c4d.BRICK_DIRTTEX_ALPHA_INVERT,True)
bc.SetFloat(c4d.BRICK_DIRTTEX_ALPHA_CONTRAST,0.1)
bc.SetFloat(c4d.BRICK_DIRTTEX_ALPHA_BIAS,0.1)
bc.SetFloat(c4d.BRICK_DIRTTEX_RAIN,0.1)
bc.SetInt32(c4d.BRICK_DIRTTEX_RAIN_SAMPLES,1)
bc.SetBool(c4d.BRICK_DIRTTEX_RAIN_DOCOLOR,True)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../shader/description/xbrick.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseShader *pShader = BaseShader::Alloc(Xbrick);
//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(BRICK_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_WIDTH),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_HEIGHT),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_SHIFT),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_SHIFT_RESET),GeData(1),flags);
pShader->SetParameter(DescID(BRICK_HALFWIDTH),GeData(1),flags);
pShader->SetParameter(DescID(BRICK_HALFWIDTH_SHIFT),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_ALTCOL_BALANCE_HPERIOD),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_DISPLACEMENTMODE_ENABLE),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_DISPLACEMENTMODE_RANDOM_HEIGHT),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DISPLACEMENTMODE_RANDOM_SLOPE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DISPLACEMENTMODE_SLOPE_MODE),GeData(BRICK_DISPLACEMENTMODE_MODE_SLOPE_RANDOM),flags);
pShader->SetParameter(DescID(BRICK_DISPLACEMENTMODE_SEED),GeData(1),flags);
pShader->SetParameter(DescID(BRICK_TEX_OFFSET),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_TEX_OFFSET_RANDOM),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_TEX_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_TEX_FLIP),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_TEX_OPACITY),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_TEX_BLENDMODE),GeData(BRICK_BLENDMODE_NORMAL),flags);
pShader->SetParameter(DescID(BRICK_ALTTEX_OFFSET),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_ALTTEX_OFFSET_RANDOM),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_ALTTEX_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_ALTTEX_FLIP),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_ALTTEX_OPACITY),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_ALTTEX_BLENDMODE),GeData(BRICK_BLENDMODE_NORMAL),flags);
pShader->SetParameter(DescID(BRICK_ALTCOL_VPERIOD),GeData(1),flags);
pShader->SetParameter(DescID(BRICK_ALTCOL_HPERIOD),GeData(1),flags);
pShader->SetParameter(DescID(BRICK_COL_NOISE_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_COL_DETAILS_INTENSITY),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_COL_DETAILS_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_GAPTEX_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_GAPTEX_FLIP),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_GAPTEX_OPACITY),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_GAPTEX_BLENDMODE),GeData(BRICK_BLENDMODE_NORMAL),flags);
pShader->SetParameter(DescID(BRICK_GAPCOL_NOISE_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DEPTH),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_GAPSIZE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_GAPNOTCH),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_NOISE_INTENSITY),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_NOISE_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DIRT_ENABLE),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_DIRT_ENABLE_BRICK),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_DIRT_ENABLE_GAP),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_DIRT_OPACITY),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DIRT_GAP_BLEND),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DIRT_BRICK_BLEND),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DIRT_COL_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DIRT_ALPHA_SHIFT),GeData(Vector(1.0,1.0,1.0)),flags);
pShader->SetParameter(DescID(BRICK_DIRT_ALPHA_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DIRT_ALPHA_OCT),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DIRTTEX_SHIFT),GeData(Vector(1.0,1.0,1.0)),flags);
pShader->SetParameter(DescID(BRICK_DIRTTEX_SCALE),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DIRTTEX_FLIP),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_DIRTTEX_MULTIPLYCOLOR),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_DIRTTEX_ALPHA_INVERT),GeData(true),flags);
pShader->SetParameter(DescID(BRICK_DIRTTEX_ALPHA_CONTRAST),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DIRTTEX_ALPHA_BIAS),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DIRTTEX_RAIN),GeData(0.1),flags);
pShader->SetParameter(DescID(BRICK_DIRTTEX_RAIN_SAMPLES),GeData(1),flags);
pShader->SetParameter(DescID(BRICK_DIRTTEX_RAIN_DOCOLOR),GeData(true),flags);
pShader->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pShader->GetDataInstance();
bc->SetFloat(BRICK_SCALE,0.1);
bc->SetFloat(BRICK_WIDTH,0.1);
bc->SetFloat(BRICK_HEIGHT,0.1);
bc->SetFloat(BRICK_SHIFT,0.1);
bc->SetInt32(BRICK_SHIFT_RESET,1);
bc->SetInt32(BRICK_HALFWIDTH,1);
bc->SetFloat(BRICK_HALFWIDTH_SHIFT,0.1);
bc->SetBool(BRICK_ALTCOL_BALANCE_HPERIOD,true);
bc->SetBool(BRICK_DISPLACEMENTMODE_ENABLE,true);
bc->SetFloat(BRICK_DISPLACEMENTMODE_RANDOM_HEIGHT,0.1);
bc->SetFloat(BRICK_DISPLACEMENTMODE_RANDOM_SLOPE,0.1);
bc->SetInt32(BRICK_DISPLACEMENTMODE_SLOPE_MODE,BRICK_DISPLACEMENTMODE_MODE_SLOPE_RANDOM);
bc->SetInt32(BRICK_DISPLACEMENTMODE_SEED,1);
bc->SetFloat(BRICK_TEX_OFFSET,0.1);
bc->SetBool(BRICK_TEX_OFFSET_RANDOM,true);
bc->SetFloat(BRICK_TEX_SCALE,0.1);
bc->SetBool(BRICK_TEX_FLIP,true);
bc->SetFloat(BRICK_TEX_OPACITY,0.1);
bc->SetInt32(BRICK_TEX_BLENDMODE,BRICK_BLENDMODE_NORMAL);
bc->SetFloat(BRICK_ALTTEX_OFFSET,0.1);
bc->SetBool(BRICK_ALTTEX_OFFSET_RANDOM,true);
bc->SetFloat(BRICK_ALTTEX_SCALE,0.1);
bc->SetBool(BRICK_ALTTEX_FLIP,true);
bc->SetFloat(BRICK_ALTTEX_OPACITY,0.1);
bc->SetInt32(BRICK_ALTTEX_BLENDMODE,BRICK_BLENDMODE_NORMAL);
bc->SetInt32(BRICK_ALTCOL_VPERIOD,1);
bc->SetInt32(BRICK_ALTCOL_HPERIOD,1);
bc->SetFloat(BRICK_COL_NOISE_SCALE,0.1);
bc->SetFloat(BRICK_COL_DETAILS_INTENSITY,0.1);
bc->SetFloat(BRICK_COL_DETAILS_SCALE,0.1);
bc->SetFloat(BRICK_GAPTEX_SCALE,0.1);
bc->SetBool(BRICK_GAPTEX_FLIP,true);
bc->SetFloat(BRICK_GAPTEX_OPACITY,0.1);
bc->SetInt32(BRICK_GAPTEX_BLENDMODE,BRICK_BLENDMODE_NORMAL);
bc->SetFloat(BRICK_GAPCOL_NOISE_SCALE,0.1);
bc->SetFloat(BRICK_DEPTH,0.1);
bc->SetFloat(BRICK_GAPSIZE,0.1);
bc->SetFloat(BRICK_GAPNOTCH,0.1);
bc->SetFloat(BRICK_NOISE_INTENSITY,0.1);
bc->SetFloat(BRICK_NOISE_SCALE,0.1);
bc->SetBool(BRICK_DIRT_ENABLE,true);
bc->SetBool(BRICK_DIRT_ENABLE_BRICK,true);
bc->SetBool(BRICK_DIRT_ENABLE_GAP,true);
bc->SetFloat(BRICK_DIRT_OPACITY,0.1);
bc->SetFloat(BRICK_DIRT_GAP_BLEND,0.1);
bc->SetFloat(BRICK_DIRT_BRICK_BLEND,0.1);
bc->SetFloat(BRICK_DIRT_COL_SCALE,0.1);
bc->SetVector(BRICK_DIRT_ALPHA_SHIFT, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(BRICK_DIRT_ALPHA_SCALE,0.1);
bc->SetFloat(BRICK_DIRT_ALPHA_OCT,0.1);
bc->SetVector(BRICK_DIRTTEX_SHIFT, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(BRICK_DIRTTEX_SCALE,0.1);
bc->SetBool(BRICK_DIRTTEX_FLIP,true);
bc->SetBool(BRICK_DIRTTEX_MULTIPLYCOLOR,true);
bc->SetBool(BRICK_DIRTTEX_ALPHA_INVERT,true);
bc->SetFloat(BRICK_DIRTTEX_ALPHA_CONTRAST,0.1);
bc->SetFloat(BRICK_DIRTTEX_ALPHA_BIAS,0.1);
bc->SetFloat(BRICK_DIRTTEX_RAIN,0.1);
bc->SetInt32(BRICK_DIRTTEX_RAIN_SAMPLES,1);
bc->SetBool(BRICK_DIRTTEX_RAIN_DOCOLOR,true);
pShader->Message(MSG_UPDATE);
}
Gradients
This node has gradients. Gradients can manually be edited by calling the following code
Python
C++
#include "customgui_gradient.h"
BRICK_COL
GeData data;
pShader->GetParameter(DescID(BRICK_COL),data,DESCFLAGS_GET_PARAM_GET));
Gradient *pGradient = (Gradient*)data.GetCustomDataType(CUSTOMDATATYPE_GRADIENT);
if(pGradient)
{
//must be set before any knot is set
pGradient->SetData(GRADIENT_MODE, GeData(GRADIENTMODE_ALPHA));
GradientKnot k1, k2;
k1.col = Vector(0.0, 0.0, 1.0);
k1.pos = 0.0;
k2.col = 1.0;
k2.pos = 1.0;
pGradient->InsertKnot(k1);
pGradient->InsertKnot(k2);
}
pShader->SetParameter(DescID(BRICK_COL),data,DESCFLAGS_SET_PARAM_SET));
BRICK_ALTCOL
pShader->GetParameter(DescID(BRICK_ALTCOL),data,DESCFLAGS_GET_PARAM_GET));
BRICK_GAPCOL
pShader->GetParameter(DescID(BRICK_GAPCOL),data,DESCFLAGS_GET_PARAM_GET));
BRICK_DIRT_COL
pShader->GetParameter(DescID(BRICK_DIRT_COL),data,DESCFLAGS_GET_PARAM_GET));