Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 11/01/2006 at 05:18, xxxxxxxx wrote:
User Information: Cinema 4D Version: 9 Platform: Windows ; Language(s) : C.O.F.F.E.E ;
--------- Dear Friends of Cinema 4D, I have found a coffee script of an bone tail, but it doesn't work. I have copied it from a cinema bood by sven hauth, I have got an error message in line 9 and 2. I have started since 4 days to understand the coffee language, I am a beginner with coffee scripts bye, and perhaps somebody can help me, best regards to all cinema users, Frankolino Mistake and Fault in Line with "var opcnt..." // Script for BoneDirection "TailSpline" begins currentobjName = Get("Bone"); Var opcnt=>15; Main(dock,op){ Var op1=op; Var jsobj=doc->GetJS("TailSpline"); sop->InitLength(1); var mat,smat=sop->GetMg(),pos,pos1,I=0.0,bc,rot; while (op1){ I++; Pos=smat->GetMulP(sop->GetSplinePoint(sop-> UniformTonatural((I-1)/opcnt),1)); pos1=smat->GetMulP(sop->GetSplinePoint(sop-> UniformTonatural((i)/opcnt),1)); mat=op1->GetUpMg(); mat->Invert(); pos=mat->GetMulP(pos); pos1=mat->GetMulP(pos1); rot=VectorToHPB(pos1-pos) ; op1->SetRotation(rot); op1=op1->GetDown(); } // Script for BoneDirection "TailSpline" ends <file://===================> }
On 11/01/2006 at 06:24, xxxxxxxx wrote:
For line 2: var opcnt = 15; (removed the '>'). Is that in the code or is it a typo? For line 9: I++ is illegal for real (floating point) values (only integral values). If you want to increment a real value, do this instead: I = I+1.0; If COFFEE supports it (not sure), you could do it shorthand: I += 1.0;
HTH!
On 11/01/2006 at 06:52, xxxxxxxx wrote:
Hi Robert, very good! - I will try it. Many thanks! Frankolino