Oxpsprite
Attributes
-
ENGLISH NAME : X-ParticlesSpritesObject
-
NAME : Oxpsprite
-
INCLUDE : Obase
-
PATH : res/description/oxpsprite.res
-
PLUGIN : X-Particles
-
MAXON online help (may not exist): OXPSPRITE
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():
obj = c4d.BaseObject(c4d.Oxpsprite)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
obj[c4d.XSP_SPRITE_FROMBIRTH] = True
obj[c4d.XSP_SPRITE_TYPE] = c4d.XSP_SPRITE_DOT
obj[c4d.XSP_SPRITE_DRAWMODE] = c4d.SPRITE_DRAWMODE_GEOM
obj[c4d.XSP_SPRITE_SCALEMODE] = c4d.SPRITE_SCALEMODE_PSCALE
obj[c4d.XSP_SPRITE_SPHERE_SEGMENTS] = 1
obj[c4d.XSP_SPRITE_TICK_3D] = True
obj[c4d.XSP_SPRITE_RUBBLE_OBJ] = c4d.SPRITE_RUBBLE_TETRA
obj[c4d.XSP_SPRITE_RUBBLE_SUB] = 1
obj[c4d.XSP_SPRITE_RUBBLE_SUB_SMOOTH] = True
obj[c4d.XSP_SPRITE_RUBBLE_DEFORM] = 0.1
obj[c4d.XSP_SPRITE_RUBBLE_PHONG] = True
obj[c4d.XSP_SPRITE_RUBBLE_PHONG_ANGLE] = 0.1
obj[c4d.XSP_SPRITE_RUBBLE_SCALE_MIN] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.XSP_SPRITE_RUBBLE_SCALE_MAX] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.XSP_SPRITE_RUBBLE_SMOOTH] = True
obj[c4d.XSP_SPRITE_LIGHT_NOILLUM] = True
obj[c4d.XSP_SPRITE_LIGHT_GI] = True
obj[c4d.XSP_SPRITE_LIGHT_BRIGHTNESS_MAX] = 0.1
obj[c4d.XSP_SPRITE_LIGHT_SHADOWS] = c4d.XLIGHT_SHADOW_NONE
obj[c4d.XSP_SPRITE_LIGHT_FALLOFF_TYPE] = c4d.LIGHT_FALLOFF_TYPE_NONE
obj[c4d.XSP_SPRITE_LIGHT_FALLOFF_RAD_INNER] = 0.1
obj[c4d.XSP_SPRITE_LIGHT_FALLOFF_RAD_OUTER] = 0.1
obj[c4d.XSP_SPRITE_LIGHT_FALLOFF_USEGRAD] = True
obj[c4d.XSP_SPRITE_LIGHT_VISIBLE] = c4d.XLIGHT_VISIBLE_NONE
obj[c4d.XSP_SPRITE_LIGHT_VISIBLE_SAMPLEDIST] = 0.1
obj[c4d.XSP_SPRITE_LIGHT_BRIGHTNESS_VIS_MAX] = 0.1
obj[c4d.XSP_SPRITE_LIGHT_INNERDIST_VIS_MAX] = 0.1
obj[c4d.XSP_SPRITE_LIGHT_NOISE_USE] = c4d.XLIGHT_NOISE_NONE
obj[c4d.XSP_SPRITE_LIGHT_NOISE_TYPE] = c4d.XLIGHT_NOISE_NOISE
obj[c4d.XSP_SPRITE_LIGHT_NOISE_OCTAVES] = 1
obj[c4d.XSP_SPRITE_LIGHT_NOISE_VELOCITY] = 0.1
obj[c4d.XSP_SPRITE_LIGHT_NOISE_BRIGHTNESS] = 0.1
obj[c4d.XSP_SPRITE_LIGHT_NOISE_CONTRAST] = 0.1
obj[c4d.XSP_SPRITE_LIGHT_NOISE_LOCAL] = True
obj[c4d.XSP_SPRITE_LIGHT_NOISE_VISSCALE] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.XSP_SPRITE_LIGHT_NOISE_ILLSCALE] = 0.1
obj[c4d.XSP_SPRITE_LIGHT_NOISE_WIND] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.XSP_SPRITE_LIGHT_NOISE_WINDVEL] = 0.1
obj[c4d.XSP_SPRITE_CONE_ROTSEGMENTS] = 1
obj[c4d.XSP_SPRITE_CONE_HEIGHTSEGMENTS] = 1
obj[c4d.XSP_SPRITE_CONE_CAPS] = True
obj[c4d.XSP_SPRITE_CONE_HEIGHT_MULTI] = 0.1
obj[c4d.XSP_SPRITE_CONE_ORIENT] = c4d.CORIENT_XPOS
obj[c4d.XSP_SPRITE_PYRAMID_ORIENT] = c4d.PORIENT_XPOS
obj[c4d.XSP_SPRITE_DISC_IRAD] = 0.1
obj[c4d.XSP_SPRITE_DISC_RSEG] = 1
obj[c4d.XSP_SPRITE_DISC_ORIENT] = c4d.DORIENT_XPOS
obj[c4d.XSP_SPRITE_TEXT_HEIGHT] = 0.1
obj[c4d.XSP_SPRITE_TEXT_DEPTH] = 0.1
obj[c4d.XSP_SPRITE_TEXT_ALIGN] = c4d.TEXT_ALIGN_LEFT
obj[c4d.XSP_SPRITE_TEXT_ROUNDING] = True
obj[c4d.XSP_SPRITE_TEXT_ROUNDING_SIZE] = 0.1
obj[c4d.XSP_SPRITE_TEXT_PLANE] = c4d.TEXT_PLANE_XY
obj[c4d.XSP_SPRITE_TEXT_MIRROR] = c4d.TEXT_MIRROR_NONE
obj[c4d.XSP_SPRITE_TEXT_CENTREAXIS] = True
obj[c4d.XSP_SPRITE_TEXT_MODE] = c4d.TEXT_MODE_ALPHA
obj[c4d.XSP_SPRITE_TEXT_ALPHA_MODE] = c4d.ALPHA_MODE_RANDOM
obj[c4d.XSP_SPRITE_TEXT_ALPHA_CASE] = c4d.CASE_MODE_UPPER
obj[c4d.XSP_SPRITE_TEXT_NUMERIC_MODE] = c4d.NUMERIC_MODE_RANDOM
obj[c4d.XSP_SPRITE_TEXT_NUMERIC_START] = 1
obj[c4d.XSP_SPRITE_TEXT_NUMERIC_END] = 1
obj[c4d.XSP_SPRITE_TEXT_USER_TEXT] = "Hello World"
obj[c4d.XSP_SPRITE_TEXT_SINGLECHAR] = True
obj[c4d.XSP_CACHEINFO_CACHEDELEMENTS] = 1
obj[c4d.XSP_SPRITE_TEXTURE_SELECT] = c4d.SPRITE_TEX_FIRST
obj[c4d.XSP_SPRITE_TEXTURE_INDEX] = 1
obj[c4d.XSP_SPRITE_TEXTURE_PROJECTION] = c4d.XSP_SPRITE_TEXPROJ_SPHERICAL
obj[c4d.XSP_CAMERAPROJ_FILMASPECT] = 0.1
obj[c4d.XSP_CAMERAPROJ_PIXASPECT] = 0.1
obj[c4d.XSP_SPRITE_TEXTILESU] = 0.1
obj[c4d.XSP_SPRITE_TEXTILESV] = 0.1
obj[c4d.XSP_SPRITE_MULTISHADER] = c4d.SPRITE_MULTIS_GREY
#Second way, using the base container.
bc = obj.GetDataInstance()
bc.SetBool(c4d.XSP_SPRITE_FROMBIRTH,True)
bc.SetInt32(c4d.XSP_SPRITE_TYPE,c4d.XSP_SPRITE_DOT)
bc.SetInt32(c4d.XSP_SPRITE_DRAWMODE,c4d.SPRITE_DRAWMODE_GEOM)
bc.SetInt32(c4d.XSP_SPRITE_SCALEMODE,c4d.SPRITE_SCALEMODE_PSCALE)
bc.SetInt32(c4d.XSP_SPRITE_SPHERE_SEGMENTS,1)
bc.SetBool(c4d.XSP_SPRITE_TICK_3D,True)
bc.SetInt32(c4d.XSP_SPRITE_RUBBLE_OBJ,c4d.SPRITE_RUBBLE_TETRA)
bc.SetInt32(c4d.XSP_SPRITE_RUBBLE_SUB,1)
bc.SetBool(c4d.XSP_SPRITE_RUBBLE_SUB_SMOOTH,True)
bc.SetFloat(c4d.XSP_SPRITE_RUBBLE_DEFORM,0.1)
bc.SetBool(c4d.XSP_SPRITE_RUBBLE_PHONG,True)
bc.SetFloat(c4d.XSP_SPRITE_RUBBLE_PHONG_ANGLE,0.1)
bc.SetVector(c4d.XSP_SPRITE_RUBBLE_SCALE_MIN, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.XSP_SPRITE_RUBBLE_SCALE_MAX, c4d.Vector(1.0,1.0,1.0)
bc.SetBool(c4d.XSP_SPRITE_RUBBLE_SMOOTH,True)
bc.SetBool(c4d.XSP_SPRITE_LIGHT_NOILLUM,True)
bc.SetBool(c4d.XSP_SPRITE_LIGHT_GI,True)
bc.SetFloat(c4d.XSP_SPRITE_LIGHT_BRIGHTNESS_MAX,0.1)
bc.SetInt32(c4d.XSP_SPRITE_LIGHT_SHADOWS,c4d.XLIGHT_SHADOW_NONE)
bc.SetInt32(c4d.XSP_SPRITE_LIGHT_FALLOFF_TYPE,c4d.LIGHT_FALLOFF_TYPE_NONE)
bc.SetFloat(c4d.XSP_SPRITE_LIGHT_FALLOFF_RAD_INNER,0.1)
bc.SetFloat(c4d.XSP_SPRITE_LIGHT_FALLOFF_RAD_OUTER,0.1)
bc.SetBool(c4d.XSP_SPRITE_LIGHT_FALLOFF_USEGRAD,True)
bc.SetInt32(c4d.XSP_SPRITE_LIGHT_VISIBLE,c4d.XLIGHT_VISIBLE_NONE)
bc.SetFloat(c4d.XSP_SPRITE_LIGHT_VISIBLE_SAMPLEDIST,0.1)
bc.SetFloat(c4d.XSP_SPRITE_LIGHT_BRIGHTNESS_VIS_MAX,0.1)
bc.SetFloat(c4d.XSP_SPRITE_LIGHT_INNERDIST_VIS_MAX,0.1)
bc.SetInt32(c4d.XSP_SPRITE_LIGHT_NOISE_USE,c4d.XLIGHT_NOISE_NONE)
bc.SetInt32(c4d.XSP_SPRITE_LIGHT_NOISE_TYPE,c4d.XLIGHT_NOISE_NOISE)
bc.SetInt32(c4d.XSP_SPRITE_LIGHT_NOISE_OCTAVES,1)
bc.SetFloat(c4d.XSP_SPRITE_LIGHT_NOISE_VELOCITY,0.1)
bc.SetFloat(c4d.XSP_SPRITE_LIGHT_NOISE_BRIGHTNESS,0.1)
bc.SetFloat(c4d.XSP_SPRITE_LIGHT_NOISE_CONTRAST,0.1)
bc.SetBool(c4d.XSP_SPRITE_LIGHT_NOISE_LOCAL,True)
bc.SetVector(c4d.XSP_SPRITE_LIGHT_NOISE_VISSCALE, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.XSP_SPRITE_LIGHT_NOISE_ILLSCALE,0.1)
bc.SetVector(c4d.XSP_SPRITE_LIGHT_NOISE_WIND, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.XSP_SPRITE_LIGHT_NOISE_WINDVEL,0.1)
bc.SetInt32(c4d.XSP_SPRITE_CONE_ROTSEGMENTS,1)
bc.SetInt32(c4d.XSP_SPRITE_CONE_HEIGHTSEGMENTS,1)
bc.SetBool(c4d.XSP_SPRITE_CONE_CAPS,True)
bc.SetFloat(c4d.XSP_SPRITE_CONE_HEIGHT_MULTI,0.1)
bc.SetInt32(c4d.XSP_SPRITE_CONE_ORIENT,c4d.CORIENT_XPOS)
bc.SetInt32(c4d.XSP_SPRITE_PYRAMID_ORIENT,c4d.PORIENT_XPOS)
bc.SetFloat(c4d.XSP_SPRITE_DISC_IRAD,0.1)
bc.SetInt32(c4d.XSP_SPRITE_DISC_RSEG,1)
bc.SetInt32(c4d.XSP_SPRITE_DISC_ORIENT,c4d.DORIENT_XPOS)
bc.SetFloat(c4d.XSP_SPRITE_TEXT_HEIGHT,0.1)
bc.SetFloat(c4d.XSP_SPRITE_TEXT_DEPTH,0.1)
bc.SetInt32(c4d.XSP_SPRITE_TEXT_ALIGN,c4d.TEXT_ALIGN_LEFT)
bc.SetBool(c4d.XSP_SPRITE_TEXT_ROUNDING,True)
bc.SetFloat(c4d.XSP_SPRITE_TEXT_ROUNDING_SIZE,0.1)
bc.SetInt32(c4d.XSP_SPRITE_TEXT_PLANE,c4d.TEXT_PLANE_XY)
bc.SetInt32(c4d.XSP_SPRITE_TEXT_MIRROR,c4d.TEXT_MIRROR_NONE)
bc.SetBool(c4d.XSP_SPRITE_TEXT_CENTREAXIS,True)
bc.SetInt32(c4d.XSP_SPRITE_TEXT_MODE,c4d.TEXT_MODE_ALPHA)
bc.SetInt32(c4d.XSP_SPRITE_TEXT_ALPHA_MODE,c4d.ALPHA_MODE_RANDOM)
bc.SetInt32(c4d.XSP_SPRITE_TEXT_ALPHA_CASE,c4d.CASE_MODE_UPPER)
bc.SetInt32(c4d.XSP_SPRITE_TEXT_NUMERIC_MODE,c4d.NUMERIC_MODE_RANDOM)
bc.SetInt32(c4d.XSP_SPRITE_TEXT_NUMERIC_START,1)
bc.SetInt32(c4d.XSP_SPRITE_TEXT_NUMERIC_END,1)
bc.SetString(c4d.XSP_SPRITE_TEXT_USER_TEXT,"Hello World")
bc.SetBool(c4d.XSP_SPRITE_TEXT_SINGLECHAR,True)
bc.SetInt32(c4d.XSP_CACHEINFO_CACHEDELEMENTS,1)
bc.SetInt32(c4d.XSP_SPRITE_TEXTURE_SELECT,c4d.SPRITE_TEX_FIRST)
bc.SetInt32(c4d.XSP_SPRITE_TEXTURE_INDEX,1)
bc.SetInt32(c4d.XSP_SPRITE_TEXTURE_PROJECTION,c4d.XSP_SPRITE_TEXPROJ_SPHERICAL)
bc.SetFloat(c4d.XSP_CAMERAPROJ_FILMASPECT,0.1)
bc.SetFloat(c4d.XSP_CAMERAPROJ_PIXASPECT,0.1)
bc.SetFloat(c4d.XSP_SPRITE_TEXTILESU,0.1)
bc.SetFloat(c4d.XSP_SPRITE_TEXTILESV,0.1)
bc.SetInt32(c4d.XSP_SPRITE_MULTISHADER,c4d.SPRITE_MULTIS_GREY)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../res/description/oxpsprite.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseObject *pObject = BaseObject::Alloc(Oxpsprite);
pDoc->InsertObject(pObject);
pDoc->StartUndo();
pDoc->AddUndo(UNDO_NEW,pObject);
pDoc->EndUndo();
EventAdd(EVENT_FORCEREDRAW);
//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;
pObject->SetParameter(DescID(XSP_SPRITE_FROMBIRTH),GeData(true),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TYPE),GeData(XSP_SPRITE_DOT),flags);
pObject->SetParameter(DescID(XSP_SPRITE_DRAWMODE),GeData(SPRITE_DRAWMODE_GEOM),flags);
pObject->SetParameter(DescID(XSP_SPRITE_SCALEMODE),GeData(SPRITE_SCALEMODE_PSCALE),flags);
pObject->SetParameter(DescID(XSP_SPRITE_SPHERE_SEGMENTS),GeData(1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TICK_3D),GeData(true),flags);
pObject->SetParameter(DescID(XSP_SPRITE_RUBBLE_OBJ),GeData(SPRITE_RUBBLE_TETRA),flags);
pObject->SetParameter(DescID(XSP_SPRITE_RUBBLE_SUB),GeData(1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_RUBBLE_SUB_SMOOTH),GeData(true),flags);
pObject->SetParameter(DescID(XSP_SPRITE_RUBBLE_DEFORM),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_RUBBLE_PHONG),GeData(true),flags);
pObject->SetParameter(DescID(XSP_SPRITE_RUBBLE_PHONG_ANGLE),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_RUBBLE_SCALE_MIN),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(XSP_SPRITE_RUBBLE_SCALE_MAX),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(XSP_SPRITE_RUBBLE_SMOOTH),GeData(true),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_NOILLUM),GeData(true),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_GI),GeData(true),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_BRIGHTNESS_MAX),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_SHADOWS),GeData(XLIGHT_SHADOW_NONE),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_FALLOFF_TYPE),GeData(LIGHT_FALLOFF_TYPE_NONE),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_FALLOFF_RAD_INNER),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_FALLOFF_RAD_OUTER),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_FALLOFF_USEGRAD),GeData(true),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_VISIBLE),GeData(XLIGHT_VISIBLE_NONE),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_VISIBLE_SAMPLEDIST),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_BRIGHTNESS_VIS_MAX),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_INNERDIST_VIS_MAX),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_NOISE_USE),GeData(XLIGHT_NOISE_NONE),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_NOISE_TYPE),GeData(XLIGHT_NOISE_NOISE),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_NOISE_OCTAVES),GeData(1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_NOISE_VELOCITY),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_NOISE_BRIGHTNESS),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_NOISE_CONTRAST),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_NOISE_LOCAL),GeData(true),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_NOISE_VISSCALE),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_NOISE_ILLSCALE),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_NOISE_WIND),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_NOISE_WINDVEL),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_CONE_ROTSEGMENTS),GeData(1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_CONE_HEIGHTSEGMENTS),GeData(1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_CONE_CAPS),GeData(true),flags);
pObject->SetParameter(DescID(XSP_SPRITE_CONE_HEIGHT_MULTI),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_CONE_ORIENT),GeData(CORIENT_XPOS),flags);
pObject->SetParameter(DescID(XSP_SPRITE_PYRAMID_ORIENT),GeData(PORIENT_XPOS),flags);
pObject->SetParameter(DescID(XSP_SPRITE_DISC_IRAD),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_DISC_RSEG),GeData(1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_DISC_ORIENT),GeData(DORIENT_XPOS),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_HEIGHT),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_DEPTH),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_ALIGN),GeData(TEXT_ALIGN_LEFT),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_ROUNDING),GeData(true),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_ROUNDING_SIZE),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_PLANE),GeData(TEXT_PLANE_XY),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_MIRROR),GeData(TEXT_MIRROR_NONE),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_CENTREAXIS),GeData(true),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_MODE),GeData(TEXT_MODE_ALPHA),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_ALPHA_MODE),GeData(ALPHA_MODE_RANDOM),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_ALPHA_CASE),GeData(CASE_MODE_UPPER),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_NUMERIC_MODE),GeData(NUMERIC_MODE_RANDOM),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_NUMERIC_START),GeData(1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_NUMERIC_END),GeData(1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_USER_TEXT),GeData("Hello World"),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXT_SINGLECHAR),GeData(true),flags);
pObject->SetParameter(DescID(XSP_CACHEINFO_CACHEDELEMENTS),GeData(1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXTURE_SELECT),GeData(SPRITE_TEX_FIRST),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXTURE_INDEX),GeData(1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXTURE_PROJECTION),GeData(XSP_SPRITE_TEXPROJ_SPHERICAL),flags);
pObject->SetParameter(DescID(XSP_CAMERAPROJ_FILMASPECT),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_CAMERAPROJ_PIXASPECT),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXTILESU),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_TEXTILESV),GeData(0.1),flags);
pObject->SetParameter(DescID(XSP_SPRITE_MULTISHADER),GeData(SPRITE_MULTIS_GREY),flags);
pObject->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pObject->GetDataInstance();
bc->SetBool(XSP_SPRITE_FROMBIRTH,true);
bc->SetInt32(XSP_SPRITE_TYPE,XSP_SPRITE_DOT);
bc->SetInt32(XSP_SPRITE_DRAWMODE,SPRITE_DRAWMODE_GEOM);
bc->SetInt32(XSP_SPRITE_SCALEMODE,SPRITE_SCALEMODE_PSCALE);
bc->SetInt32(XSP_SPRITE_SPHERE_SEGMENTS,1);
bc->SetBool(XSP_SPRITE_TICK_3D,true);
bc->SetInt32(XSP_SPRITE_RUBBLE_OBJ,SPRITE_RUBBLE_TETRA);
bc->SetInt32(XSP_SPRITE_RUBBLE_SUB,1);
bc->SetBool(XSP_SPRITE_RUBBLE_SUB_SMOOTH,true);
bc->SetFloat(XSP_SPRITE_RUBBLE_DEFORM,0.1);
bc->SetBool(XSP_SPRITE_RUBBLE_PHONG,true);
bc->SetFloat(XSP_SPRITE_RUBBLE_PHONG_ANGLE,0.1);
bc->SetVector(XSP_SPRITE_RUBBLE_SCALE_MIN, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(XSP_SPRITE_RUBBLE_SCALE_MAX, c4d.Vector(1.0,1.0,1.0);
bc->SetBool(XSP_SPRITE_RUBBLE_SMOOTH,true);
bc->SetBool(XSP_SPRITE_LIGHT_NOILLUM,true);
bc->SetBool(XSP_SPRITE_LIGHT_GI,true);
bc->SetFloat(XSP_SPRITE_LIGHT_BRIGHTNESS_MAX,0.1);
bc->SetInt32(XSP_SPRITE_LIGHT_SHADOWS,XLIGHT_SHADOW_NONE);
bc->SetInt32(XSP_SPRITE_LIGHT_FALLOFF_TYPE,LIGHT_FALLOFF_TYPE_NONE);
bc->SetFloat(XSP_SPRITE_LIGHT_FALLOFF_RAD_INNER,0.1);
bc->SetFloat(XSP_SPRITE_LIGHT_FALLOFF_RAD_OUTER,0.1);
bc->SetBool(XSP_SPRITE_LIGHT_FALLOFF_USEGRAD,true);
bc->SetInt32(XSP_SPRITE_LIGHT_VISIBLE,XLIGHT_VISIBLE_NONE);
bc->SetFloat(XSP_SPRITE_LIGHT_VISIBLE_SAMPLEDIST,0.1);
bc->SetFloat(XSP_SPRITE_LIGHT_BRIGHTNESS_VIS_MAX,0.1);
bc->SetFloat(XSP_SPRITE_LIGHT_INNERDIST_VIS_MAX,0.1);
bc->SetInt32(XSP_SPRITE_LIGHT_NOISE_USE,XLIGHT_NOISE_NONE);
bc->SetInt32(XSP_SPRITE_LIGHT_NOISE_TYPE,XLIGHT_NOISE_NOISE);
bc->SetInt32(XSP_SPRITE_LIGHT_NOISE_OCTAVES,1);
bc->SetFloat(XSP_SPRITE_LIGHT_NOISE_VELOCITY,0.1);
bc->SetFloat(XSP_SPRITE_LIGHT_NOISE_BRIGHTNESS,0.1);
bc->SetFloat(XSP_SPRITE_LIGHT_NOISE_CONTRAST,0.1);
bc->SetBool(XSP_SPRITE_LIGHT_NOISE_LOCAL,true);
bc->SetVector(XSP_SPRITE_LIGHT_NOISE_VISSCALE, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(XSP_SPRITE_LIGHT_NOISE_ILLSCALE,0.1);
bc->SetVector(XSP_SPRITE_LIGHT_NOISE_WIND, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(XSP_SPRITE_LIGHT_NOISE_WINDVEL,0.1);
bc->SetInt32(XSP_SPRITE_CONE_ROTSEGMENTS,1);
bc->SetInt32(XSP_SPRITE_CONE_HEIGHTSEGMENTS,1);
bc->SetBool(XSP_SPRITE_CONE_CAPS,true);
bc->SetFloat(XSP_SPRITE_CONE_HEIGHT_MULTI,0.1);
bc->SetInt32(XSP_SPRITE_CONE_ORIENT,CORIENT_XPOS);
bc->SetInt32(XSP_SPRITE_PYRAMID_ORIENT,PORIENT_XPOS);
bc->SetFloat(XSP_SPRITE_DISC_IRAD,0.1);
bc->SetInt32(XSP_SPRITE_DISC_RSEG,1);
bc->SetInt32(XSP_SPRITE_DISC_ORIENT,DORIENT_XPOS);
bc->SetFloat(XSP_SPRITE_TEXT_HEIGHT,0.1);
bc->SetFloat(XSP_SPRITE_TEXT_DEPTH,0.1);
bc->SetInt32(XSP_SPRITE_TEXT_ALIGN,TEXT_ALIGN_LEFT);
bc->SetBool(XSP_SPRITE_TEXT_ROUNDING,true);
bc->SetFloat(XSP_SPRITE_TEXT_ROUNDING_SIZE,0.1);
bc->SetInt32(XSP_SPRITE_TEXT_PLANE,TEXT_PLANE_XY);
bc->SetInt32(XSP_SPRITE_TEXT_MIRROR,TEXT_MIRROR_NONE);
bc->SetBool(XSP_SPRITE_TEXT_CENTREAXIS,true);
bc->SetInt32(XSP_SPRITE_TEXT_MODE,TEXT_MODE_ALPHA);
bc->SetInt32(XSP_SPRITE_TEXT_ALPHA_MODE,ALPHA_MODE_RANDOM);
bc->SetInt32(XSP_SPRITE_TEXT_ALPHA_CASE,CASE_MODE_UPPER);
bc->SetInt32(XSP_SPRITE_TEXT_NUMERIC_MODE,NUMERIC_MODE_RANDOM);
bc->SetInt32(XSP_SPRITE_TEXT_NUMERIC_START,1);
bc->SetInt32(XSP_SPRITE_TEXT_NUMERIC_END,1);
bc->SetString(XSP_SPRITE_TEXT_USER_TEXT,"Hello World");
bc->SetBool(XSP_SPRITE_TEXT_SINGLECHAR,true);
bc->SetInt32(XSP_CACHEINFO_CACHEDELEMENTS,1);
bc->SetInt32(XSP_SPRITE_TEXTURE_SELECT,SPRITE_TEX_FIRST);
bc->SetInt32(XSP_SPRITE_TEXTURE_INDEX,1);
bc->SetInt32(XSP_SPRITE_TEXTURE_PROJECTION,XSP_SPRITE_TEXPROJ_SPHERICAL);
bc->SetFloat(XSP_CAMERAPROJ_FILMASPECT,0.1);
bc->SetFloat(XSP_CAMERAPROJ_PIXASPECT,0.1);
bc->SetFloat(XSP_SPRITE_TEXTILESU,0.1);
bc->SetFloat(XSP_SPRITE_TEXTILESV,0.1);
bc->SetInt32(XSP_SPRITE_MULTISHADER,SPRITE_MULTIS_GREY);
pObject->Message(MSG_UPDATE);
}
Buttons
This node has buttons. Buttons can manually be executed by calling the following code
Python
c4d.CallButton(obj,c4d.XSP_HELP_BUTTON)
c4d.CallButton(obj,c4d.XSP_VIDMAN_BUTTON)
c4d.CallButton(obj,c4d.XSP_RESET_OPTS)
c4d.CallButton(obj,c4d.XSP_SAVE_PRESET)
c4d.CallButton(obj,c4d.XSP_LOAD_PRESET)
C++
DescriptionCommand dc;
dc.id = DescID(XSP_HELP_BUTTON);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(XSP_VIDMAN_BUTTON);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(XSP_RESET_OPTS);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(XSP_SAVE_PRESET);
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc;
dc.id = DescID(XSP_LOAD_PRESET);
pObject->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"
XSP_SPRITE_LIGHT_FALLOFF_GRADIENT
GeData data;
pObject->GetParameter(DescID(XSP_SPRITE_LIGHT_FALLOFF_GRADIENT),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);
}
pObject->SetParameter(DescID(XSP_SPRITE_LIGHT_FALLOFF_GRADIENT),data,DESCFLAGS_SET_PARAM_SET));
XSP_SPRITE_MULTIGRAD
pObject->GetParameter(DescID(XSP_SPRITE_MULTIGRAD),data,DESCFLAGS_GET_PARAM_GET));