Knifing with python

  • On 16/01/2013 at 14:20, xxxxxxxx wrote:

    Bonjour tout la monde,

    I found this post (over in the C arena), among others, on using the knife tool with smc, and I've spent a lot of time trying to figure it out in general with no joy.  I find myself asking, "Is it even possible?"

    Here's the simple bit I've been trying:

    data = c4d.BaseContainer()
        data.SetLong(1100, 3) ##Set mode to Plane
        data.SetBool(1115, 1) ##Set to Slice, for now, so I can figure out one thing at a time
        data.SetLong(1107, 2) ##Set plane to XZ
        objList = []
        objList.append(doc.GetFirstObject())      ##Temporary cube for testing
        c4d.utils.SendModelingCommand(244, objList, 0, data, doc, c4d.MODELINGCOMMANDFLAGS_CREATEUNDO)       ##244 = c4d.MCOMMAND_KNIFE

    No errors, just... nothing happens.  Anyone know how to/have ever successfully cut anything in any way whatsoever?  Really appreciate the help.


  • On 16/01/2013 at 15:29, xxxxxxxx wrote:

    the knife tool requires mouse input in all modes, even for the plane-slice mode.
    as stated in the linked thread it is currently not possible to use the knife tool as
    a smc command, as it is not possible access/write the required data.

    Vector MDATA_KNIFE_P1;
    Vector MDATA_KNIFE_V1;
    Vector MDATA_KNIFE_P2;
    Vector MDATA_KNIFE_V2;
    >__Originally posted by xxxxxxxx__

    Originally posted by xxxxxxxx

    that i wasn't able to set the vectors for the knife tool is just a limitation

    of the knifetool ?

    I contacted the developers on this.

    and just as a advice - try not to use smc if you can avoid it in any way. it is more or less just one
    big bug.

  • On 16/01/2013 at 16:10, xxxxxxxx wrote:

    Thanks, devil.

    I was hoping the Plane mode might lead to an exception.  Oh well, there's always another way.

    'Preciate ya.

  • On 29/01/2013 at 07:25, xxxxxxxx wrote:


    It's possible to send a knife modeling command. I just posted a code example in the other thread.

  • On 24/02/2013 at 13:49, xxxxxxxx wrote:

    Thanks Yannick!  That's awesome.

    Sorry I'm a bit late noticing you posted this, I had given it up for dead :)

Log in to reply