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
    • Login

    Knife Modeling Command

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 297 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

      On 10/11/2014 at 07:58, xxxxxxxx wrote:

      I'm using SendModelingCommand() to apply the Knife Tool to some objects. But it does not seem like the
      modeling command supports all the options the actual Knife Tool does. For instance, I can not activate the
      generation of N-Gons, only cutting visible polygons or any but the "Line" mode.

      Check out the scene here. You can move the "Cut_Plane" around to change the cut position, and at some
      positions it creats NGons. Even if you activate the "NGons" option, it still creates NGons.

      The code I use to cut the object is

      def cut(obj, p1, p2, n1, n2, options={}) :
          data = c4d.BaseContainer()
          data.SetVector(c4d.MDATA_KNIFE_P1, p1)
          data.SetVector(c4d.MDATA_KNIFE_P2, p2)
          data.SetVector(c4d.MDATA_KNIFE_V1, n1)
          data.SetVector(c4d.MDATA_KNIFE_V2, n2)
          data.SetBool(c4d.MDATA_KNIFE_NGONS, bool(options.get('ngons')))
          data.SetBool(c4d.MDATA_KNIFE_VISIBLEONLY, bool(options.get('visible_only')))
          c4d.utils.SendModelingCommand(
              c4d.MCOMMAND_KNIFE, [obj], bc=data, doc=obj.GetDocument())
      

      Can I enabled NGons and Visible Only somehow?

      Thanks
      Niklas

      Edit : By the way, here's a nice post from Yannick with details about cutting.

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

        On 11/11/2014 at 05:46, xxxxxxxx wrote:

        Hello,

        you are using the Knife command (MCOMMAND_KNIFE). The parameters you want to enable are parameters of the Knife tool (ID_MODELING_KNIFE_TOOL). Unfortunately this tool does not support  the usage of SendModellingCommand. The docs will be updated.

        Best wishes,
        Sebastian

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

          On 13/11/2014 at 00:33, xxxxxxxx wrote:

          Hi Sebastian, thanks for the reply.
          Since the prefix of the symbols that need to be used (P1, P2, V1, V2),
          is the same as the other knife tool symbols, I thought it might work
          somehow. Unfortunate it does not 😞

          Best
          Niklas

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