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 NodeData Management and Writing delta time plugins before.

See also

Py-LookAtCamera plugin example.

class c4d.plugins. TagData

Inheritance

Methods

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

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

Parameters:
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

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

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

    One of the following flags:

    EXECUTIONPRIORITY_INITIAL Initial.
    EXECUTIONPRIORITY_ANIMATION Animation.
    EXECUTIONPRIORITY_ANIMATION_NLA NLA.
    EXECUTIONPRIORITY_EXPRESSION Expression.
    EXECUTIONPRIORITY_DYNAMICS Dynamics (R11.5).
    EXECUTIONPRIORITY_GENERATOR Generators.
  • flags ( int ) –

    A combination of the following flags:

    EXECUTIONFLAGS_0 None.
    EXECUTIONFLAGS_ANIMATION Animation is calculated.
    EXECUTIONFLAGS_EXPRESSION Expressions are calculated.
    EXECUTIONFLAGS_CACHEBUILDING Cache building is done.
    EXECUTIONFLAGS_CAMERAONLY Only camera dependent expressions shall be executed.
    EXECUTIONFLAGS_INDRAG Pipeline is done within scrubbing.
    EXECUTIONFLAGS_INMOVE Pipeline is done within moving.
    EXECUTIONFLAGS_RENDER The external renderer (picture viewer) is running.
Return type:

int

Returns:

One of the following results:

EXECUTIONRESULT_OK OK.
EXECUTIONRESULT_USERBREAK User break.
EXECUTIONRESULT_MEMORYERROR Memory error.

TagData. AddToExecution ( self , tag , list )

Override - By default this function returns False . Then Cinema 4D will call Execute() at the priority specified by the user in the EXPRESSION_PRIORITY parameter of the container.

If you override this function and return True , then you can insert your own points of execution in the list by calling for example:

list.Add(tag, EXECUTIONPRIORITY_ANIMATION, 0)
list.Add(tag, EXECUTIONPRIORITY_GENERATOR, 0)
						

Cinema 4D will then call Execute() two times.

Parameters:
Return type:

bool

Returns:

True if you override this function and have added stuff to list.

Table Of Contents