missing something
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/04/2008 at 07:15, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.5
Platform:
Language(s) : C.O.F.F.E.E ;---------
Can anyone see why this won't render?AS::Execute(doc, op) { op->InitLength(0); leng=op->GetLength(); space=op->GetUp()->GetContainer()->GetData(PRIM_CIRCLE_RADIUS); tMulti=op->GetUp()->GetContainer()->GetData(PRIM_CIRCLE_RADIUSY); var fps=doc->GetFps(); tt= doc->GetTime(); frame = tt->GetFrame(doc->GetFps()); t=frame/fps; FT=op->GetDown(); pos=space*ind/leng+space/leng*tMulti*t; FTC=FT->GetFirstTag()->GetContainer(); FTC->SetData(ALIGNTOSPLINETAG_POSITION,pos); FT->GetFirstTag()->SetContainer(FTC); FT->Message(MSG_UPDATE); op->Message(MSG_UPDATE); }
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/04/2008 at 11:38, xxxxxxxx wrote:
Apparently AlignToSpline can't be rendered with COFFEE, but if you make your own AlignToSpline function you can do the equivalent.
AS::Execute(doc, op) { op->InitLength(0); leng=op->GetLength(); space=op->GetUp()->GetContainer()->GetData(PRIM_CIRCLE_RADIUS); tMulti=op->GetUp()->GetContainer()->GetData(PRIM_CIRCLE_RADIUSY); var ind=0.0; var fps=doc->GetFps(); tt= doc->GetTime(); frame = tt->GetFrame(doc->GetFps()); t=frame/fps; FT=op->GetDown(); pos=space*ind/leng+space/leng*tMulti*t; locpos=op->GetSplinePoint(op->UniformTonatural(pos),0); wpos=op->GetMg()->GetMulP(locpos); FT->SetPosition(wpos); FT->Message(MSG_UPDATE); }
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/04/2008 at 11:47, xxxxxxxx wrote:
ATS renders just fine. It's that you can't just use "GetFirstTag()".
At rendertime the first tag could be something totally different.
You must search/iterate to get the correct Tag.Cheers
Lennart -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/04/2008 at 13:45, xxxxxxxx wrote:
Thanks Lennart, I inserted the iteration to find the ATS tag into the first code above and it works just like you said it would. It is weird that rendering changes tag order or adds tags..Robert told me to add the iteration last week when I was first working on this, but I was too lazy and I thought it was working. I am glad that the ATS method didn't work for me initially because I think I like the method of the second code above more where the plug does the ATS.... because then I don't have to create all those tags. Anyway both ways work for me now. Thanks
...code with iteration to find ATS tagAS::Execute(doc, op) { op->InitLength(0); leng=op->GetLength(); space=op->GetUp()->GetContainer()->GetData(PRIM_CIRCLE_RADIUS); tMulti=op->GetUp()->GetContainer()->GetData(PRIM_CIRCLE_RADIUSY); var ind=0.0; var fps=doc->GetFps(); tt= doc->GetTime(); frame = tt->GetFrame(doc->GetFps()); t=frame/fps; FT=op->GetDown(); pos=space*ind/leng+space/leng*tMulti*t; FTT=FT->GetFirstTag(); while(FTT&&FTT->GetType() != Taligntospline) { FTT=FTT->GetNext(); } FTC=FTT->GetContainer(); println(FTT->GetName()," FTT"); FTC->SetData(ALIGNTOSPLINETAG_POSITION,pos); FTT->SetContainer(FTC); FTT->Message(MSG_UPDATE); }
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/04/2008 at 14:50, xxxxxxxx wrote:
It is not the matter of reordering the Tags but new invisible rendertags
gets present.
As for iterating the correct Tag, use a function you can call at any time.
It is sort of "the first thing" I add in any expression I do.
Makes life easier.Cheers
Lennart>
\> class NN:ExpressionPluginTag \> { \> public: \> NN(); \> \> GetID(); \> \> MultipleAllowed(); \> DisplayAllowed(); \> \> GetIcon(); \> GetHelpText(); \> \> UseMenu(); \> GetName(); \> \> Edit(); \> \> Copy(dest); \> Save(hf); \> Load(hf); \> \> Message(type, data); \> \> GetFirstTag(obj,type); \> \> Execute(doc, op); \> Speedup(doc, op); \> \> } \> \> / \> / \> / \> \> NN::GetFirstTag(obj,type) \> { \> var tag = obj->GetFirstTag(); \> while (tag){ \> if (tag->GetType() == type) return tag; \> tag = tag->GetNext(); \> } \> return NULL; \> } \> \> \> NN::Execute(doc, op) \> \> { \> var theTag = GetFirstTag(op,ID); // ie GetFirstTag(op,Taligntospline) or GetFirstTag(op,5699) \> if(!theTag) return; \> \> //code \> \> } \>
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/04/2008 at 14:59, xxxxxxxx wrote:
crafty, looks like I'm goning to have to steal some more of your code. Thanks