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.