Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    attatch Tags

    SDK Help
    0
    20
    1.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

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

      On 01/10/2005 at 03:30, xxxxxxxx wrote:

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

      ---------
      Hi,
      i'm happy about my first steps in COFFEE 🙂
      I want to make a Rig-Generator.
      Now the Bone generate and named and set at right position in hierarchie.
      Now I need the Mocca-IK Tags at the Objects.
       
      May way to do this is to use "command"->IK-Setup.
      doc- >SetActiveObject(myBoneObject);
      CallCommand(100001324);

      It is ok, but I want to add my own mocca-IK Tag at every object.
      And I need to add Expresso-Tags, too.
       
      But how can I ma ke add Tags to Objects ?
      This is the way I try:
      var tobject =  doc->FindObject ( tagobj );
       if ( !tobject ) return;
       doc->SetActiveObject(tobject); 
       tobject->AllocTag("Texpresso");
       
      Error is shown: [FAIL] 'ERIG' Line53: Incompatible Values...   NIL / OBJECT

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

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

        On 02/10/2005 at 00:22, xxxxxxxx wrote:

        Oh, please Help me ...
         
        I search in this forum, in C4D-Treff and cg-talk(C4D) and found nothing.
        Is here nobody who nows how I add a tag to an exist object?

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

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

          On 02/10/2005 at 05:41, xxxxxxxx wrote:

          For one, doc->FindObject(x) wants either a Marker or a String name for 'x'. As best I can tell, a Marker is equivalent to the LONG id in the C++ SDK. So you should have a number or the object's name (in double-quotes) there. You don't mention what 'tagobj' represents.

          Secondly, BaseObject (tobject) does not have an AllocTag() method and the type isn't a string (it's an int, to be pedantic). It is part of BaseTag, so just do this:

          var tag = AllocTag(Texpresso);
          tobject->InsertTag(tag);

          For beginners (and even some of us veterans), the forum search feature sometimes leaves a lot to be desired. 🙂

          HTH,

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

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

            On 02/10/2005 at 06:06, xxxxxxxx wrote:

            Wow, that is it!
            "FindObject" is the problem.
            Don't run:

                
                
                main(doc, op)  
                {  
                var tobject =  doc->FindObject ( op );  
                 if ( !tobject ) return;  
                var tag = AllocTag(Texpresso);  
                tobject->InsertTag(tag);  
                }
            

            [b]That's run:[/b]

                
                
                main(doc, op)  
                {  
                var tag = AllocTag(Texpresso);  
                op->InsertTag(tag);  
                }
            

            I generate the objects by myself at runtime of the coffee-Script.
            I don't use C or C++ - only R9.5 Coffee-Console!
            to create the Objekt I use this Code:

                
                
                var Bone = new(BoneObject);  
                Bone->SetName("Objekt1");  
                doc->InsertObject(Bone,NULL,NULL);  
                
            

            You write: "So you should have a number or the object's name (in double-quotes) there. "
            Is "Objekt1" the name I can use?
            Or how can I get the Number of the object?

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

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

              On 02/10/2005 at 08:18, xxxxxxxx wrote:

              _I generate the objects by myself at runtime of the coffee- Script.

              I don't use C or C++ - only R9.5 Coffee-Console!

              to create the Objekt I use this Code:

              var Bone = new(BoneObject);
              Bone->SetName("Objekt1");
              doc->InsertObject(Bone,NULL,NULL);

              Is "Objekt1" the name I can use?

              Or how can I get the Number of the object?_

              Yes, if you are using FindObject() by its name, use "Objekt1". Note that, according to the documentation, if there are multiple objects with the same name, it will always return the first one.

              I don't know much about these so-called COFFEE 'Markers'. Here is a function used by the base class of many other classes, from the documentation:

              BaseList2D::GetMarker()  
              {Marker} GetMarker();   
              Returns a unique marker that can be used to locate the object during runtime. Markers are only only valid while the program is running.
              

              So, it appears that right after you create+insert your new object, you should get a Marker and store it:

              var Bone = new(BoneObject);  
              Bone->SetName("Objekt1");  
              doc->InsertObject(Bone,NULL,NULL);  
              // var BoneMarker declared somewhere with larger scope  
              BoneMarker = Bone->GetMarker();
              

              The problem is in scope persistence. Note that the Marker is only valid while the program is running. You could just as easily store 'var Bone' globally, maybe in an array, to get at your objects.

              So, with that said, if the object names are going to remain unique, you should consider using FindObject("name") instead of FindObject(Marker).

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

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

                On 02/10/2005 at 10:16, xxxxxxxx wrote:

                Thanks again 🙂
                While I wait for answer I thought about anather way. You called now too.
                When I create objekt I want to store it in a variable.
                But my create-routine is in a function.
                And its looks like variables in a function(){} are isolate.
                When I create a variable in main(){} I cant get it in the function.
                 
                I search in SDK, but I don't found anything about global variables.
                 
                I have a funcion for generateBone() and for generateBoneUnderAnother().
                I want store the objects in variables, but the counter in the functions start by "0" every call function.
                 
                Where can I found how can I make global variables?

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

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

                  On 02/10/2005 at 10:43, xxxxxxxx wrote:

                  Global variables are declared outside of functions. Don't know if this is possible in the Console, but you would do it like this (assumes that there are a maximum number of bones to allocate as an array) :

                  var Bones = new(array,64);  
                    
                  ...  
                    
                  main()  
                  {  
                  }
                  

                  You could also put the declaration in main() and fill the variable from the function return value:

                  generateBone()  
                  {  
                       var Bone = new(BoneObject);  
                       ...  
                       return Bone;  
                  }  
                    
                  main()  
                  {  
                       var Bone = new(array,64);  
                       for (var j = 0; j < 64; j++)  
                       {  
                            Bone[j] = generateBone();  
                       }  
                  }  
                  
                  1 Reply Last reply Reply Quote 0
                  • H
                    Helper
                    last edited by

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

                    On 02/10/2005 at 11:33, xxxxxxxx wrote:

                    🙂
                    Yes, outside the main() makes global.

                        
                        
                          
                        var objid = new(array,20);  
                         
                        
                        
                        
                        
                        main()
                        
                        
                        
                        
                        {
                        
                        
                        
                        
                        }
                    

                    is not possible?!
                    A global array?
                    In this array I want store Boneobjects.
                    Is it possible ?
                    I read in SDK, that this is possible:
                     
                    Bevor I take your time with more questions, there are some basic Questions.
                    That must be possible for my AutoRig-Script.
                    Can I add Mocca-IK Tags to a objects? (I found in the SDK only the basic C4D-Tags to add)
                    Another Way, when I can't create Mocca-IK tags, can I remove and copy exists?
                    With command() I can start the mocca-IK Setup to an object-hierarchie.
                    When I can copy and paste, and remove, it is ok, too!
                    Can I add nodes with connections to an Expresso-Tag?

                    1 Reply Last reply Reply Quote 0
                    • H
                      Helper
                      last edited by

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

                      On 02/10/2005 at 12:20, xxxxxxxx wrote:

                      var Bones = new(array,64);
                      main(doc, op)
                      {}
                       
                      generate a SyntaxError.

                      1 Reply Last reply Reply Quote 0
                      • H
                        Helper
                        last edited by

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

                        On 02/10/2005 at 15:28, xxxxxxxx wrote:

                        You may have to place it into main() then or do it this way:

                        var Bones;

                        main(doc,op)
                        {
                        Bones = new(array,64);
                        }

                        1 Reply Last reply Reply Quote 0
                        • H
                          Helper
                          last edited by

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

                          On 03/10/2005 at 02:51, xxxxxxxx wrote:

                          Thats work 🙂
                          Greate.
                          But I need Bone-Array as BoneObject structure.
                          I am so silly? Or is it so heavy?
                           
                          I'm sorry, that I must ask again:

                              
                              
                              var Bones, objc;
                              
                              
                              
                              
                              setbone(vdoc, addname, Atag, Btag, Ctag)  
                              {  
                               objc++;  
                               Bone[objc]=new(BoneObject);  
                               Bone[objc]->SetName(addname);  
                               vdoc->InsertObject(Bone[objc],NULL,NULL);   
                              }
                              
                              
                              
                              
                              main(doc,op)  
                              {  
                              objc=-1;  
                              Bones = new(array,64);  
                              setbone (doc, "Arm[00]", NULL, NULL, NULL);  
                              }
                          

                          Why doesn't work ?
                           
                          For thank you and all who helps other I write my learnings down:
                          http://www.total3d.de/index.php?b=mmdocu&wo=viewkapitel&bo=10&ka=78#titel

                          1 Reply Last reply Reply Quote 0
                          • H
                            Helper
                            last edited by

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

                            On 03/10/2005 at 05:33, xxxxxxxx wrote:

                            1. Why doesn't work?
                            2. And how can I add Mocca_IK Tags?
                              Normal IK-tag works, Expresso-tags too.
                            3. But how can I add Nodes and connections in Expresso Tag?
                            1 Reply Last reply Reply Quote 0
                            • H
                              Helper
                              last edited by

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

                              On 03/10/2005 at 10:07, xxxxxxxx wrote:

                              1. Why doesn't work?
                                2a) How can I copy a Tag from one Bone to another?
                              2. And how can I add Mocca_IK Tags?
                                C4D IK-tags works, Expresso-tags, too.
                              3. But how can I add Nodes and connections in Expresso Tag?
                              1 Reply Last reply Reply Quote 0
                              • H
                                Helper
                                last edited by

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

                                On 04/10/2005 at 11:21, xxxxxxxx wrote:

                                Is there a chance, or was the question to much ?

                                1 Reply Last reply Reply Quote 0
                                • H
                                  Helper
                                  last edited by

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

                                  On 06/10/2005 at 07:51, xxxxxxxx wrote:

                                  All right !
                                  That questions are answered by Maxon!
                                  Thanks for all your help!
                                  Very helpfull tipps - This was first time I learn Coffee !
                                  I'm glad about this forum 🙂

                                  1 Reply Last reply Reply Quote 0
                                  • H
                                    Helper
                                    last edited by

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

                                    On 14/10/2005 at 11:57, xxxxxxxx wrote:

                                    1. I don't see any direct problem. What error do you get?
                                      2a) var newtag->GetClone(); bone2->InsertTag(newtag)
                                      2,3) It's not possible to add Mocca_IK tags or to alter Xpressions in C.O.F.F.E.E.
                                    1 Reply Last reply Reply Quote 0
                                    • H
                                      Helper
                                      last edited by

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

                                      On 23/11/2005 at 21:18, xxxxxxxx wrote:

                                      @mikael sterner
                                      you say its impossible to add MOCCA-IK tags through COFFEE.
                                      But what about if i use a Plugin *.cof written in COFFEE, and use that plugin to create my starting scene with all the objects and their tags...
                                      Is it then possible to create "foreign" tags??

                                      1 Reply Last reply Reply Quote 0
                                      • H
                                        Helper
                                        last edited by

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

                                        On 23/11/2005 at 21:29, xxxxxxxx wrote:

                                        And if your answer is no.
                                        Is there a documented Fileformat-specification for the *.c4d file?
                                         
                                        also NO?
                                         
                                        i thought so

                                        1 Reply Last reply Reply Quote 0
                                        • H
                                          Helper
                                          last edited by

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

                                          On 28/11/2005 at 11:43, xxxxxxxx wrote:

                                          Yes, the answer is unfortunately no. To add Mocca_IK tags or to alter Xpressions you need to use C++.

                                          1 Reply Last reply Reply Quote 0
                                          • H
                                            Helper
                                            last edited by

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

                                            On 28/11/2005 at 11:45, xxxxxxxx wrote:

                                            There is no public documentation of the current c4d file format. Documentation for the file format used by C4D R5 is available here at PluginCafe, though this won't help you with Mocca_IK or Xpressions.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post