Get ObjectType in xpresso COFFEE node

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

On 04/08/2005 at 05:23, xxxxxxxx wrote:

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

---------
Hi.
My very first attempt using COFFEE, please be kind 🙂
For this I am using a COFFE xpresso Node.
I'm trying to get a 0 or 1 value if a SplineObject is connected to Input1 of a COFFE node. If it is not a SplineObject or if no object is connected then output is 0. If SplineObject is present then output = 1.

Input1 is a "Link" Output1 is "Real".

The code so far is:

  
main()  
  
{  
var object = Input1->GetObject();  
  
if (Input1= OBJECT_SPLINE)  
{  
Output1=1;  
}  
else Output1=0;  
}  

This gives "No Errors" in editor. But the COFFE Node doesnt work...
I am studying the SDK also but this is pretty new to me.

Cheers
Lennart

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

On 04/08/2005 at 06:23, xxxxxxxx wrote:

For compares (if, while) use "==", not "=". Common mistake. 🙂

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

On 04/08/2005 at 14:26, xxxxxxxx wrote:

Thanks kuroyume0161!
I've managed to make my very first cup of Coffe!
I'll try taking it a step further.
If Input is Spline, pass a position along it, if not pass vector(0,0,0)
Wish me luck...
The code ended up:

<CODE>
main()

{
var Type = Input1 ->GetType();

if (Type == OBJECT_SPLINE)

{
Output2=TRUE;
}
else Output2=FALSE;
}
</CODE>

Cheers
Lennart

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

On 04/08/2005 at 14:58, xxxxxxxx wrote:

I'm hot! (Well, happy anyway...)

Input2 and Output2 being vectors.

  
main()  
  
{  
var Type = Input1 ->GetType();  
  
if (Type == OBJECT_SPLINE)  
  
{  
Output1=TRUE;  
Output2=Input2;  
}  
else   
{Output1=FALSE;  
Output2=(0.0.0);  
}  
}  

Cheers
Lennart