Here you will find documentation on all the descriptions that Cinema 4D currently has. You can list them Alphabetically, by Type or Plugin . The sample Python and C++ code is automatically generated and in some cases may not be 100% correct. If something doesn't work then please refer to the official Cinema 4D SDK documentation for more information.

IDs and information for XSLAProjector

XSLAProjector

Attributes

  • ENGLISH NAME : ProjectionShader
  • NAME : XSLAProjector
  • INCLUDE : Mpreview
  • INCLUDE : Xbase
  • PATH : sla/description/xslaprojector.res
  • PLUGIN : sla
  • MAXON online help (may not exist): XSLAPROJECTOR

Elements

ID UI Name Type Parameters Cycle
SLA_PROJECTOR_TEXTURE Texture SHADERLINK  
SLA_PROJECTOR_PROJECTION Projection LONG  
SLA_PROJECTOR_PROJECTION_SPHERICAL Spherical
SLA_PROJECTOR_PROJECTION_CYLINDRICAL Cylindrical
SLA_PROJECTOR_PROJECTION_FLAT Flat
SLA_PROJECTOR_PROJECTION_CUBIC Cubic
SLA_PROJECTOR_PROJECTION_FRONTAL Frontal
SLA_PROJECTOR_PROJECTION_SPATIAL Spatial
SLA_PROJECTOR_PROJECTION_UVW UVWMapping
SLA_PROJECTOR_PROJECTION_SHRINKWRAP ShrinkWrapping
SLA_PROJECTOR_OFFSET_X OffsetX REAL UNIT
SLA_PROJECTOR_OFFSET_Y OffsetY REAL UNIT
SLA_PROJECTOR_LENGTH_X LengthX REAL UNIT
SLA_PROJECTOR_LENGTH_Y LengthY REAL UNIT
SLA_PROJECTOR_TILES_X TilesX REAL  
SLA_PROJECTOR_TILES_Y TilesY REAL  
SLA_PROJECTOR_TILE Tile BOOL  
SLA_PROJECTOR_SEAMLESS Seamless BOOL  
SLA_PROJECTOR_POSITION Position VECTOR UNIT
SLA_PROJECTOR_SIZE Size VECTOR UNIT
SLA_PROJECTOR_ROTATION Rotation VECTOR UNIT
SLA_PROJECTOR_PASTE_TAG PasteTag BUTTON  

Example Code

The following code does not use the correct values when setting the data. You should check directly in C4D for the correct values that you should use in place of the ones that are shown. This code is just to show you how to access the values for getting and setting the parameters.

Python

