Maxon Developers
    • Downloads
      • All Downloads
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
      • Cinema 4D Python Examples
      • Cinema 4D C++ Examples
      • Project Tool
      • SDK Database
    • Documentation
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
    • Forum
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Forums
      • Overview
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • News & Information
      • Downloads
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login

    SendModelingCommand for Magnet Tool

    SDK Help
    0
    3
    40
    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 31/08/2006 at 18:31, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.1 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      I try to use SendModelingCommand with the magnet tool. However, it returns false in any case.

      Can anyone show me a working example for using the magnet tool with SendModelingCommand? I'm not even sure how it is intended to work, because the magnet tool requires mouse input.

      Here's the code I'm using. I set all parameters, except two which I don't know what they are for and what type they are.

      // init ModelingCommandData
      ModelingCommandData mc;
      mc.doc = doc;
      mc.op = obj;
      mc.mode = MODIFY_ALL;
      mc.flags = 0;
      BaseContainer bc;
      mc.bc = &bc;

      // magnet tool parameters
      bc.SetBool(MDATA_MAGNET_NEAREST, false);
      bc.SetBool(MDATA_MAGNET_VISIBLEONLY, false);
      bc.SetBool(MDATA_MAGNET_CONNECTED, false);
      bc.SetBool(MDATA_MAGNET_PREVIEW, false);
      bc.SetLong(MDATA_MAGNET_MODE, MDATA_MAGNET_MODE_BELL);
      bc.SetLong(MDATA_MAGNET_RESTRICT, MDATA_MAGNET_RESTRICT_WORLD);
      bc.SetReal(MDATA_MAGNET_RESTRICT_X, 1);
      bc.SetReal(MDATA_MAGNET_RESTRICT_Y, 1);
      bc.SetReal(MDATA_MAGNET_RESTRICT_Z, 1);
      bc.SetReal(MDATA_MAGNET_FALLOFF_STRENGTH, 1);
      bc.SetReal(MDATA_MAGNET_FALLOFF_RADIUS, 100);
      bc.SetReal(MDATA_MAGNET_FALLOFF_WIDTH, 0.5);
      //bc.SetData(MDATA_MAGNET_SELECTED, );
      //bc.SetData(MDATA_MAGNET_FALLOFF, );

      if (!SendModelingCommand(ID_MODELING_MAGNET_TOOL, mc)) GePrint("Error");

      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 07/09/2006 at 14:57, xxxxxxxx wrote:

        I'm afraid the magnet tool can only be used interactively by the user, not using SendModelingData()!

        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 07/09/2006 at 17:21, xxxxxxxx wrote:

          Thanks. Then the ID_MODELING_MAGNET_TOOL id for SendModelingCommand is rather useless.

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