Hi PluginCafe team!
I'm trying to create a script that weld selected points on the middle. For the scene, I just have the default cube made to an editable object.
It works as expected, but not with the AddUndo.
It gives me a dialog box error of
A problem with this project has been detected: Object "Cube" - Point selection out of bonds
Is there a way around this?
Here is the code so far
import c4d
from c4d import utils
settings = c4d.BaseContainer()
res = utils.SendModelingCommand(command = c4d.ID_MODELING_WELD_TOOL,
list = [op],
mode = c4d.MODELINGCOMMANDMODE_POINTSELECTION,
bc = settings,
doc = doc)
doc.AddUndo(c4d.UNDOTYPE_CHANGE, op)
c4d.EventAdd()
Thank you for looking at the problem
P.S.
From what I understand, if you set the c4d.BaseContainer at empty, it will weld it on the middle by default which is what I want. But just wondering, is there a way to set-it explicitly?
I checked the parameters on the resource section which is follows:
{
MDATA_WELD_POINT = 1100, //VECTOR
MDATA_WELD_TOPOINT = 1101, //BOOL
MDATA_WELD_POINTINDEX = 1102, //LONG
MDATA_WELD_OBJECTINDEX = 1103, //LONG
MDATA_WELD_VISIBLE = 1104, //BOOL
MDATA_WELD_COLLAPSE = 1105, //BOOL
MDATA_WELD_COLLAPSE_P1 = 1106, //LONG
MDATA_WELD_COLLAPSE_P2 = 1107, //LONG
MDATA_WELD_COLLAPSE_OBJ1 = 1108, //LINK
MDATA_WELD_COLLAPSE_OBJ2 = 1109, //LINK
MDATA_WELDPOINT_
};
But the documentation does not provide a description on such parameters. Or maybe I'm missing something out?