Frandom
Attributes
-
ENGLISH NAME : RandomField
-
NAME : Frandom
-
INCLUDE : Ofield
-
PATH : mograph/description/frandom.res
-
PLUGIN : mograph
-
MAXON online help (may not exist): FRANDOM
Elements
ID |
UI Name |
Type |
Parameters |
Cycle |
FIELD_RANDOM_MODE |
RandomMode |
LONG
|
|
FIELD_RANDOM_MODE_RANDOM |
Random |
FIELD_RANDOM_MODE_SORTED |
Sorted |
FIELD_RANDOM_MODE_NOISE |
Noise |
|
FIELD_RANDOM_SEED |
Seed |
REAL
|
|
|
FIELD_RANDOM_NOISE_MODE |
NoiseType |
LONG
|
|
FIELD_RANDOM_NOISE_MODE_BOX |
Box |
FIELD_RANDOM_NOISE_MODE_BLISTEREDTURBULENCE |
BlisteredTurbulence |
FIELD_RANDOM_NOISE_MODE_BUYA |
Buya |
FIELD_RANDOM_NOISE_MODE_CELL |
Cell |
FIELD_RANDOM_NOISE_MODE_CRANAL |
Cranal |
FIELD_RANDOM_NOISE_MODE_DENTS |
Dents |
FIELD_RANDOM_NOISE_MODE_DISPLACEDTURBULENCE |
DisplacedTurbulence |
FIELD_RANDOM_NOISE_MODE_ELECTRIC |
Electric |
FIELD_RANDOM_NOISE_MODE_FBM |
FBM |
FIELD_RANDOM_NOISE_MODE_GASEOUS |
Gaseous |
FIELD_RANDOM_NOISE_MODE_HAMA |
Hama |
FIELD_RANDOM_NOISE_MODE_LUKA |
Luka |
FIELD_RANDOM_NOISE_MODE_MODNOISE |
Mod.Noise |
FIELD_RANDOM_NOISE_MODE_NAKI |
Naki |
FIELD_RANDOM_NOISE_MODE_PERLIN |
Perlin |
FIELD_RANDOM_NOISE_MODE_NUTOUS |
Nutous |
FIELD_RANDOM_NOISE_MODE_OBER |
Ober |
FIELD_RANDOM_NOISE_MODE_PEZO |
Pezo |
FIELD_RANDOM_NOISE_MODE_POXO |
Poxo |
FIELD_RANDOM_NOISE_MODE_SEMA |
Sema |
FIELD_RANDOM_NOISE_MODE_STUPL |
Stupl |
FIELD_RANDOM_NOISE_MODE_TURBULENCE |
Turbulence |
FIELD_RANDOM_NOISE_MODE_VLNOISE |
VLNoise |
FIELD_RANDOM_NOISE_MODE_WAVYTURBULENCE |
WavyTurbulence |
-1 |
|
FIELD_RANDOM_NOISE_MODE_CELLVORONOI |
CellVoronoi |
FIELD_RANDOM_NOISE_MODE_DISPLACEDVORONOI |
DisplacedVoronoi |
FIELD_RANDOM_NOISE_MODE_VORONOI1 |
Voronoi1 |
FIELD_RANDOM_NOISE_MODE_VORONOI2 |
Voronoi2 |
FIELD_RANDOM_NOISE_MODE_VORONOI3 |
Voronoi3 |
FIELD_RANDOM_NOISE_MODE_ZADA |
Zada |
FIELD_RANDOM_NOISE_MODE_RIDGEDMULTIFRACTAL |
RidgedMultifractal |
|
FIELD_RANDOM_SPACE |
Space |
LONG
|
|
FIELD_RANDOM_SPACE_GLOBAL |
Global |
FIELD_RANDOM_SPACE_OBJECT |
Field |
FIELD_RANDOM_SPACE_NONE |
None |
|
FIELD_RANDOM_SCALE |
Scale |
REAL
|
UNIT |
PERCENT |
MIN |
0.01 |
STEP |
1.0 |
|
|
FIELD_RANDOM_SCALE_LOCAL |
RelativeScale |
VECTOR
|
UNIT |
PERCENT |
MIN |
0.01 |
STEP |
1.0 |
|
|
FIELD_RANDOM_ANIMATIONSPEED |
AnimationSpeed |
REAL
|
|
|
FIELD_RANDOM_ANIMATIONPERIOD |
LoopPeriod |
BASETIME
|
MIN |
|
FIELD_RANDOM_INDEXED |
RandomizedSamplePositions |
BOOL
|
|
|
FIELD_RANDOM_INDEXSEED |
SamplePositionSeed |
LONG
|
MIN |
|
FIELD_RANDOM_COLORSHIFT |
ColorShift |
REAL
|
UNIT |
PERCENT |
MIN |
0.0 |
STEP |
1.0 |
|
|
FIELD_RANDOM_COLORALPHA |
ColorAlpha |
LONG
|
|
FIELD_RANDOM_COLORALPHA_NONE |
None |
FIELD_RANDOM_COLORALPHA_STRENGTH |
Strength |
|
FIELD_RANDOM_VIEWPLANES |
ViewplanePreview |
BOOL
|
PARENTCOLLAPSE |
|
FIELD_RANDOM_VIEWPLANES_X |
ShowX |
BOOL
|
PARENTCOLLAPSE |
|
FIELD_RANDOM_VIEWPLANES_Y |
ShowY |
BOOL
|
PARENTCOLLAPSE |
|
FIELD_RANDOM_VIEWPLANES_Z |
ShowZ |
BOOL
|
PARENTCOLLAPSE |
|
FIELD_RANDOM_VIEWPLANES_DENSITY |
ViewplaneResolution |
LONG
|
|
|
FIELD_RANDOM_VIEWPLANES_SIZES |
DisplayBox |
VECTOR
|
UNIT |
METER |
STEP |
0.1 |
CUSTOMGUI |
SUBDESCRIPTION |
|
|
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.Frandom)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
obj[c4d.FIELD_RANDOM_MODE] = c4d.FIELD_RANDOM_MODE_RANDOM
obj[c4d.FIELD_RANDOM_SEED] = 0.1
obj[c4d.FIELD_RANDOM_NOISE_MODE] = c4d.FIELD_RANDOM_NOISE_MODE_BOX
obj[c4d.FIELD_RANDOM_SPACE] = c4d.FIELD_RANDOM_SPACE_GLOBAL
obj[c4d.FIELD_RANDOM_SCALE] = 0.1
obj[c4d.FIELD_RANDOM_SCALE_LOCAL] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.FIELD_RANDOM_ANIMATIONSPEED] = 0.1
obj[c4d.FIELD_RANDOM_INDEXED] = True
obj[c4d.FIELD_RANDOM_INDEXSEED] = 1
obj[c4d.FIELD_RANDOM_COLORSHIFT] = 0.1
obj[c4d.FIELD_RANDOM_COLORALPHA] = c4d.FIELD_RANDOM_COLORALPHA_NONE
obj[c4d.FIELD_RANDOM_VIEWPLANES] = True
obj[c4d.FIELD_RANDOM_VIEWPLANES_X] = True
obj[c4d.FIELD_RANDOM_VIEWPLANES_Y] = True
obj[c4d.FIELD_RANDOM_VIEWPLANES_Z] = True
obj[c4d.FIELD_RANDOM_VIEWPLANES_DENSITY] = 1
obj[c4d.FIELD_RANDOM_VIEWPLANES_SIZES] = c4d.Vector(1.0,1.0,1.0)
#Second way, using the base container.
bc = obj.GetDataInstance()
bc.SetInt32(c4d.FIELD_RANDOM_MODE,c4d.FIELD_RANDOM_MODE_RANDOM)
bc.SetFloat(c4d.FIELD_RANDOM_SEED,0.1)
bc.SetInt32(c4d.FIELD_RANDOM_NOISE_MODE,c4d.FIELD_RANDOM_NOISE_MODE_BOX)
bc.SetInt32(c4d.FIELD_RANDOM_SPACE,c4d.FIELD_RANDOM_SPACE_GLOBAL)
bc.SetFloat(c4d.FIELD_RANDOM_SCALE,0.1)
bc.SetVector(c4d.FIELD_RANDOM_SCALE_LOCAL, c4d.Vector(1.0,1.0,1.0)
bc.SetFloat(c4d.FIELD_RANDOM_ANIMATIONSPEED,0.1)
bc.SetBool(c4d.FIELD_RANDOM_INDEXED,True)
bc.SetInt32(c4d.FIELD_RANDOM_INDEXSEED,1)
bc.SetFloat(c4d.FIELD_RANDOM_COLORSHIFT,0.1)
bc.SetInt32(c4d.FIELD_RANDOM_COLORALPHA,c4d.FIELD_RANDOM_COLORALPHA_NONE)
bc.SetBool(c4d.FIELD_RANDOM_VIEWPLANES,True)
bc.SetBool(c4d.FIELD_RANDOM_VIEWPLANES_X,True)
bc.SetBool(c4d.FIELD_RANDOM_VIEWPLANES_Y,True)
bc.SetBool(c4d.FIELD_RANDOM_VIEWPLANES_Z,True)
bc.SetInt32(c4d.FIELD_RANDOM_VIEWPLANES_DENSITY,1)
bc.SetVector(c4d.FIELD_RANDOM_VIEWPLANES_SIZES, c4d.Vector(1.0,1.0,1.0)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../mograph/description/frandom.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseObject *pObject = BaseObject::Alloc(Frandom);
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(FIELD_RANDOM_MODE),GeData(FIELD_RANDOM_MODE_RANDOM),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_SEED),GeData(0.1),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_NOISE_MODE),GeData(FIELD_RANDOM_NOISE_MODE_BOX),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_SPACE),GeData(FIELD_RANDOM_SPACE_GLOBAL),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_SCALE),GeData(0.1),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_SCALE_LOCAL),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_ANIMATIONSPEED),GeData(0.1),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_INDEXED),GeData(true),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_INDEXSEED),GeData(1),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_COLORSHIFT),GeData(0.1),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_COLORALPHA),GeData(FIELD_RANDOM_COLORALPHA_NONE),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_VIEWPLANES),GeData(true),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_VIEWPLANES_X),GeData(true),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_VIEWPLANES_Y),GeData(true),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_VIEWPLANES_Z),GeData(true),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_VIEWPLANES_DENSITY),GeData(1),flags);
pObject->SetParameter(DescID(FIELD_RANDOM_VIEWPLANES_SIZES),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pObject->GetDataInstance();
bc->SetInt32(FIELD_RANDOM_MODE,FIELD_RANDOM_MODE_RANDOM);
bc->SetFloat(FIELD_RANDOM_SEED,0.1);
bc->SetInt32(FIELD_RANDOM_NOISE_MODE,FIELD_RANDOM_NOISE_MODE_BOX);
bc->SetInt32(FIELD_RANDOM_SPACE,FIELD_RANDOM_SPACE_GLOBAL);
bc->SetFloat(FIELD_RANDOM_SCALE,0.1);
bc->SetVector(FIELD_RANDOM_SCALE_LOCAL, c4d.Vector(1.0,1.0,1.0);
bc->SetFloat(FIELD_RANDOM_ANIMATIONSPEED,0.1);
bc->SetBool(FIELD_RANDOM_INDEXED,true);
bc->SetInt32(FIELD_RANDOM_INDEXSEED,1);
bc->SetFloat(FIELD_RANDOM_COLORSHIFT,0.1);
bc->SetInt32(FIELD_RANDOM_COLORALPHA,FIELD_RANDOM_COLORALPHA_NONE);
bc->SetBool(FIELD_RANDOM_VIEWPLANES,true);
bc->SetBool(FIELD_RANDOM_VIEWPLANES_X,true);
bc->SetBool(FIELD_RANDOM_VIEWPLANES_Y,true);
bc->SetBool(FIELD_RANDOM_VIEWPLANES_Z,true);
bc->SetInt32(FIELD_RANDOM_VIEWPLANES_DENSITY,1);
bc->SetVector(FIELD_RANDOM_VIEWPLANES_SIZES, c4d.Vector(1.0,1.0,1.0);
pObject->Message(MSG_UPDATE);
}