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
    • Register
    • Login

    Convert Object internally

    PYTHON Development
    0
    4
    729
    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.
    • H
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 19/02/2011 at 20:06, xxxxxxxx wrote:

      Hi Guys,

      just started Python and I think I'm doing very well.
      I've created a simple Cloner with the Python Generator. Now I want to Convert the Clone internally to a PolygonObject.
      I tried SendModelingCommand() but it crashes because there is no document overloaded (because the Object is just virtual x) ).

      So, my Question would be: Is there a way to Convert an Object internally in Python ?

      Thanks in advance, nux

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 25/02/2011 at 08:01, xxxxxxxx wrote:

        I could find a way to do it:

        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,  
                                    doc = doc )  
          return op[0]
        

        Cheers, nux

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 25/02/2011 at 08:03, xxxxxxxx wrote:

          I recommend you to use c4d.Ospline, c4d.Opolygon,... instead of hardcoded constants. I would also use CheckType(...) instead of GetType() so it accepts subtypes as well.

          op.CheckType(c4d.Opolygon)
          

          Cheers, Sebastian

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 25/02/2011 at 08:29, xxxxxxxx wrote:

            Ah thanks, changed it 🙂

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