Mxpgas
Attributes
-
ENGLISH NAME : X-ParticlesGaseousMaterial
-
NAME : Mxpgas
-
INCLUDE : Mpreview
-
INCLUDE : Mbase
-
INCLUDE : Massign
-
PATH : res/description/mxpgas.res
-
PLUGIN : X-Particles
-
MAXON online help (may not exist): MXPGAS
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():
material = c4d.BaseMaterial(c4d.Mxpgas)
#You can set parameters two different ways.
#First way
material[c4d.ID_XVOLGAS_SMOKE_MAT_GROUP] = True
material[c4d.ID_XVOLGAS_FIRE_MAT_GROUP] = True
material[c4d.ID_XVOLGAS_STEP] = 0.1
material[c4d.ID_XVOLGAS_SHADOW_STEP] = 0.1
material[c4d.ID_XVOLGAS_VOXELS] = c4d.ID_XVOLGAS_VOXELS_FAST
material[c4d.ID_XVOLGAS_SMOOTHING] = 0.1
material[c4d.ID_XVOLGAS_AUTOSIZE] = True
material[c4d.ID_XVOLGAS_VOXELSIZE] = 0.1
material[c4d.ID_XVOLGAS_SMOKE_CHANNEL] = c4d.ID_XVOLGAS_CHANNEL_NONE
material[c4d.ID_XVOLGAS_SMOKE_MIN] = 0.1
material[c4d.ID_XVOLGAS_SMOKE_MAX] = 0.1
material[c4d.ID_XVOLGAS_SMOKE_ILLUM] = c4d.ID_XVOLGAS_SMOKE_ILLUM_ISO
material[c4d.ID_XVOLGAS_SMOKE_ECCENTRICITY] = 0.1
material[c4d.ID_XVOLGAS_SMOKE_BACKSCATTER] = 0.1
material[c4d.ID_XVOLGAS_SMOKE_OPACITY] = 0.1
material[c4d.ID_XVOLGAS_SMOKE_LUMINANCE] = 0.1
material[c4d.ID_XVOLGAS_SMOKE_CONTRAST] = 0.1
material[c4d.ID_XVOLGAS_SMOKE_GAMMA] = 0.1
material[c4d.ID_XVOLGAS_SMOKE_CASTSHADOW] = 0.1
material[c4d.ID_XVOLGAS_SMOKE_RECSHADOW] = 0.1
material[c4d.ID_XVOLGAS_FIRE_CHANNEL] = c4d.ID_XVOLGAS_CHANNEL_NONE
material[c4d.ID_XVOLGAS_FIRE_MIN] = 0.1
material[c4d.ID_XVOLGAS_FIRE_MAX] = 0.1
material[c4d.ID_XVOLGAS_FIRE_TEMP_CHANNEL] = c4d.ID_XVOLGAS_CHANNEL_NONE
material[c4d.ID_XVOLGAS_TEMP_MIN] = 0.1
material[c4d.ID_XVOLGAS_TEMP_MAX] = 0.1
material[c4d.ID_XVOLGAS_FIRE_BLACKBODY] = True
material[c4d.ID_XVOLGAS_FIRE_BLACKBODY_MAP] = c4d.ID_XVOLGAS_FIRE_BLACKBODY_MAP_NTSC
material[c4d.ID_XVOLGAS_TEMP_MAP_MIN] = 0.1
material[c4d.ID_XVOLGAS_TEMP_MAP_MAX] = 0.1
material[c4d.ID_XVOLGAS_FIRE_POWER] = 0.1
material[c4d.ID_XVOLGAS_FIRE_WHITEPOINT] = 0.1
material[c4d.ID_XVOLGAS_FIRE_OPACITY] = 0.1
material[c4d.ID_XVOLGAS_FIRE_LUMINANCE] = 0.1
material[c4d.ID_XVOLGAS_FIRE_CONTRAST] = 0.1
material[c4d.ID_XVOLGAS_FIRE_GAMMA] = 0.1
material[c4d.ID_XVOLGAS_FIRE_R] = 0.1
material[c4d.ID_XVOLGAS_FIRE_G] = 0.1
material[c4d.ID_XVOLGAS_FIRE_B] = 0.1
material[c4d.ID_XVOLGAS_FIRE_SHADOW] = 0.1
#Second way, using the base container.
bc = material.GetDataInstance()
bc.SetBool(c4d.ID_XVOLGAS_SMOKE_MAT_GROUP,True)
bc.SetBool(c4d.ID_XVOLGAS_FIRE_MAT_GROUP,True)
bc.SetFloat(c4d.ID_XVOLGAS_STEP,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_SHADOW_STEP,0.1)
bc.SetInt32(c4d.ID_XVOLGAS_VOXELS,c4d.ID_XVOLGAS_VOXELS_FAST)
bc.SetFloat(c4d.ID_XVOLGAS_SMOOTHING,0.1)
bc.SetBool(c4d.ID_XVOLGAS_AUTOSIZE,True)
bc.SetFloat(c4d.ID_XVOLGAS_VOXELSIZE,0.1)
bc.SetInt32(c4d.ID_XVOLGAS_SMOKE_CHANNEL,c4d.ID_XVOLGAS_CHANNEL_NONE)
bc.SetFloat(c4d.ID_XVOLGAS_SMOKE_MIN,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_SMOKE_MAX,0.1)
bc.SetInt32(c4d.ID_XVOLGAS_SMOKE_ILLUM,c4d.ID_XVOLGAS_SMOKE_ILLUM_ISO)
bc.SetFloat(c4d.ID_XVOLGAS_SMOKE_ECCENTRICITY,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_SMOKE_BACKSCATTER,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_SMOKE_OPACITY,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_SMOKE_LUMINANCE,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_SMOKE_CONTRAST,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_SMOKE_GAMMA,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_SMOKE_CASTSHADOW,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_SMOKE_RECSHADOW,0.1)
bc.SetInt32(c4d.ID_XVOLGAS_FIRE_CHANNEL,c4d.ID_XVOLGAS_CHANNEL_NONE)
bc.SetFloat(c4d.ID_XVOLGAS_FIRE_MIN,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_FIRE_MAX,0.1)
bc.SetInt32(c4d.ID_XVOLGAS_FIRE_TEMP_CHANNEL,c4d.ID_XVOLGAS_CHANNEL_NONE)
bc.SetFloat(c4d.ID_XVOLGAS_TEMP_MIN,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_TEMP_MAX,0.1)
bc.SetBool(c4d.ID_XVOLGAS_FIRE_BLACKBODY,True)
bc.SetInt32(c4d.ID_XVOLGAS_FIRE_BLACKBODY_MAP,c4d.ID_XVOLGAS_FIRE_BLACKBODY_MAP_NTSC)
bc.SetFloat(c4d.ID_XVOLGAS_TEMP_MAP_MIN,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_TEMP_MAP_MAX,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_FIRE_POWER,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_FIRE_WHITEPOINT,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_FIRE_OPACITY,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_FIRE_LUMINANCE,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_FIRE_CONTRAST,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_FIRE_GAMMA,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_FIRE_R,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_FIRE_G,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_FIRE_B,0.1)
bc.SetFloat(c4d.ID_XVOLGAS_FIRE_SHADOW,0.1)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../res/description/mxpgas.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseMaterial *pMaterial = BaseMaterial::Alloc(Mxpgas);
//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;
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_MAT_GROUP),GeData(true),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_MAT_GROUP),GeData(true),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_STEP),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SHADOW_STEP),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_VOXELS),GeData(ID_XVOLGAS_VOXELS_FAST),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOOTHING),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_AUTOSIZE),GeData(true),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_VOXELSIZE),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_CHANNEL),GeData(ID_XVOLGAS_CHANNEL_NONE),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_MIN),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_MAX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_ILLUM),GeData(ID_XVOLGAS_SMOKE_ILLUM_ISO),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_ECCENTRICITY),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_BACKSCATTER),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_OPACITY),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_LUMINANCE),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_CONTRAST),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_GAMMA),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_CASTSHADOW),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_RECSHADOW),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_CHANNEL),GeData(ID_XVOLGAS_CHANNEL_NONE),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_MIN),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_MAX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_TEMP_CHANNEL),GeData(ID_XVOLGAS_CHANNEL_NONE),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_TEMP_MIN),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_TEMP_MAX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_BLACKBODY),GeData(true),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_BLACKBODY_MAP),GeData(ID_XVOLGAS_FIRE_BLACKBODY_MAP_NTSC),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_TEMP_MAP_MIN),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_TEMP_MAP_MAX),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_POWER),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_WHITEPOINT),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_OPACITY),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_LUMINANCE),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_CONTRAST),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_GAMMA),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_R),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_G),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_B),GeData(0.1),flags);
pMaterial->SetParameter(DescID(ID_XVOLGAS_FIRE_SHADOW),GeData(0.1),flags);
pMaterial->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pMaterial->GetDataInstance();
bc->SetBool(ID_XVOLGAS_SMOKE_MAT_GROUP,true);
bc->SetBool(ID_XVOLGAS_FIRE_MAT_GROUP,true);
bc->SetFloat(ID_XVOLGAS_STEP,0.1);
bc->SetFloat(ID_XVOLGAS_SHADOW_STEP,0.1);
bc->SetInt32(ID_XVOLGAS_VOXELS,ID_XVOLGAS_VOXELS_FAST);
bc->SetFloat(ID_XVOLGAS_SMOOTHING,0.1);
bc->SetBool(ID_XVOLGAS_AUTOSIZE,true);
bc->SetFloat(ID_XVOLGAS_VOXELSIZE,0.1);
bc->SetInt32(ID_XVOLGAS_SMOKE_CHANNEL,ID_XVOLGAS_CHANNEL_NONE);
bc->SetFloat(ID_XVOLGAS_SMOKE_MIN,0.1);
bc->SetFloat(ID_XVOLGAS_SMOKE_MAX,0.1);
bc->SetInt32(ID_XVOLGAS_SMOKE_ILLUM,ID_XVOLGAS_SMOKE_ILLUM_ISO);
bc->SetFloat(ID_XVOLGAS_SMOKE_ECCENTRICITY,0.1);
bc->SetFloat(ID_XVOLGAS_SMOKE_BACKSCATTER,0.1);
bc->SetFloat(ID_XVOLGAS_SMOKE_OPACITY,0.1);
bc->SetFloat(ID_XVOLGAS_SMOKE_LUMINANCE,0.1);
bc->SetFloat(ID_XVOLGAS_SMOKE_CONTRAST,0.1);
bc->SetFloat(ID_XVOLGAS_SMOKE_GAMMA,0.1);
bc->SetFloat(ID_XVOLGAS_SMOKE_CASTSHADOW,0.1);
bc->SetFloat(ID_XVOLGAS_SMOKE_RECSHADOW,0.1);
bc->SetInt32(ID_XVOLGAS_FIRE_CHANNEL,ID_XVOLGAS_CHANNEL_NONE);
bc->SetFloat(ID_XVOLGAS_FIRE_MIN,0.1);
bc->SetFloat(ID_XVOLGAS_FIRE_MAX,0.1);
bc->SetInt32(ID_XVOLGAS_FIRE_TEMP_CHANNEL,ID_XVOLGAS_CHANNEL_NONE);
bc->SetFloat(ID_XVOLGAS_TEMP_MIN,0.1);
bc->SetFloat(ID_XVOLGAS_TEMP_MAX,0.1);
bc->SetBool(ID_XVOLGAS_FIRE_BLACKBODY,true);
bc->SetInt32(ID_XVOLGAS_FIRE_BLACKBODY_MAP,ID_XVOLGAS_FIRE_BLACKBODY_MAP_NTSC);
bc->SetFloat(ID_XVOLGAS_TEMP_MAP_MIN,0.1);
bc->SetFloat(ID_XVOLGAS_TEMP_MAP_MAX,0.1);
bc->SetFloat(ID_XVOLGAS_FIRE_POWER,0.1);
bc->SetFloat(ID_XVOLGAS_FIRE_WHITEPOINT,0.1);
bc->SetFloat(ID_XVOLGAS_FIRE_OPACITY,0.1);
bc->SetFloat(ID_XVOLGAS_FIRE_LUMINANCE,0.1);
bc->SetFloat(ID_XVOLGAS_FIRE_CONTRAST,0.1);
bc->SetFloat(ID_XVOLGAS_FIRE_GAMMA,0.1);
bc->SetFloat(ID_XVOLGAS_FIRE_R,0.1);
bc->SetFloat(ID_XVOLGAS_FIRE_G,0.1);
bc->SetFloat(ID_XVOLGAS_FIRE_B,0.1);
bc->SetFloat(ID_XVOLGAS_FIRE_SHADOW,0.1);
pMaterial->Message(MSG_UPDATE);
}
Buttons
This node has buttons. Buttons can manually be executed by calling the following code
Python
c4d.CallButton(material,c4d.XVOLGAS_HELP_BUTTON_SMOKE)
c4d.CallButton(material,c4d.XVOLGAS_VIDMAN_BUTTON_SMOKE)
c4d.CallButton(material,c4d.XVOLGAS_RESET_SMOKE)
c4d.CallButton(material,c4d.XVOLGAS_SAVE_PRESET)
c4d.CallButton(material,c4d.XVOLGAS_LOAD_PRESET)
c4d.CallButton(material,c4d.ID_XVOLGAS_FIRE_BLACKBODY_PREVIEW)
c4d.CallButton(material,c4d.XVOLGAS_HELP_BUTTON_FIRE)
c4d.CallButton(material,c4d.XVOLGAS_VIDMAN_BUTTON_FIRE)
c4d.CallButton(material,c4d.XVOLGAS_RESET_FIRE)
C++
DescriptionCommand dc;
dc.id = DescID(XVOLGAS_HELP_BUTTON_SMOKE);
pMaterial->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(XVOLGAS_VIDMAN_BUTTON_SMOKE);
pMaterial->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(XVOLGAS_RESET_SMOKE);
pMaterial->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(XVOLGAS_SAVE_PRESET);
pMaterial->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(XVOLGAS_LOAD_PRESET);
pMaterial->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(ID_XVOLGAS_FIRE_BLACKBODY_PREVIEW);
pMaterial->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(XVOLGAS_HELP_BUTTON_FIRE);
pMaterial->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(XVOLGAS_VIDMAN_BUTTON_FIRE);
pMaterial->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(XVOLGAS_RESET_FIRE);
pMaterial->Message(MSG_DESCRIPTION_COMMAND, &dc);
Gradients
This node has gradients. Gradients can manually be edited by calling the following code
Python
C++
#include "customgui_gradient.h"
ID_XVOLGAS_SMOKE_COLOR
GeData data;
pMaterial->GetParameter(DescID(ID_XVOLGAS_SMOKE_COLOR),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);
}
pMaterial->SetParameter(DescID(ID_XVOLGAS_SMOKE_COLOR),data,DESCFLAGS_SET_PARAM_SET));
ID_XVOLGAS_SMOKE_TRANS
pMaterial->GetParameter(DescID(ID_XVOLGAS_SMOKE_TRANS),data,DESCFLAGS_GET_PARAM_GET));
ID_XVOLGAS_FIRE_COLOR
pMaterial->GetParameter(DescID(ID_XVOLGAS_FIRE_COLOR),data,DESCFLAGS_GET_PARAM_GET));
ID_XVOLGAS_FIRE_TRANS
pMaterial->GetParameter(DescID(ID_XVOLGAS_FIRE_TRANS),data,DESCFLAGS_GET_PARAM_GET));