c4d.plugins.TagData

class 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.

Methods Signatures

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.

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

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

TagData.AddToExecution(self, tag, list)

Override - By default this function returns False.

Inheritance

Parent Class:

Methods Documentation

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 (c4d.threading.BaseThread) – The calling thread.

  • priority (int) –

    One of the following flags:

    EXECUTIONPRIORITY_INITIAL

    Initial.

    EXECUTIONPRIORITY_ANIMATION

    Animation.

    EXECUTIONPRIORITY_ANIMATION_NLA

    NLA.

    EXECUTIONPRIORITY_EXPRESSION

    Expression.

    EXECUTIONPRIORITY_DYNAMICS

    Dynamics.

    EXECUTIONPRIORITY_GENERATOR

    Generators.

    EXECUTIONPRIORITY_SCENENODE

    Scene nodes.

    EXECUTIONPRIORITY_FORCE

    Highest priority that will ensure execution even if the execution pipeline is cancelled before. Only use this to e.g. release locks or do super-fast non-blocking operations.

  • flags (int) –

    A combination of the following flags:

    EXECUTIONFLAGS_NONE

    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.

    EXECUTIONFLAGS_ALLOW_PRIORITYSHIFT

    New in version R18: Allow to shift the priority with the priority shift tag. Private.

Return type

int

Returns

One of the following results:

EXECUTIONRESULT_OK

OK.

EXECUTIONRESULT_USERBREAK

User break.

EXECUTIONRESULT_MEMORYERROR

Not enough memory.

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.