Here you will find documentation on all the descriptions that Cinema 4D currently has. You can list them Alphabetically, by Type or Plugin . The sample Python and C++ code is automatically generated and in some cases may not be 100% correct. If something doesn't work then please refer to the official Cinema 4D SDK documentation for more information.

IDs and information for Omaudio

Omaudio

Attributes

  • ENGLISH NAME : X-ParticlesSoundModifier
  • NAME : Omaudio
  • INCLUDE : Obase
  • PATH : res/description/omaudio.res
  • PLUGIN : X-Particles
  • MAXON online help (may not exist): OMAUDIO

Elements

ID UI Name Type Parameters Cycle
XM_AUDIO_ENABLED Enabled BOOL  
XM_AUDIO_MODE Mode LONG  
XM_AUDIO_MODE_INDEP Independent
XM_AUDIO_MODE_ACTION Action-Controlled
XM_AUDIO_FILE Sound FILENAME ANIM
XM_AUDIO_AUTO Auto BOOL  
XM_AUDIO_START Start BASETIME  
XM_AUDIO_END End BASETIME  
XM_AUDIO_SCALE Retiming REAL  
XM_AUDIO_LOOP Repeat BOOL  
XM_AUDIO_GRAPH Graph BITMAPBUTTON  
XM_AUDIO_FREQUENCY_COLOR Color GRADIENT
COLOR
ICC_BASEDOCUMENT
XM_AUDIO_FFT FFTResolution LONG
MIN 1
MAX 16
XM_AUDIO_DB_RANGE dBRange REAL
MIN 0.0
MAX 100.0
XM_AUDIO_FREQUENCY_MIN FreqMin REAL
MIN 0.0
MAX 44100.0
XM_AUDIO_FREQUENCY_MAX FreqMax REAL
MIN 0.0
MAX 44100.0
XM_AUDIO_FREQ_AMP Amplitude SPLINE  
XM_AUDIO_EQ EQ SPLINE  
XM_AUDIO_ADD Add BUTTON SCALE_H
XM_AUDIO_RESET Reset BUTTON SCALE_H
XM_AUDIO_GROUP Groups IN_EXCLUDE
NUM_FLAGS 2
INIT_STATE 3
SEND_SELCHNGMSG 1
SCALE_V
IMAGE_01_ON 1009316
IMAGE_01_OFF 1009320
IMAGE_02_ON 300000231
IMAGE_02_OFF 300000230

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.Omaudio)
    doc.InsertObject(obj)
    c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
    
    #You can set parameters two different ways. 
    #First way              
    obj[c4d.XM_AUDIO_ENABLED] = True
    obj[c4d.XM_AUDIO_MODE] = c4d.XM_AUDIO_MODE_INDEP
    obj[c4d.XM_AUDIO_FILE] = "c:\\SomeFile.txt"
    obj[c4d.XM_AUDIO_AUTO] = True
    obj[c4d.XM_AUDIO_SCALE] = 0.1
    obj[c4d.XM_AUDIO_LOOP] = True
    obj[c4d.XM_AUDIO_FFT] = 1
    obj[c4d.XM_AUDIO_DB_RANGE] = 0.1
    obj[c4d.XM_AUDIO_FREQUENCY_MIN] = 0.1
    obj[c4d.XM_AUDIO_FREQUENCY_MAX] = 0.1
    
    #Second way, using the base container.
    bc = obj.GetDataInstance()
    bc.SetBool(c4d.XM_AUDIO_ENABLED,True)
    bc.SetInt32(c4d.XM_AUDIO_MODE,c4d.XM_AUDIO_MODE_INDEP)
    bc.SetFileName(c4d.XM_AUDIO_FILE,"c:\\SomeFile.txt")
    bc.SetBool(c4d.XM_AUDIO_AUTO,True)
    bc.SetFloat(c4d.XM_AUDIO_SCALE,0.1)
    bc.SetBool(c4d.XM_AUDIO_LOOP,True)
    bc.SetInt32(c4d.XM_AUDIO_FFT,1)
    bc.SetFloat(c4d.XM_AUDIO_DB_RANGE,0.1)
    bc.SetFloat(c4d.XM_AUDIO_FREQUENCY_MIN,0.1)
    bc.SetFloat(c4d.XM_AUDIO_FREQUENCY_MAX,0.1)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../res/description/omaudio.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseObject *pObject = BaseObject::Alloc(Omaudio);
    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(XM_AUDIO_ENABLED),GeData(true),flags);
    pObject->SetParameter(DescID(XM_AUDIO_MODE),GeData(XM_AUDIO_MODE_INDEP),flags);
    pObject->SetParameter(DescID(XM_AUDIO_FILE),GeData(Filename("c:\\SomeFile.txt"),flags);
    pObject->SetParameter(DescID(XM_AUDIO_AUTO),GeData(true),flags);
    pObject->SetParameter(DescID(XM_AUDIO_SCALE),GeData(0.1),flags);
    pObject->SetParameter(DescID(XM_AUDIO_LOOP),GeData(true),flags);
    pObject->SetParameter(DescID(XM_AUDIO_FFT),GeData(1),flags);
    pObject->SetParameter(DescID(XM_AUDIO_DB_RANGE),GeData(0.1),flags);
    pObject->SetParameter(DescID(XM_AUDIO_FREQUENCY_MIN),GeData(0.1),flags);
    pObject->SetParameter(DescID(XM_AUDIO_FREQUENCY_MAX),GeData(0.1),flags);
    pObject->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pObject->GetDataInstance();
    bc->SetBool(XM_AUDIO_ENABLED,true);
    bc->SetInt32(XM_AUDIO_MODE,XM_AUDIO_MODE_INDEP);
    bc->SetFileName(XM_AUDIO_FILE,"c:\\SomeFile.txt");
    bc->SetBool(XM_AUDIO_AUTO,true);
    bc->SetFloat(XM_AUDIO_SCALE,0.1);
    bc->SetBool(XM_AUDIO_LOOP,true);
    bc->SetInt32(XM_AUDIO_FFT,1);
    bc->SetFloat(XM_AUDIO_DB_RANGE,0.1);
    bc->SetFloat(XM_AUDIO_FREQUENCY_MIN,0.1);
    bc->SetFloat(XM_AUDIO_FREQUENCY_MAX,0.1);
    pObject->Message(MSG_UPDATE);                                                      
}
             

Buttons

This node has buttons. Buttons can manually be executed by calling the following code

Python

c4d.CallButton(obj,c4d.XM_AUDIO_GRAPH)
c4d.CallButton(obj,c4d.XM_AUDIO_ADD)
c4d.CallButton(obj,c4d.XM_AUDIO_RESET)

C++

DescriptionCommand dc;
dc.id = DescID(XM_AUDIO_GRAPH);             
pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);

DescriptionCommand dc; dc.id = DescID(XM_AUDIO_ADD); pObject->Message(MSG_DESCRIPTION_COMMAND, &dc);
DescriptionCommand dc; dc.id = DescID(XM_AUDIO_RESET); 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"
XM_AUDIO_FREQUENCY_COLOR
GeData data; pObject->GetParameter(DescID(XM_AUDIO_FREQUENCY_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); } pObject->SetParameter(DescID(XM_AUDIO_FREQUENCY_COLOR),data,DESCFLAGS_SET_PARAM_SET));