THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/04/2011 at 19:00, xxxxxxxx wrote:
I'm trying to get feed back from my tag plugin, via print or MessageDialog. C4D is giving me zero feed back and I'm not sure if my code is even executed.
I'm using R12, any help would be appreciated.
import c4d
from c4d import plugins
from c4d import gui
PLUGIN_ID = 1234567890
class AnimationCacheTag(plugins.TagData) :
def Execute(self, tag, doc, op, bt, priority, flags) :
'''Run the tag code'''
time = doc.GetTime()
fps = doc.GetFps()
if(fps > 0) :
currentFrame = time / fps
msg = 'Current frame is: {0}'.foramt(currentFrame)
print(msg)
c4d.gui.MessageDialog(msg)
return c4d.EXECUTIONRESULT_OK
if __name__ == "__main__":
plugins.RegisterTagPlugin(id=PLUGIN_ID, str="Animation Cache Tag", g=AnimationCacheTag,
description="IDD_CACHEDIALOG", icon=None,
info=c4d.TAG_VISIBLE)