main(doc,op) (4)too few parameters



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

    On 25/03/2008 at 07:48, xxxxxxxx wrote:

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

    ---------I'm nor sue why I get this error,  (4) too few parameters,  when I switch from using just main() to using main(doc,op)???



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

    On 25/03/2008 at 10:46, xxxxxxxx wrote:

    ? You create a coffee tag with the following content and it occurs an error?

    >
    > main(doc, op)
    > {
    >
    > }
    >



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

    On 25/03/2008 at 10:53, xxxxxxxx wrote:

    I am running this as a plugin.



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

    On 25/03/2008 at 11:04, xxxxxxxx wrote:

    Hi!

    Are you sure that a coffee plugin supports parameters in main()?

    All example files are avaible with main() (withoit parameters) only.

    Bye :)



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

    On 25/03/2008 at 11:13, xxxxxxxx wrote:

    Thanks Shawni!,  I was curious about the same thing.  I was actually going to make that same exact comment. Check out the thread before yours started by cheetah, this is why I am trying to put parameters in main.  Maybe these guys are using a c++ technique and assuming that it will work in COFFEE.  It's frustrating the 2 plugins I've made so far work great in the editor but do nothing when rendered.  I am starting on the larger picture to think that you can't do any kind of renderring with COFFEE.  Thanks again



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

    On 25/03/2008 at 11:20, xxxxxxxx wrote:

    I only knew main(doc, op) for Coffee Tags in the Object Manager.

    Bye ;)



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

    On 25/03/2008 at 12:43, xxxxxxxx wrote:

    In Coffee Tags, main(doc,op). In Coffee plugin, main(). (See "Plugin Files" in the Coffee docs). You'll need to get the active document in a plugin using GetActiveDocument() as you cannot rely upon one being fed into it like a Coffee expression.

    Coffee expressions work a bit differently than plugins. For instance, you can't do any filesystem access from an expression (this is a measure to avoid malicious code in expressions).

    Unfortunately, I'm uncertain as to how to get the cloned render document in Coffee. Matthias, are you there? ;)



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

    On 25/03/2008 at 12:59, xxxxxxxx wrote:

    Thanks again Robert and Shawni,  I'm experimenting with using and passing the doc in MenuPlugin::Execute(doc). I'm not sure if this is the original or the clone.  I'll give an update soon.    I am really going to push my employer to get Visual Studio for me. I think that would solve many problems to go to c++.



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

    On 25/03/2008 at 16:59, xxxxxxxx wrote:

    Hi Mike.
    I do most of my things using coffee, but I'm a little confused of what you
    are trying to do.
    The two variations of coffee (as plugins) I use are:
    -1 MenuPlugins (Similar to scripts)
    -2 TagPluginExpression (Similar to regular COFFEE tags).

    MenuPlugins/Scripts doesn't "render". They are "commands" used in editor , but can include DialogPlugins.

    TagPluginexpressions -does- render, that is you can change values while
    the scene is running.
    To my knowledge, the only options to animate anything in a CoffeTag
    are either by using Userdata or have something else (like an object) affect
    the coffeetag (By ie "doc->FindObject("nn").

    Included in the CoffeeSDK95 (The latest coffee there is) you'll find several
    "Paint by numbers" examples plus a framework for a CoffeTagExpression.

    Otoh, if you already -are- fluent in C++, maybe you'll get more done faster by getting a compiler.

    Cheers
    Lennart



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

    On 26/03/2008 at 04:16, xxxxxxxx wrote:

    There are no passes paramters in the main() function of COFFEE plugins.

    ExpressionPluginTag plugins have the rendered (cloned) document and the object the tag is attached to passed to the Execute(doc,op) function.

    MenuPlugins have the active document passed to the Execute(doc) function.

    Please check the provided plugin frameworks in the COFFEE docu.

    cheers,
    Matthias



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

    On 26/03/2008 at 05:38, xxxxxxxx wrote:

    Thanks everyone!  very helpful
    I'll paste it below if you guys are curious.  1) Make a spline 2)Select some points 3) Open plug and click GetPoints 4) Move nulls

        
        
          
        const var PLUGIN_ID = 910042;  
        const var cB1 = "MOVE POINTS";  
        const var cB2 = "GET POINTS";
        
        
        
        
        enum {eGetActPoints,eMovePoints}  
        var pDoc,pObj,pSels,pPoints,i,j,selPoints,spPoints,nullname,nu,vals,cPt;  
        var nObj,pName,nName,nnName,sName,len,lSplines,q,x,spObj,inde,iObj,m,o;  
        var sels,nunames;
        
        
        
        
        class PointTonull  
        {  
         public:  
          GetActPoints();  
          MovePoints();  
        }
        
        
        
        
        PointTonull::GetActPoints()  
        {  
         pDoc = GetActiveDocument();  
         pObj = pDoc->GetActiveObject();  
         pName=pObj->GetName();  
         lSplines[q]=pName;  
         q++;  
         spPoints=pObj->GetPointCount();  
         pSels = pObj->GetPointSelection();  
         selPoints=pSels->GetCount();  
         //var sels=new(array,selPoints);  
         println(pSels->GetCount());  
         for(i=0;i<spPoints;i++)  
         {  
           if(pSels->IsSelected(i))  
           {  
             //sels[j]=i;  
             println(pObj->GetPoint(i),"  ",i," ",j);  
             cPt=pObj->GetPoint(i);  
             println(pObj->GetMg()->GetMulP(cPt),pObj->GetMg()->GetV1());  
             nullname=pName+tostring(j)+tostring(i);  
             println(nullname);  
             nu=AllocObject(Onull);  
             nu->SetName(nullname);  
             nunames[q-1][j]=nullname;
        
        
        
        
             pDoc->StartUndo();  
             pDoc->AddUndo(UNDO_OBJECT_NEW,nu);  
             pDoc->EndUndo();
        
        
        
        
             //vals=cPt->GetPosition();  
             //vals->SetV0(vector(2,2,2));//pObj->GetPoint(i));  
             nu->SetPosition(pObj->GetMg()->GetMulP(cPt));  
             j++;  
             pDoc->InsertObject(nu,NULL,NULL);  
             EventAdd();  
           }  
         }  
         return;   
        }
        
        
        
        
        PointTonull::MovePoints()  
        {  
         pDoc=GetActiveDocument();  
         while(nunames[m][o]!=NULL)  
         {  
          while(nunames[m][o]!=NULL)  
          {  
           nObj=pDoc->FindObject(nunames[m][o]);  
           spObj=pDoc->FindObject(lSplines[m]);  
           nName=nObj->GetName();  
           len=sizeof(nName);  
           println(nName);  
           inde=strmid(nName,len-1,len-1);  
           iObj=spObj->GetMg();  
           iObj->Invert();  
           spObj->SetPoint(evaluate(inde),iObj->GetMulP(nObj->GetPosition()));  
           spObj->Message(MSG_UPDATE);   
           o++;  
          }  
          m++;  
         }  
         m=0;  
         o=0;
        
        
        
        
         //EventAdd();  
         x=0;  
        }
        
        
        
        
        class MyDialog : GeDialog  
        {  
         public:  
          MyDialog();
        
        
        
        
          Init();  
          CreateLayout();  
          Command(pID,pMSG);  
          CoreMessage(id,msg);  
        }
        
        
        
        
        MyDialog::MyDialog() { super(PLUGIN_ID); }
        
        
        
        
        MyDialog::Init()  
        {
        
        
        
        
        }
        
        
        
        
        MyDialog::CreateLayout()  
        {  
         SetTitle("Create Path and Nulls");  
         AddGroupBorderSpace(20,20,20,20);  
         //AddButton (eMovePoints,0,150,0,cB1);  
         AddButton (eGetActPoints,0,150,0,cB2);  
         return TRUE;  
        }
        
        
        
        
        MyDialog::Command(pID,pMSG)  
        {  
         switch (pID)  
         {  
          case eMovePoints:  
           pPoints->MovePoints();  
           break;  
          case eGetActPoints:  
           pPoints=new(PointTonull);  
           pPoints->GetActPoints();  
           break;  
         }  
        }
        
        
        
        
        MyDialog::CoreMessage(id,msg)  
        {  
         switch (id)  
         {  
          case DOCUMENT_CHANGED:  
          {  
           println("ACT OBJECTIVELY");  
           pPoints->MovePoints();  
           break;  
          }  
         }  
        }
        
        
        
        
        class MyMenuPlugin : MenuPlugin  
        {  
         public:  
          MyMenuPlugin();
        
        
        
        
          GetID();  
          GetName();  
          GetHelp();  
          Execute(doc);  
          RestoreLayout(secret,subid);  
        }
        
        
        
        
        MyMenuPlugin::MyMenuPlugin() { super(); }  
        MyMenuPlugin::GetID()        { return PLUGIN_ID; }  
        MyMenuPlugin::GetName()      { return "Place and Move Nulls"; }  
        MyMenuPlugin::GetHelp()      { return "Paces nulls on spline points"; }
        
        
        
        
        var d;
        
        
        
        
        MyMenuPlugin::Execute(doc)  
        {  
         d->Open(TRUE,-1,-1);  
        }
        
        
        
        
        MyMenuPlugin::RestoreLayout(secret,subid)  
        {  
         if (!d) d = new(MyDialog);  
         d->RestoreLayout(secret);  
        }
        
        
        
        
          
        main()  
        {  
         d = new(MyDialog);  
         j=0;  
         q=0;  
         x=0;  
         m=0;  
         o=0;  
         lSplines=new(array,20);  
         nunames=new(array,20,20);  
         Register(MyMenuPlugin);  
        }
    


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

    On 03/04/2008 at 13:51, xxxxxxxx wrote:

    ok, I added an ExpressionPluginTag to accomplish the rendering.  That works!!  needless to say I was/am pretty confused.  I was thinking ExpressionPluginTag was something totally different.  This is where you can access the object for renderring.  Now I understand what you were all trying to point me to.  Just wanted to add the conclusion to this post in case anyone has the same question in the future and finds this thread.
    Nuff Respect shawni Robert Lennart Matthias


Log in to reply