Skip to content

Instantly share code, notes, and snippets.

@990adjustments
Created August 4, 2012 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 990adjustments/3253460 to your computer and use it in GitHub Desktop.
Save 990adjustments/3253460 to your computer and use it in GitHub Desktop.
A Cinema 4D C.O.F.F.E.E. script that creates a sky object and applies a compositing tag that has several attributes off by default and assigns a new material with all channels off except luminance.
main(doc,op)
{
// Create sky object
CallCommand(5105);
var sky = doc-> GetActiveObject();
// Insert a compositing tag on selected object and adjust some attributes
var compositingTag = AllocTag(Tcompositing);
compositingTag#COMPOSITINGTAG_SEENBYCAMERA = 0;
compositingTag#COMPOSITINGTAG_CASTSHADOW = 0;
compositingTag#COMPOSITINGTAG_RECEIVESHADOW = 0;
compositingTag#COMPOSITINGTAG_SELFSHADOW = 0;
sky->InsertTag(compositingTag);
// Create new material
CallCommand(13015);
var mat = doc->GetFirstMaterial();
mat->SetChannelState(CHANNEL_LUMINANCE, true);
mat->SetChannelState(CHANNEL_COLOR, false);
mat->SetChannelState(CHANNEL_SPECULAR, false);
mat->Update();
mat->SetName("Sky_Material");
// Assign material to sky object
var skySel = doc->SetActiveObject(sky);
CallCommand(12169);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment