Quick Tip : Find Object Type via CoffeeScript Cinema 4D

0

This post has already been read 1773 times!

We can find object type using GetType() command. Here is an example code and object type list for Cinema 4D Coffee Script ;

Sample Code;

main()

{
var doc = GetActiveDocument();
var obj = Object;

var tip = obj->GetType();

if (obj->GetType() == OBJECT_SPLINE)
{ result = “Spline”; }

if (obj->GetType() == OBJECT_POLYGON)
{ result = “Polygon”; }

}

Object Type List for Cinema 4D Coffee Script

OBJECT_POLYGON=5100,
OBJECT_SPLINE=5101,
OBJECT_LIGHT=5102,
OBJECT_CAMERA=5103,
OBJECT_FLOOR=5104,
OBJECT_SKY=5105,
OBJECT_ENVIRONMENT=5106,
OBJECT_LOFT=5107,
OBJECT_FFD=5108,
OBJECT_PARTICLE=5109,
OBJECT_DEFLECTOR=5110,
OBJECT_GRAVITATION=5111,
OBJECT_ROTATION=5112,
OBJECT_WIND=5113,
OBJECT_FRICTION=5114,
OBJECT_TURBULENCE=5115,
OBJECT_EXTRUDE=5116,
OBJECT_LATHE=5117,
OBJECT_SWEEP=5118,
OBJECT_ATTRACTOR=5119,
OBJECT_BEZIER=5120,
OBJECT_FOREGROUND=5121,
OBJECT_BACKGROUND=5122,
OBJECT_BONE=5123,
OBJECT_DESTRUCTOR=5124,
OBJECT_METABALL=5125,
OBJECT_INSTANCE=5126,
OBJECT_HYPERNURBS=5127,
OBJECT_BEND=5128,
OBJECT_BULGE=5129,
OBJECT_SHEAR=5131,
OBJECT_TAPER=5133,
OBJECT_TWIST=5134,
OBJECT_WAVE=5135,
OBJECT_STAGE=5136,
OBJECT_MICROPHONE=5138,
OBJECT_LOUDSPEAKER=5139,
OBJECT_NULL=5140,
OBJECT_PRIMITIVE=5141,
OBJECT_SYMMETRY=5142,
OBJECT_WRAP=5143,
OBJECT_BOOLE=1010865,
OBJECT_EXPLOSION=5145,
OBJECT_FORMULA=5146,
OBJECT_MELT=5147,
OBJECT_SHATTER=5148,
OBJECT_WINDDEFORM=5149,
OBJECT_ARRAY=5150,
OBJECT_HEADPHONE=5151,
OBJECT_SPLINEPRIMITIVE=5152,
OBJECT_CONPLANE=5153,
OBJECT_CUBE=5159,
OBJECT_SPHERE=5160,
OBJECT_PLATONIC=5161,
OBJECT_CONE=5162,
OBJECT_TORUS=5163,
OBJECT_DISC=5164,
OBJECT_TUBE=5165,
OBJECT_FIGURE=5166,
OBJECT_PYRAMID=5167,
OBJECT_PLANE=5168,
OBJECT_FRACTAL=5169,
OBJECT_CYLINDER=5170,
OBJECT_CAPSULE=5171,
OBJECT_OILTANK=5172,
OBJECT_RELIEF=5173,
OBJECT_POLY=5174,
OBJECT_SPLINEFORMULA=5177,
OBJECT_SPLINETEXT=5178,
OBJECT_SPLINENSIDE=5179,
OBJECT_SPLINE4SIDE=5180,
OBJECT_SPLINECIRCLE=5181,
OBJECT_SPLINEARC=5182,
OBJECT_SPLINECISSOID=5183,
OBJECT_SPLINECYCLOID=5184,
OBJECT_SPLINEPROFILE=5175,
OBJECT_SPLINEHELIX=5185,
OBJECT_SPLINERECTANGLE=5186,
OBJECT_SPLINEFLOWER=5176,
OBJECT_SPLINESTAR=5187,
OBJECT_SPLINECOGWHEEL=5188,
OBJECT_SPLINECONTOUR=5189,

Leave a Reply