expression tag plugin



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

    On 30/04/2010 at 14:00, xxxxxxxx wrote:

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

    ---------
    I've created an expression plugin tag but I'm not able to add it to some object.. In SDK it's described as "New Tag menu in the Object Manager" but there's no menu such as that.. I would also like to create a menu plugin that would add this tag, but I couldn't find the way to do that in SDK.. I've been studying SDK for about a week and simply couldn't find it and understand it..
    please excuse my english...



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

    On 30/04/2010 at 16:14, xxxxxxxx wrote:

    At the top of the object manager there are 6 menus.  The tag menu is the fifth from the left.  The quickest way to add a tag to an object is by right clicking on an object (which opens the tag menu).  Your custom tag should show up somewhere near the bottom of that menu.

    There's really no need to create a menu plugin (called a command data plugin) to call your tag unless you have a more complex setup that your tag should be used with as default (or for user convenience).

    -kvb



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

    On 01/05/2010 at 02:18, xxxxxxxx wrote:

    Thanks,
    I've copied and changed the example code from SDK but the tag simply isn't there..

      
    class MyExpressionPluginTag : ExpressionPluginTag  
    {  
    public:  
      MyExpressionPluginTag();   
      GetID();  
      MultipleAllowed();  
      DisplayAllowed();  
      GetIcon();  
      GetHelpText();  
      UseMenu();  
      GetName();  
      Edit();  
      Execute(doc, op);  
    }  
      
    MyExpressionPluginTag::MyExpressionPluginTag()   
    {  super();}  
      
    MyExpressionPluginTag::GetID()                 
    {return 1025173;}  
      
    MyExpressionPluginTag::MultipleAllowed()       
    {return TRUE;}  
      
    MyExpressionPluginTag::DisplayAllowed()        
    {return TRUE;}  
      
    MyExpressionPluginTag::GetIcon()               
    {   
          var Icon = new(BaseBitmap,1,1);  
      var File = new(Filename);  
      File = GeGetRootFilename();  
      File->RemoveLast();  
      File->AddLast("ikona.tif");  
      Bitmap->Load(File);  
      return Bitmap;  
    }  
      
    MyExpressionPluginTag::GetHelpText()           
    { return "Fluidplugin";}  
      
    MyExpressionPluginTag::UseMenu()   
    {  
    return TRUE;  
    }  
      
    MyExpressionPluginTag::GetName()   
    {  
     return "Fluid Plugin 4";  
    }  
      
    MyExpressionPluginTag::Edit()  
    {  
    var dlg = TextDialog("example", DLG_OK);  
    }  
      
    MyExpressionPluginTag::Execute(doc, op)  
    {//example code  
    if(!doc->FindObject("changed")){  
      var obj = doc->GetActiveObject;  
      obj->SetName("changed");  
    }  
    }  
      
      
    /////////  
    // Main  
      
    main()  
    {  
      Register(MyExpressionPluginTag);  
    }  
    


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

    On 01/05/2010 at 10:35, xxxxxxxx wrote:

    EDIT: woops... wrong language.



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

    On 01/05/2010 at 11:51, xxxxxxxx wrote:

    When doing coffee coding always check the console for errors
    and put in println() for parts you want to see if it is working.

    Yes, you need the main() for registering the expression.

    Cheers
    Lennart

    Looked in the console for your code and corrected (see notes in code)

      
    class MyExpressionPluginTag : ExpressionPluginTag   
    {   
    public:   
    MyExpressionPluginTag();   
    GetID();   
    MultipleAllowed();   
    DisplayAllowed();   
    GetIcon();   
    GetHelpText();   
    UseMenu();   
    GetName();   
    Edit();   
    Execute(doc, op);   
    }   
      
    MyExpressionPluginTag::MyExpressionPluginTag()   
    { super();}   
      
    MyExpressionPluginTag::GetID()                 
    {return 1025173;}   
      
    MyExpressionPluginTag::MultipleAllowed()        
    {return TRUE;}   
      
    MyExpressionPluginTag::DisplayAllowed()         
    {return TRUE;}   
      
    MyExpressionPluginTag::GetIcon()                
    {   
          var Icon = new(BaseBitmap,1,1);   
        var File = new(Filename);   
        File = GeGetRootFilename();   
        File->RemoveLast();   
        File->AddLast("ikona.tif");   
        Icon->Load(File);   
        return Icon; // <- You've called the bitmap Icon   
    }   
      
    MyExpressionPluginTag::GetHelpText()          
    { return "Fluidplugin";}   
      
    MyExpressionPluginTag::UseMenu()   
    {   
    return TRUE;   
    }   
      
    MyExpressionPluginTag::GetName()   
    {   
    return "Fluid Plugin 4";   
    }   
      
    MyExpressionPluginTag::Edit()   
    {   
    var dlg = TextDialog("example", DLG_OK);   
    }   
      
    MyExpressionPluginTag::Execute(doc, op)   
    {//example code   
    if(!doc->FindObject("changed")){   
    var obj = doc->GetActiveObject();//<- missed the "()"   
    if(obj && obj->GetName() != "changed") // <- Check if obj and name   
    obj->SetName("changed");   
    }   
    }   
      
      
    /////////   
    // Main   
      
    main()   
    {   
    Register(MyExpressionPluginTag);   
    println("MEPL Loaded OK"); // <- Check if loaded in Console   
    }   
    


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

    On 01/05/2010 at 11:59, xxxxxxxx wrote:

    oh, right... coffee... my bad:D



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

    On 01/05/2010 at 14:12, xxxxxxxx wrote:

    Thanks,
    now I'm 100% sure the code is OK, I've had no errors in console but the tag didn't appear in any menu.. I've been trying this for about a week and I can't uderstand where the problem is.. (I hope not between chair and keyboard :) )



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

    On 02/05/2010 at 08:10, xxxxxxxx wrote:

    Check the resources! If there's anything wrong with the resources (i.e. a missing icon), not even the debugger will kick in.

    Hope it helps

    Kabe



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

    On 02/05/2010 at 08:48, xxxxxxxx wrote:

    I've only this .cof file and the icon, and if the icon load wasn't succesful, cinema adds a grey rectangle to the tag.. (written in SDK) Anyway does someone have some working expression plugin tag?



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

    On 02/05/2010 at 09:23, xxxxxxxx wrote:

    Thanks everyone for helping me, the problem was definitely between chair and keybord, I was saving the code in another file with the same name.. the plugin is working fine..


Log in to reply