{"id":86,"date":"2009-09-12T03:35:52","date_gmt":"2009-09-12T03:35:52","guid":{"rendered":"http:\/\/sugarandcyanide.com\/blog\/?p=86"},"modified":"2009-09-12T03:35:52","modified_gmt":"2009-09-12T03:35:52","slug":"playing-in-coffee","status":"publish","type":"post","link":"http:\/\/sugarandcyanide.com\/blog\/2009\/09\/12\/playing-in-coffee\/","title":{"rendered":"playing in coffee"},"content":{"rendered":"<p>I&#8217;m slowly coming out of the fog of Maya, now that I&#8217;m done with using it for Animation Mentor, and I&#8217;ve been trying to get back into Cinema 4D.  I just wanted to post this short COFFEE script snippet.  This looks through all the animation curves on an object and spits out information on them.<\/p>\n<pre>\nvar op = doc->GetActiveObject();\nvar curTime = doc->GetTime();\n\nprintln(\"\\nKey dump for \", op->GetName(), \":\\n\");\n\nvar t = op->GetFirstCTrack();\nif (t == NULL)\n\tprintln(\"Error.\");\n\nvar i = 0;\nvar j = 0;\nvar k;\nvar c;\n\nwhile (t != NULL) {\n\ti++;\n\tc = t->GetCurve();\n\tprintln(\"\\tTrack \", i, \": \", t->GetName(), \" -- \",\n\tc->GetKeyCount(), \" keys.\");\n\n\tfor (j = 0; j < c->GetKeyCount(); j++) {\n\t\tk = c->GetKey(j);\n\t\tvar bt = k->GetTime();\n\t\tprintln(\"\\t\\t\", j, \": v\", k->GetValue(), \", t:\", bt->GetFrame(30));\n\t}\n\n\tt = t->GetNext();\n}\n\nprintln(\"Number of tracks: \", i);\n\n<\/pre>\n<p>The sad part is this: you can&#8217;t add new keys to curves in COFFEE; you can only read what&#8217;s there.  (EPIC FAIL, Maxon.)  At least now I know how to get keys and how the BaseTime class works.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m slowly coming out of the fog of Maya, now that I&#8217;m done with using it for Animation Mentor, and I&#8217;ve been trying to get back into Cinema 4D. I just wanted to post this short COFFEE script snippet. This looks through all the animation curves on an object and spits out information on them. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6,7,15],"tags":[],"class_list":["post-86","post","type-post","status-publish","format-standard","hentry","category-3d","category-cinema4d","category-coffee","category-programming"],"_links":{"self":[{"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":0,"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"wp:attachment":[{"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}