THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/06/2011 at 18:08, xxxxxxxx wrote:
ok, so i have tried a number of different things but i still cant get the SendModellingCommand to work. I have simplified my idea drastically to try and get the basic idea working, but i still am not doing something right. Essentially, all i want to do right now, is create a beveled cube using a python object. here is my scene file. i got it to stop crashing, but it will not bevel.
any help is greatly appreciated.
here is a link to download the c4d file
http://www.sendspace.com/file/zsg754
and here is the code within the python generator:
import c4d
#Welcome to hell
def main() :
doc = c4d.documents.GetActiveDocument
cube = c4d.BaseObject(c4d.Ocube)
null = c4d.BaseObject(c4d.Onull)
cube1 = MakeEditable(cube)
cube2 = Bevel(cube1,30)
return cube2
def ExtrudeInner(obj,offset,doc) :
pass
def Bevel(op,offset) :
bc = c4d.BaseContainer()
bc[2042] = offset
if(not op) | op.CheckType(c4d.Opolygon) | op.CheckType(c4d.Ospline) : return op
doc = c4d.documents.BaseDocument()
doc.InsertObject(op[1], None, None)
obj = c4d.utils.SendModelingCommand(
command = 450000005,#bevel
list = obj,
settings = bc,
doc = doc )
return obj[1]
def MakeEditable(op) :
import c4d
if (not op) | op.CheckType(c4d.Opolygon) | op.CheckType(c4d.Ospline) : return op
op = [op.GetClone()]
doc = c4d.documents.BaseDocument()
doc.InsertObject(op[0],None,None)
op = c4d.utils.SendModelingCommand(
command = c4d.MCOMMAND_MAKEEDITABLE,
list = op,
mode = c4d.MODELINGCOMMANDMODE_EDGESELECTION,
doc = doc )
return op[0]