Current state to object



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

    On 19/11/2003 at 06:05, xxxxxxxx wrote:

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

    ---------
    I can't get the current state to object modeling command to work. It returns 1 after execution, so all is supposedly well, but there's no effect in the doc! Here's the code:

      
    oMenuPlugin::Execute(doc)  
    {  
    var op=GetActiveObject(doc); if (!op) return FALSE;  
    var bc=new(BaseContainer);  
    SetMousePointer(MOUSE_BUSY);  
    doc->StartUndo();  
    doc->AddUndo(UNDO_OBJECT_REC,op);  
    var test = SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT,NULL,op,bc,MODIFY_ALL);  
    println(test);  
    doc->EndUndo();  
    SetMousePointer(MOUSE_NORMAL);  
    GeEventAdd(DOCUMENT_CHANGED);  
    }  
    


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

    On 19/11/2003 at 09:13, xxxxxxxx wrote:

    you have to pass the document pointer. SendModelingCommand will then create the object in this document afai can remember (long time I used it in COFFEE)..



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

    On 19/11/2003 at 10:58, xxxxxxxx wrote:

    Thank you Samir, that fixed it!



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

    On 19/08/2006 at 09:37, xxxxxxxx wrote:

    I have the same Problem !
    I try all I think what you may mean with pass the document.
    It's sounds like make a new(BaseDocument) but I can't get a working code :-(
    What are the missed code to go working ?



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

    On 19/08/2006 at 11:14, xxxxxxxx wrote:

    Hi Jack , i think it should read:

    SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT,doc,op,bc,MODIFY_ALL);
    

    Greetings , Frank.



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

    On 19/08/2006 at 11:57, xxxxxxxx wrote:

    Thanks for answer, but his I had try before and don't work.
    The Problem Stay.
    At first Time the Deformer "baked" in a new object.
    But after set Time one frame again, nor the new deformed object baked.
    Only the deform of start is bake again and again in new Objekt.

        
        
        
        
        while(time->IsLT(ends))  
        {  
        doc->SetTime(time);  
        GeEventAdd(DOCUMENT_CHANGED);  
        var bc = new(BaseContainer);  
        var ddoc = new(BaseDocument);  
        var savename = op->GetName();  
          op->SetName(tmp_Name+tostring(cc));  
          SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT, doc, op->GetUp(), bc, MODIFY_ALL);  
        var Deformer_Hierarchie_copy = doc->GetActiveObject();  
          op->SetName(savename);  
        var deformed_op = doc->FindObject(tmp_Name+tostring(cc));  
        var i,pointcount = op->GetPointCount();  
        var points = new(array, pointcount);  
        var key = new(PLAKey);  
          key->SetTime(time);  
        var pt  = new(PointTag);  
        for (i=0; i<pointcount; i++){ points[i] = deformed_op->GetPoint(i);}  
          Deformer_Hierarchie_copy->Remove();
        
        
        
        
        var vc = new(VariableChanged);  
          vc->Init(0, pointcount);  
          pt->Message(MSG_POINTS_CHANGED,vc);  
          pt->SetData(points);  
          key->SetPointTag(pt);  
          seq->InsertKey(key);  
          cop->Message(MSG_UPDATE);  
          time->Add(OneFrame);  
          cc++;  
        }
        
        
        
    


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

    On 20/08/2006 at 08:46, xxxxxxxx wrote:

    Hi jack , i'm not sure if i understand you correctly but should'nt it be

    bc->SetData(MDATA_CURRENTSTATETOOBJECT_KEEPANIMATION, TRUE);  
    SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT, doc, op->GetUp(), bc, MODIFY_ALL);
    

    HTH , frank.


Log in to reply