Create folder in Volume Builder
-
hi there,
i am trying to add a folder/group to the object list of a volume builder.
but i have no idea how. there is nothing in the the documentation and no examples either.
is this even possible?as an alternative i could probably nest multiple volume builders, but folders would be more elegant i think.
the current test code:
def main() -> None: # create objects null = c4d.BaseObject( c4d.Onull ) cube = c4d.BaseObject( c4d.Ocube ) hole = c4d.BaseObject( c4d.Ocylinder ) hole[c4d.PRIM_CYLINDER_HEIGHT] = 300 # create volume builder vb = c4d.BaseObject( c4d.Ovolumebuilder ) vm = c4d.BaseObject( c4d.Ovolumemesher ) # insert into scene doc.InsertObject( null ) cube.InsertUnderLast( null ) hole.InsertUnderLast( null ) vm.InsertUnderLast( null ) vb.InsertUnderLast( vm ) # insert into volume builder vb.AddSceneObject( cube ) vb.AddSceneObject( hole ) vb.SetBoolMode( 1, c4d.BOOLTYPE_DIFF ) c4d.CallCommand(100004748) # unfold all c4d.EventAdd() return if __name__ == '__main__': main()
-
Hi @datamilch,
Even though technically creating a folder inside the volume builder is possible (please check the code snippet below), you should do this at your own risk as I'm pretty sure this is not intended to be used from our public API this way.
I will bring this topic up to the corresponding developer, once he is back from vacation, but I cannot give you any promises.
Hence, I'm leaving all related follow up topics (e.g. how to rename the folder or how to put the object inside the folder, etc..) without any solution, as there's no good solution for it at the moment (if there's even any )
Cheers,
IliaThe code showing how to create folder inside the VolumeBuilder:
import c4d def main() -> None: cube = c4d.BaseObject(c4d.Ocube) vb = c4d.BaseObject(c4d.Ovolumebuilder) doc.InsertObject(cube) doc.InsertObject(vb) vb.AddSceneObject(cube) data = { 'descid': c4d.ID_VOLUMEBUILDER_ADDMISCBUTTON } ID_VOLUMELIST_ADDFOLDER = 2 # this ID is excluded from our public API vb[c4d.ID_VOLUMEBUILDER_ADDMISCBUTTON] = ID_VOLUMELIST_ADDFOLDER vb.Message(c4d.MSG_DESCRIPTION_CHECKUPDATE, data) c4d.EventAdd() if __name__ == '__main__': main()
-
hi @i_mazlov,
thanks for the answer. good to know about this status / limitation.
for my current case I found a solution without folders..