This documentation is for the free plugin Py4D in CINEMA 4D R11.5 and not for the C4DSDK of Python in CINEMA 4D R12. For R12, please visit PluginCafe.com

c4d.plugins.TagData

A data class for tag plugins. Use RegisterTagPlugin to register the plugin. Registered tag plugins appear in the New Tag menu and can be attached to objects.

Note

Before you start writing your own TagData plugin, you should read SuperClass before.

class c4d.plugins.TagData

//Methods to override

SuperClass

NodeData

Methods

TagData.Init(self, tag)

Override - Called when a new instance of the node plugin has been allocated.

Note

If your class has a constructor it is called as usual before this function, but at that time there’s no object link established.

Parameter:tag (BaseTag) –

The object which is established with this instance.

Warning

Please note, if you return False, the object will not be created.

Return type:bool
Returns:True on success, otherwise False.
TagData.Message(self, tag, type, data)

Override - Called by BaseList2D.Message.

Parameters:
  • tag (BaseTag) – The object which is established with this instance.
  • type (int) – The message ID.
  • data (any) – The message data.
Return type:

bool

Returns:

True on success, otherwise False.

TagData.Draw(self, tag, op, bd, bh)

Override - Called when the display is updated for you to display some visual element of your tag in the 3D view.

Note

Important: This function is called in a thread context. Please see the important information about threading.

Parameters:
  • tag (BaseTag) – The object which is established with this instance.
  • op (BaseObject) – The host object of the tag.
  • bd (BaseDraw) – The editor’s view.
  • bh (BaseDrawHelp) – An helper class.
Return type:

bool

Returns:

Success of drawing into the editor view.

TagData.Execute(self, tag, doc, op, bt, priority, flags)

Override - Called at the point when the tag is executed.

Note

Important: This function is called in a thread context. Please see the important information about threading.

Parameters:
  • tag (BaseDocument) – The established BaseTag.
  • doc (BaseDocument) – The host document of the tag’s object.
  • op (BaseObject) – The host object of the tag.
  • bt (None) – Currently not used.
  • priority (int) –

    One of the followin flags:

    EXECUTION_INITIAL Initial
    EXECUTION_ANIMATION Animation
    EXECUTION_EXPRESSION Expressions
    EXECUTION_DYNAMICS Dynamics
    EXECUTION_GENERATOR Generators
  • flags (int) –

    A combination of the following flags:

    SCENEHOOKEXECUTION_ANIMATION Animation is calculated.
    SCENEHOOKEXECUTION_EXPRESSION Expressions are calculated.
    SCENEHOOKEXECUTION_CACHEBUILDING Cache building is done.
    SCENEHOOKEXECUTION_CAMERAONLY Only camera dependent expressions shall be executed.
    SCENEHOOKEXECUTION_INDRAG Pipeline is done within scrubbing.
    SCENEHOOKEXECUTION_INMOVE Pipeline is done within moving.
    SCENEHOOKEXECUTION_RENDER The external renderer (picture viewer) is running.
Return type:

int

Returns:

One of the following results:

EXECUTION_RESULT_OK

OK.

EXECUTION_RESULT_USERBREAK

User break.

EXECUTION_RESULT_MEMORYERROR

Memory error.

TagData.Free(self, tag)

Override - If your class has a destructor it is called as usual after this function.

Parameter:tag (BaseTag) – The object which is established with this instance.

Table Of Contents

This Page