Omograph_text
Attributes
-
ENGLISH NAME : Text
-
NAME : Omograph_text
-
INCLUDE : Obase
-
PATH : mograph/description/omograph_text.res
-
PLUGIN : mograph
-
MAXON online help (may not exist): OMOGRAPH_TEXT
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.Omograph_text)
doc.InsertObject(obj)
c4d.EventAdd(c4d.EVENT_FORCEREDRAW)
#You can set parameters two different ways.
#First way
obj[c4d.MGTEXTOBJECT_SPLINEMOVE] = 0.1
obj[c4d.MGTEXTOBJECT_SPLINESUB] = 1
obj[c4d.MGTEXTOBJECT_INDEXING] = c4d.MGTEXTOBJECT_WORDINDEX
obj[c4d.MGTEXTOBJECT_AXIS_ALL] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.MGTEXTOBJECT_AXIS_LINE] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.MGTEXTOBJECT_AXIS_LINE_ALIGN] = True
obj[c4d.MGTEXTOBJECT_AXIS_WORD] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.MGTEXTOBJECT_AXIS_WORD_ALIGN] = True
obj[c4d.MGTEXTOBJECT_AXIS_CHAR] = c4d.Vector(1.0,1.0,1.0)
obj[c4d.MGTEXTOBJECT_AXIS_CHAR_ALIGN] = True
#Second way, using the base container.
bc = obj.GetDataInstance()
bc.SetFloat(c4d.MGTEXTOBJECT_SPLINEMOVE,0.1)
bc.SetInt32(c4d.MGTEXTOBJECT_SPLINESUB,1)
bc.SetInt32(c4d.MGTEXTOBJECT_INDEXING,c4d.MGTEXTOBJECT_WORDINDEX)
bc.SetVector(c4d.MGTEXTOBJECT_AXIS_ALL, c4d.Vector(1.0,1.0,1.0)
bc.SetVector(c4d.MGTEXTOBJECT_AXIS_LINE, c4d.Vector(1.0,1.0,1.0)
bc.SetBool(c4d.MGTEXTOBJECT_AXIS_LINE_ALIGN,True)
bc.SetVector(c4d.MGTEXTOBJECT_AXIS_WORD, c4d.Vector(1.0,1.0,1.0)
bc.SetBool(c4d.MGTEXTOBJECT_AXIS_WORD_ALIGN,True)
bc.SetVector(c4d.MGTEXTOBJECT_AXIS_CHAR, c4d.Vector(1.0,1.0,1.0)
bc.SetBool(c4d.MGTEXTOBJECT_AXIS_CHAR_ALIGN,True)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../mograph/description/omograph_text.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseObject *pObject = BaseObject::Alloc(Omograph_text);
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(MGTEXTOBJECT_SPLINEMOVE),GeData(0.1),flags);
pObject->SetParameter(DescID(MGTEXTOBJECT_SPLINESUB),GeData(1),flags);
pObject->SetParameter(DescID(MGTEXTOBJECT_INDEXING),GeData(MGTEXTOBJECT_WORDINDEX),flags);
pObject->SetParameter(DescID(MGTEXTOBJECT_AXIS_ALL),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(MGTEXTOBJECT_AXIS_LINE),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(MGTEXTOBJECT_AXIS_LINE_ALIGN),GeData(true),flags);
pObject->SetParameter(DescID(MGTEXTOBJECT_AXIS_WORD),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(MGTEXTOBJECT_AXIS_WORD_ALIGN),GeData(true),flags);
pObject->SetParameter(DescID(MGTEXTOBJECT_AXIS_CHAR),GeData(Vector(1.0,1.0,1.0)),flags);
pObject->SetParameter(DescID(MGTEXTOBJECT_AXIS_CHAR_ALIGN),GeData(true),flags);
pObject->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pObject->GetDataInstance();
bc->SetFloat(MGTEXTOBJECT_SPLINEMOVE,0.1);
bc->SetInt32(MGTEXTOBJECT_SPLINESUB,1);
bc->SetInt32(MGTEXTOBJECT_INDEXING,MGTEXTOBJECT_WORDINDEX);
bc->SetVector(MGTEXTOBJECT_AXIS_ALL, c4d.Vector(1.0,1.0,1.0);
bc->SetVector(MGTEXTOBJECT_AXIS_LINE, c4d.Vector(1.0,1.0,1.0);
bc->SetBool(MGTEXTOBJECT_AXIS_LINE_ALIGN,true);
bc->SetVector(MGTEXTOBJECT_AXIS_WORD, c4d.Vector(1.0,1.0,1.0);
bc->SetBool(MGTEXTOBJECT_AXIS_WORD_ALIGN,true);
bc->SetVector(MGTEXTOBJECT_AXIS_CHAR, c4d.Vector(1.0,1.0,1.0);
bc->SetBool(MGTEXTOBJECT_AXIS_CHAR_ALIGN,true);
pObject->Message(MSG_UPDATE);
}