import c4d
from c4d import gui
def main():
    shader = c4d.BaseShader(c4d.Xprojector)
    
    #You can set parameters two different ways. 
    #First way              
    shader[c4d.SLA_PROJECTOR_PROJECTION] = c4d.SLA_PROJECTOR_PROJECTION_SPHERICAL
    shader[c4d.SLA_PROJECTOR_OFFSET_X] = 0.1
    shader[c4d.SLA_PROJECTOR_OFFSET_Y] = 0.1
    shader[c4d.SLA_PROJECTOR_LENGTH_X] = 0.1
    shader[c4d.SLA_PROJECTOR_LENGTH_Y] = 0.1
    shader[c4d.SLA_PROJECTOR_TILES_X] = 0.1
    shader[c4d.SLA_PROJECTOR_TILES_Y] = 0.1
    shader[c4d.SLA_PROJECTOR_TILE] = True
    shader[c4d.SLA_PROJECTOR_SEAMLESS] = True
    shader[c4d.SLA_PROJECTOR_POSITION] = c4d.Vector(1.0,1.0,1.0)
    shader[c4d.SLA_PROJECTOR_SIZE] = c4d.Vector(1.0,1.0,1.0)
    shader[c4d.SLA_PROJECTOR_ROTATION] = c4d.Vector(1.0,1.0,1.0)
    
    #Second way, using the base container.
    bc = shader.GetDataInstance()
    bc.SetInt32(c4d.SLA_PROJECTOR_PROJECTION,c4d.SLA_PROJECTOR_PROJECTION_SPHERICAL)
    bc.SetFloat(c4d.SLA_PROJECTOR_OFFSET_X,0.1)
    bc.SetFloat(c4d.SLA_PROJECTOR_OFFSET_Y,0.1)
    bc.SetFloat(c4d.SLA_PROJECTOR_LENGTH_X,0.1)
    bc.SetFloat(c4d.SLA_PROJECTOR_LENGTH_Y,0.1)
    bc.SetFloat(c4d.SLA_PROJECTOR_TILES_X,0.1)
    bc.SetFloat(c4d.SLA_PROJECTOR_TILES_Y,0.1)
    bc.SetBool(c4d.SLA_PROJECTOR_TILE,True)
    bc.SetBool(c4d.SLA_PROJECTOR_SEAMLESS,True)
    bc.SetVector(c4d.SLA_PROJECTOR_POSITION, c4d.Vector(1.0,1.0,1.0)
    bc.SetVector(c4d.SLA_PROJECTOR_SIZE, c4d.Vector(1.0,1.0,1.0)
    bc.SetVector(c4d.SLA_PROJECTOR_ROTATION, c4d.Vector(1.0,1.0,1.0)

if __name__=='__main__':
    main()
             

C++

#include "c4d.h"
#include "../sla/description/xslaprojector.h"
void SampleFunction()
{
    BaseDocument *pDoc = GetActiveDocument();
    BaseShader *pShader = BaseShader::Alloc(Xprojector);  
    
    //You can set parameters two different ways. 

    //First way              
    //Some objects do not store all their data in the container. You need to use GetParameter()/SetParameter() instead. 

    DESCFLAGS_SET flags = DESCFLAGS_SET_PARAM_SET;
    pShader->SetParameter(DescID(SLA_PROJECTOR_PROJECTION),GeData(SLA_PROJECTOR_PROJECTION_SPHERICAL),flags);
    pShader->SetParameter(DescID(SLA_PROJECTOR_OFFSET_X),GeData(0.1),flags);
    pShader->SetParameter(DescID(SLA_PROJECTOR_OFFSET_Y),GeData(0.1),flags);
    pShader->SetParameter(DescID(SLA_PROJECTOR_LENGTH_X),GeData(0.1),flags);
    pShader->SetParameter(DescID(SLA_PROJECTOR_LENGTH_Y),GeData(0.1),flags);
    pShader->SetParameter(DescID(SLA_PROJECTOR_TILES_X),GeData(0.1),flags);
    pShader->SetParameter(DescID(SLA_PROJECTOR_TILES_Y),GeData(0.1),flags);
    pShader->SetParameter(DescID(SLA_PROJECTOR_TILE),GeData(true),flags);
    pShader->SetParameter(DescID(SLA_PROJECTOR_SEAMLESS),GeData(true),flags);
    pShader->SetParameter(DescID(SLA_PROJECTOR_POSITION),GeData(Vector(1.0,1.0,1.0)),flags);
    pShader->SetParameter(DescID(SLA_PROJECTOR_SIZE),GeData(Vector(1.0,1.0,1.0)),flags);
    pShader->SetParameter(DescID(SLA_PROJECTOR_ROTATION),GeData(Vector(1.0,1.0,1.0)),flags);
    pShader->Message(MSG_UPDATE);            

    //Second way, using the base container.
    BaseContainer *bc =     pShader->GetDataInstance();
    bc->SetInt32(SLA_PROJECTOR_PROJECTION,SLA_PROJECTOR_PROJECTION_SPHERICAL);
    bc->SetFloat(SLA_PROJECTOR_OFFSET_X,0.1);
    bc->SetFloat(SLA_PROJECTOR_OFFSET_Y,0.1);
    bc->SetFloat(SLA_PROJECTOR_LENGTH_X,0.1);
    bc->SetFloat(SLA_PROJECTOR_LENGTH_Y,0.1);
    bc->SetFloat(SLA_PROJECTOR_TILES_X,0.1);
    bc->SetFloat(SLA_PROJECTOR_TILES_Y,0.1);
    bc->SetBool(SLA_PROJECTOR_TILE,true);
    bc->SetBool(SLA_PROJECTOR_SEAMLESS,true);
    bc->SetVector(SLA_PROJECTOR_POSITION, c4d.Vector(1.0,1.0,1.0);
    bc->SetVector(SLA_PROJECTOR_SIZE, c4d.Vector(1.0,1.0,1.0);
    bc->SetVector(SLA_PROJECTOR_ROTATION, c4d.Vector(1.0,1.0,1.0);
    pShader->Message(MSG_UPDATE);                                                      
}
             

Buttons

This node has buttons. Buttons can manually be executed by calling the following code

Python

c4d.CallButton(shader,c4d.SLA_PROJECTOR_PASTE_TAG)

C++

DescriptionCommand dc;
dc.id = DescID(SLA_PROJECTOR_PASTE_TAG);             
pShader->Message(MSG_DESCRIPTION_COMMAND, &dc);