VPtext
Attributes
-
ENGLISH NAME : TextLayer
-
NAME : VPtext
-
INCLUDE : VPbase
-
PATH : newman/description/vptext.res
-
PLUGIN : newman
-
MAXON online help (may not exist): VPTEXT
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():
videoPost = c4d.BaseVideoPost(c4d.VPtext)
#You can set parameters two different ways.
#First way
videoPost[c4d.VP_TEXT_RENDER_OUTPUT_RENDER] = True
videoPost[c4d.VP_TEXT_RENDER_OUTPUT_VIDEOPOST] = True
videoPost[c4d.VP_TEXT_RENDER_OUTPUT_MULTIPASS] = True
videoPost[c4d.VP_TEXT_STRING] = "Hello World"
videoPost[c4d.VP_TEXT_U] = 0.1
videoPost[c4d.VP_TEXT_V] = 0.1
videoPost[c4d.VP_TEXT_TAB_SIZE] = 1
videoPost[c4d.VP_TEXT_ALIGN] = c4d.VP_TEXT_ALIGN_LEFT
videoPost[c4d.VP_TEXT_INFO_ALIGN] = c4d.VP_TEXT_INFO_ALIGN_TOP
videoPost[c4d.VP_TEXT_INFO_OBJECTCOUNT] = True
videoPost[c4d.VP_TEXT_INFO_LIGHTCOUNT] = True
videoPost[c4d.VP_TEXT_INFO_POLYGONCOUNT] = True
videoPost[c4d.VP_TEXT_INFO_VERTEXCOUNT] = True
videoPost[c4d.VP_TEXT_INFO_SCENETIME] = True
videoPost[c4d.VP_TEXT_PEN_OPACITY] = 0.1
videoPost[c4d.VP_TEXT_PAPER_OPACITY] = 0.1
videoPost[c4d.VP_TEXT_PAPER_BORDER] = 1
videoPost[c4d.VP_TEXT_PAPER_ROUNDING] = 1
videoPost[c4d.VP_TEXT_PAPER_DRAW_BORDER] = True
videoPost[c4d.VP_TEXT_WATERMARK_OPACITY] = 0.1
videoPost[c4d.VP_TEXT_WATERMARK_SCALE] = 0.1
videoPost[c4d.VP_TEXT_WATERMARK_V_ALIGN] = c4d.VP_TEXT_WATERMARK_TOP
videoPost[c4d.VP_TEXT_WATERMARK_H_ALIGN] = c4d.VP_TEXT_WATERMARK_LEFT
#Second way, using the base container.
bc = videoPost.GetDataInstance()
bc.SetBool(c4d.VP_TEXT_RENDER_OUTPUT_RENDER,True)
bc.SetBool(c4d.VP_TEXT_RENDER_OUTPUT_VIDEOPOST,True)
bc.SetBool(c4d.VP_TEXT_RENDER_OUTPUT_MULTIPASS,True)
bc.SetString(c4d.VP_TEXT_STRING,"Hello World")
bc.SetFloat(c4d.VP_TEXT_U,0.1)
bc.SetFloat(c4d.VP_TEXT_V,0.1)
bc.SetInt32(c4d.VP_TEXT_TAB_SIZE,1)
bc.SetInt32(c4d.VP_TEXT_ALIGN,c4d.VP_TEXT_ALIGN_LEFT)
bc.SetInt32(c4d.VP_TEXT_INFO_ALIGN,c4d.VP_TEXT_INFO_ALIGN_TOP)
bc.SetBool(c4d.VP_TEXT_INFO_OBJECTCOUNT,True)
bc.SetBool(c4d.VP_TEXT_INFO_LIGHTCOUNT,True)
bc.SetBool(c4d.VP_TEXT_INFO_POLYGONCOUNT,True)
bc.SetBool(c4d.VP_TEXT_INFO_VERTEXCOUNT,True)
bc.SetBool(c4d.VP_TEXT_INFO_SCENETIME,True)
bc.SetFloat(c4d.VP_TEXT_PEN_OPACITY,0.1)
bc.SetFloat(c4d.VP_TEXT_PAPER_OPACITY,0.1)
bc.SetInt32(c4d.VP_TEXT_PAPER_BORDER,1)
bc.SetInt32(c4d.VP_TEXT_PAPER_ROUNDING,1)
bc.SetBool(c4d.VP_TEXT_PAPER_DRAW_BORDER,True)
bc.SetFloat(c4d.VP_TEXT_WATERMARK_OPACITY,0.1)
bc.SetFloat(c4d.VP_TEXT_WATERMARK_SCALE,0.1)
bc.SetInt32(c4d.VP_TEXT_WATERMARK_V_ALIGN,c4d.VP_TEXT_WATERMARK_TOP)
bc.SetInt32(c4d.VP_TEXT_WATERMARK_H_ALIGN,c4d.VP_TEXT_WATERMARK_LEFT)
if __name__=='__main__':
main()
C++
#include "c4d.h"
#include "../newman/description/vptext.h"
void SampleFunction()
{
BaseDocument *pDoc = GetActiveDocument();
BaseVideoPost *pVideoPost = BaseVideoPost::Alloc(VPtext);
//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;
pVideoPost->SetParameter(DescID(VP_TEXT_RENDER_OUTPUT_RENDER),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_RENDER_OUTPUT_VIDEOPOST),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_RENDER_OUTPUT_MULTIPASS),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_STRING),GeData("Hello World"),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_U),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_V),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_TAB_SIZE),GeData(1),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_ALIGN),GeData(VP_TEXT_ALIGN_LEFT),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_INFO_ALIGN),GeData(VP_TEXT_INFO_ALIGN_TOP),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_INFO_OBJECTCOUNT),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_INFO_LIGHTCOUNT),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_INFO_POLYGONCOUNT),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_INFO_VERTEXCOUNT),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_INFO_SCENETIME),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_PEN_OPACITY),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_PAPER_OPACITY),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_PAPER_BORDER),GeData(1),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_PAPER_ROUNDING),GeData(1),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_PAPER_DRAW_BORDER),GeData(true),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_WATERMARK_OPACITY),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_WATERMARK_SCALE),GeData(0.1),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_WATERMARK_V_ALIGN),GeData(VP_TEXT_WATERMARK_TOP),flags);
pVideoPost->SetParameter(DescID(VP_TEXT_WATERMARK_H_ALIGN),GeData(VP_TEXT_WATERMARK_LEFT),flags);
pVideoPost->Message(MSG_UPDATE);
//Second way, using the base container.
BaseContainer *bc = pVideoPost->GetDataInstance();
bc->SetBool(VP_TEXT_RENDER_OUTPUT_RENDER,true);
bc->SetBool(VP_TEXT_RENDER_OUTPUT_VIDEOPOST,true);
bc->SetBool(VP_TEXT_RENDER_OUTPUT_MULTIPASS,true);
bc->SetString(VP_TEXT_STRING,"Hello World");
bc->SetFloat(VP_TEXT_U,0.1);
bc->SetFloat(VP_TEXT_V,0.1);
bc->SetInt32(VP_TEXT_TAB_SIZE,1);
bc->SetInt32(VP_TEXT_ALIGN,VP_TEXT_ALIGN_LEFT);
bc->SetInt32(VP_TEXT_INFO_ALIGN,VP_TEXT_INFO_ALIGN_TOP);
bc->SetBool(VP_TEXT_INFO_OBJECTCOUNT,true);
bc->SetBool(VP_TEXT_INFO_LIGHTCOUNT,true);
bc->SetBool(VP_TEXT_INFO_POLYGONCOUNT,true);
bc->SetBool(VP_TEXT_INFO_VERTEXCOUNT,true);
bc->SetBool(VP_TEXT_INFO_SCENETIME,true);
bc->SetFloat(VP_TEXT_PEN_OPACITY,0.1);
bc->SetFloat(VP_TEXT_PAPER_OPACITY,0.1);
bc->SetInt32(VP_TEXT_PAPER_BORDER,1);
bc->SetInt32(VP_TEXT_PAPER_ROUNDING,1);
bc->SetBool(VP_TEXT_PAPER_DRAW_BORDER,true);
bc->SetFloat(VP_TEXT_WATERMARK_OPACITY,0.1);
bc->SetFloat(VP_TEXT_WATERMARK_SCALE,0.1);
bc->SetInt32(VP_TEXT_WATERMARK_V_ALIGN,VP_TEXT_WATERMARK_TOP);
bc->SetInt32(VP_TEXT_WATERMARK_H_ALIGN,VP_TEXT_WATERMARK_LEFT);
pVideoPost->Message(MSG_UPDATE);
}