coffee render problem
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/12/2006 at 17:32, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10
Platform: Mac OSX ;
Language(s) : C.O.F.F.E.E ;---------
hello everybody
i got stuck in a render problem with coffee. hopefully someone can help me. i have no idea anymore...i am accessing the current frame of my scene to change the scale of my object. switching through timeline with mouse works fine (means cube size changes due to current chosen frame) but if i render its just rendering the current frame (which is somehow logic) means nothing more then the same frame again and again... if i add keyframes for each frame it works but i really need it to render automatically.
simple code added to a cube named "Cube" as coffee tag for you to know what i mean
main(doc,op){ var obj = GetActiveDocument()->FindObject("Cube"); var t = doc->GetTime(); var sec = t->GetSecond(); var frame = t->GetFrame(doc->GetFps()); obj#ID_BASEOBJECT_SCALE:VECTOR_X = frame; obj#ID_BASEOBJECT_SCALE:VECTOR_Y = frame; obj#ID_BASEOBJECT_SCALE:VECTOR_Z = frame; }
alternatives how to get this done are welcome, i know its possible to access the current frame as well as to render it with xpresso but i need to do it with coffee since
i need to be flexible and script everything.thank you in advance.
sebastian -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 20/12/2006 at 06:40, xxxxxxxx wrote:
For some strange reason, doc->FindObject() works well in editor but returns null in preview or rendering. You have to pick the object in other ways, for example assigning it the COFFEE tag and modifying the code in this way:
main(doc,op){var t = doc->GetTime();
var sec = t->GetSecond();
var frame = t->GetFrame(doc->GetFps());
op#ID_BASEOBJECT_SCALE:VECTOR_X = frame;
op#ID_BASEOBJECT_SCALE:VECTOR_Y = frame;
op#ID_BASEOBJECT_SCALE:VECTOR_Z = frame;}
Riccardo -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/12/2006 at 08:27, xxxxxxxx wrote:
thank you very much for your reply. do you know why it is like that? is there any alternative to get more flexibility?
same problem with GetNext() as well as GetFirstObject().
since i need to access the attributes of a few hundred cubes with different names and different properties (read out external movie, each pixel to be represented by one object) i need to change them separately due to different information.
sebastian
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/12/2006 at 02:44, xxxxxxxx wrote:
Here is a corrected version of your little example. You have to use to passed doc parameter of the main(doc,op). When using GetActiveDocument you get the real document but for rendering a clone of this document will be used.
main(doc,op) { var obj = doc->FindObject("Cube"); var t = doc->GetTime(); var sec = t->GetSecond(); var frame = t->GetFrame(doc->GetFps()); obj#ID_BASEOBJECT_SCALE:VECTOR_X = frame; obj#ID_BASEOBJECT_SCALE:VECTOR_Y = frame; obj#ID_BASEOBJECT_SCALE:VECTOR_Z = frame; }
cheers,
Matthias -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 24/03/2008 at 14:36, xxxxxxxx wrote:
what if my function isn't in main. can I assign a global variable to doc
realdoc=doc;
or can I send doc as an argument in my functions? the global option doesn't seem to be working. I am calling my function from a coremessage in my dialog class. The function is in another class....
PointTonull::MovePoints() { for(i=0;i<3;i++) { println(nunames[0][i]); } pDoc=GetActiveDocument(); while(nunames[m][o]!=NULL) { while(nunames[m][o]!=NULL) { nObj=realdoc->FindObject(nunames[m][o]); spObj=realdoc->FindObject("TTC"); nName=nObj->GetName(); len=sizeof(nName); println(nName); inde=strmid(nName,len-1,len-1); iObj=spObj->GetMg(); iObj->Invert(); spObj->SetPoint(evaluate(inde),iObj->GetMulP(nObj->GetPosition())); spObj->Message(MSG_UPDATE); MyDialog::CoreMessage(id,msg) { switch (id) { case DOCUMENT_CHANGED: case TIMELINE_CHANGED: { println("ACT OBJECTIVELY"); pPoints->MovePoints(); break; } } } main(doc,op) { realdoc=doc;
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 24/03/2008 at 21:26, xxxxxxxx wrote:
Not sure if global will work (worth a try). If not, simply pass the variable 'doc' to your methods that need it.
Or, even better if you have your own class, make a member and set it:
class MyClass
{
var doc;
...
InitMyClass(t_doc);
...
}
MyClass::InitMyClass(t_doc)
{
doc = t_doc;
}
main(doc,op)
{
var class = new(myClass);
class->InitMyClass(doc);
}Then you can use it anywhere in your class methods.
*Pardon my COFFEE - I'm pretty much strict C++ these days.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/03/2008 at 05:21, xxxxxxxx wrote:
Awesome, Thanks Robert This is alot more elegant and effective than declaring a million global variables as I have been doing. Using globals has worked for almost everything for me except this. Thanks again!