Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Create folder in Volume Builder

    Cinema 4D SDK
    windows python 2023
    2
    3
    547
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      datamilch
      last edited by

      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()
      
      i_mazlovI 1 Reply Last reply Reply Quote 0
      • i_mazlovI
        i_mazlov @datamilch
        last edited by

        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,
        Ilia

        The 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()
        

        MAXON SDK Specialist
        developers.maxon.net

        D 1 Reply Last reply Reply Quote 0
        • D
          datamilch @i_mazlov
          last edited by

          hi @i_mazlov,
          thanks for the answer. good to know about this status / limitation.
          for my current case I found a solution without folders..

          1 Reply Last reply Reply Quote 0
          • First post
            Last post