Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Noob question

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 322 Views
    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 Offline
      Helper
      last edited by

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

      On 21/05/2005 at 12:44, xxxxxxxx wrote:

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

      ---------
      Hello,
      I'm just starting to try and learn coffee and would like to start out by making some simple functions. First I would like to make a coffee expression where I could have one bone aim at another bone. (pretty simple)
       
      I could use some tips/advice as to  where to start and how to go about getting that done. If there any examples around that would help too.
       
      Thanks Dave

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

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

        On 22/05/2005 at 20:00, xxxxxxxx wrote:

        Oh and I would also like the bone to scale to the target bone so that you get a muscle type of bone. An aim at with scale if you get what I mean.

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

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

          On 23/05/2005 at 20:43, xxxxxxxx wrote:

          Ok I have used the code from the target node that comes with C4D to work on this problem. It does all the aim at stuff already. I have added a var to get the distance between the target bone and the object bone. Now I'm stuck on how to adjust the object bones length to the distance var I have added.
          How do I go about setting the bones length to the var (dist) I have?
          Here is the code with my line added in:
          main()
          {
           var mobj = Muscle->GetMg();
           var tobj = Target->GetMg();
           
           var p1 = mobj->GetV0();
           var p2 = tobj->GetV0();
           var dist = p2 - p1; //gets distance from p1 to p2
           
           var m = new(Matrix);
           m->SetV0(p1);
           m->SetV3(vnorm(p2 - p1));
           m->SetV2(vnorm(vcross(p2-p1, vector(0,1,0))));
           m->SetV1(vnorm(vcross(p2-p1, vector(0,0,1))));
            
           Rotation=m->GetHPB();
           var orot=mobj->GetHPB();
           Rotation.z=orot.z;
           
          }

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

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

            On 01/06/2005 at 12:17, xxxxxxxx wrote:

            If you drag the Length field of a bone and drop it in the C.O.F.F.E.E. editor window, you'll see that it writes "#BONEOBJECT_LENGTH". This means that you can set the length with

                
                
                op#BONEOBJECT_LENGTH = dist;
            

            where 'op' is the bone object.

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