On 05/03/2013 at 17:03, xxxxxxxx wrote:
I want to select a ring or a loop with SendModelingCommand.
Unfortunately, the SKD is very confusing here, leaving it up to find out what some do, or not, by trying :/
http://chicagoc4d.com/C4DPythonSDK/modules/c4d.utils/index.html#c4d.utils.SendModelingCommand
For instance there are many indented and duplicate entries under Untriangulate and ConvertSelection, which obviously don´t seem to have to do anything with it?
Then the tools, which in c4d work not on a selection, but also select it (like loop or ring), don´t seem to take notice of MODELINGCOMMANDMODE_****SELECTION (the same as MODIFY_****SELECTION)?
With the ring loop I got "some" achievment by this:
bc = c4d.BaseContainer()
bc.SetData(c4d.MDATA_RING_EDGE, 22) # Giving an Edge Id for the ring manually
bc.SetData(c4d.MDATA_RING_SELECTION, c4d.SELECTION_NEW)
ring = utils.SendModelingCommand(command=c4d.ID_MODELING_RING_TOOL,
list=[obj],
mode=c4d.MODELINGCOMMANDMODE_EDGESELECTION,
bc=bc,
doc=doc,
flags=c4d.MODELINGCOMMANDFLAGS_CREATEUNDO)
c4d.EventAdd()
print ring
But I have to put the edge ID in there manually and got no idea how to find out an edge ID...
Doing the same with Loop Tool just gives me a False feedback, even if I fill out all its options.
bc2 = c4d.BaseContainer()
bc2.SetData(c4d.MDATA_LOOP_SEL_STOP_AT_BOUNDS, True)
bc2.SetData(c4d.MDATA_LOOP_SEL_SELECT_BOUNDS, False)
bc2.SetData(c4d.MDATA_LOOP_SEL_GREEDY_SEARCH, False)
bc2.SetData(c4d.MDATA_LOOP_LOOP_EDGE, 11)
# bc2.SetData(c4d.MDATA_RING_EDGE, 22)
# bc2.SetData(c4d.MDATA_LOOP_SKIP, 0)
bc2.SetData(c4d.MDATA_LOOP_SELECTION, c4d.SELECTION_NEW)
# bc2.SetData(c4d.MDATA_LOOP_SEL_, 0)
loop = utils.SendModelingCommand(command=c4d.ID_MODELING_LOOP_TOOL,
list=[obj],
mode=c4d.MODELINGCOMMANDMODE_EDGESELECTION,
bc=bc2,
doc=doc,
flags=c4d.MODELINGCOMMANDFLAGS_CREATEUNDO)
print loop
c4d.EventAdd()