coffee not rendering

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

On 02/11/2006 at 14:39, xxxxxxxx wrote:

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

---------
    this is my first post.

i have seen this topic posted before, but the solution doesn't apply to my sitation.

i have an xpresso setup with a COFFEE node. the goal is to do an animated matrix extrude in r8.2 -- which, to some degree, i have accomplished. still, the results are only visible in the realtime editor display and do not show up in any rendered output.

i also have a txt file of the COFFEE code for the r9.6 demo of c4d:

var oldSteps;

main()
{
println("oldSteps= ", oldSteps);

var doc = GetActiveDocument();
var op = doc->FindObject("MyObject"); // GetActiveObject(doc);
var ver = GetC4DVersion();
println("ver = ", ver);

if (!doc->FindObject("Backup"))
{

println("'Backup' found? ", doc->FindObject("Backup")?"TRUE":"FALSE");

var currentObject = doc->FindObject("MyObject"); // GetActiveObject(doc);

println((currentObject == op)?"TRUE":"FALSE");

var clone;
clone = currentObject->GetClone(CL_NO_HIERARCHY);
clone->SetName("Backup");

GetActiveDocument()->InsertObject(clone, NULL, NULL);

doc->SetActiveObject(currentObject);

EventAdd();
}

// ***********************************************************************

if (Steps != oldSteps)
{

var BaseDoc = GetActiveDocument();
     var currentObject = BaseDoc->FindObject("MyObject"); // GetActiveObject(BaseDoc);

// reset object
     if (Steps != oldSteps)
     {
    
        currentObject->Remove();
        currentObject = BaseDoc->FindObject("Backup");

var clone;
        clone = currentObject->GetClone(CL_NO_HIERARCHY);
        clone->SetName("MyObject");

GetActiveDocument()->InsertObject(clone, NULL, NULL);

currentObject = BaseDoc->FindObject("MyObject");
        BaseDoc->SetActiveObject(currentObject);
        EventAdd();
     }

if (Steps > 0)
     {
     var bc = currentObject->GetContainer(); // "new" method found 2006-10-02 vs. old "new(BaseContainer)" method

bc->SetData(MDATA_MATRIXEXTRUDE_STEPS, Steps);                                         
     bc->SetData(MDATA_MATRIXEXTRUDE_MOVE,   vector(0.0,0.0,50.0));
     bc->SetData(MDATA_MATRIXEXTRUDE_SCALE, vector(0.8,0.8,0.8));
     bc->SetData(MDATA_MATRIXEXTRUDE_ROTATE, vector((10.0/360.0)*(3.14),0.0,0.0)); // convert to RADIANS!

bc->SetData(MDATA_MATRIXEXTRUDE_POLYGONCOORDS, TRUE);
     bc->SetData(MDATA_MATRIXEXTRUDE_VARIANCE, 0);

var myres = SendModelingCommand(ID_MODELING_MATRIX_EXTRUDE_TOOL, NULL, currentObject, bc, MODIFY_POLYGONSELECTION); // ID_MODELING_MATRIX_EXTRUDE_TOOL

if (!myres)
    {
      println("poss error. SMC returned false ", myres);
     
    } else println("***SMC called***");
    currentObject->Message(MSG_UPDATE);
    }

currentObject = BaseDoc->FindObject("Null Object");
BaseDoc->SetActiveObject(currentObject);
}

oldSteps = Steps;
}

i do not have r9.6, but i figured it would be easier for everybody to test and comment on.
to create the scene file:

  • create a null object
  • put an Xpresso tag on it
  • put a User Data integer slider (1..8)on it
  • create a cube, make editable, rename it to "MyObject"
  • drag the NULL into the Xpresso, create an output port for the User Data slider
  • create a COFFEE node with an Integer input port named "Steps"
  • connect the nodes
  • code for the COFFEE node is above

is there a faster way of posting a file???
thanks for your help.

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

On 03/11/2006 at 01:10, xxxxxxxx wrote:

I am afraid you can't do it this way. You can't add geometry during rendering. You can do this only with a Object plugin and the C++ SDK.

cheers,
Matthias

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

On 03/11/2006 at 11:33, xxxxxxxx wrote:

Thank you for the fast and accurate reply.

The C++ SDK is powerful, but also something I'm not quite ready for. Thank you for providing a direction to study.

Is there any other method suggested for doing something like this in COFFEE?

The one I'm considering is to do a sweeps nurbs using a spline created from the selected polygon edges. This may not work for the same reason given, but if I create the geometry beforehand, then maybe I will be able to animated the growth of the sweeps nurbs object(s). What do you think?

Lastly, can geometry be subtracted or deleted during rendering? Or is there a way to copy just the geometry from one object to another without adding it? Am I being too litteral with the term "add geometry" and hoping to find a trick that doesn't exist?

Thanks again.