Invalid description ID of object

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 30/12/2009 at 09:57, xxxxxxxx wrote:

User Information:
Cinema 4D Version:    
Platform:      
Language(s) :   C.O.F.F.E.E  ;   XPRESSO  ;

---------
Hello,

I have a simple C.O.F.F.E.E - Script and when I pull play, it works fine but if I want to render it, it does not work anymore.

The script goes between 0 and 100% of an align to spline tag.

I get that Error:
COFFFEE ERROR!
(17) Invalid description ID of object
File: expression
Line: 6

var k=1;  
main(doc,op)  
{  
var Spos;  
var fosp=op->GetFirstTag();  
if (fosp#ALIGNTOSPLINETAG_POSITION == 0) k=1;  
if (fosp#ALIGNTOSPLINETAG_POSITION == 1) k=0;  
if (fosp#ALIGNTOSPLINETAG_POSITION >= 0 & k==1) Spos=0.02;  
if (fosp#ALIGNTOSPLINETAG_POSITION <= 1 & k==0) Spos=-0.02;  
fosp#ALIGNTOSPLINETAG_POSITION=fosp#ALIGNTOSPLINETAG_POSITION+Spos;  
}

I have the same 'animation' with XPresso via flip-flop and the render is ok.

What is wrong with ALIGNTOSPLINETAG_POSITION?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 30/12/2009 at 11:12, xxxxxxxx wrote:

At render Cinema uses a copy of your document.
(So you can still keep working on your document while rendering)
That render document has hidden tags, thus "GetFirstTag()" could be anything.

You need to search for your tag by its ID.
You might use a function for this like:

  
GetTheTag(op,type)   
{   
var tag = op->GetFirstTag();   
while (tag){   
if (tag->GetType() == type) return tag;   
tag = tag->GetNext();   
}   
return NULL;   
}   
  
main(doc,op)   
{   
var theTag = GetTheTag(op,ID); // ie GetTheTag(op,Taligntospline) or GetTheTag(op,5699)   
if(!theTag) return;   
// Your code   
  
}   

Cheers
Lennart

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 31/12/2009 at 05:30, xxxxxxxx wrote:

Thank you, but I get the same error.

Is there an other way to get the tag?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 31/12/2009 at 07:59, xxxxxxxx wrote:

Maybe, but this is how I and most of us do I think.
You might check any spelling in the code, sometimes copy and paste can trick you.
The following works just fine here (having a Cube with an AlignToSpline Tag to it)
The cube travels back and forth.

  
GetTheTag(op,type)   
{   
var tag = op->GetFirstTag();   
while (tag){   
if (tag->GetType() == type) return tag;   
tag = tag->GetNext();   
}   
return NULL;   
}   
  
var k=1;   
  
main(doc,op)   
  
{   
var Spos;   
var fosp=GetTheTag(op,Taligntospline);   
if(!fosp) return;   
if (fosp#ALIGNTOSPLINETAG_POSITION == 0) k=1;   
if (fosp#ALIGNTOSPLINETAG_POSITION == 1) k=0;   
if (fosp#ALIGNTOSPLINETAG_POSITION >= 0 & k==1) Spos=0.02;   
if (fosp#ALIGNTOSPLINETAG_POSITION <= 1 & k==0) Spos=-0.02;   
fosp#ALIGNTOSPLINETAG_POSITION=fosp#ALIGNTOSPLINETAG_POSITION+Spos;   
}   

Cheers
Lennart

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 01/01/2010 at 05:34, xxxxxxxx wrote:

Happy New Year,

Yes you are right. I copy and paste and do not really looked at the syntax. Now it works fine. Thank you.