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

    Send Modeling Command with hierarchy

    PYTHON Development
    0
    6
    988
    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 14/04/2011 at 09:34, xxxxxxxx wrote:

      Hi there,

      utils.SendModelingCommand() just returns a null, but it should return a hierarchy when converting a Cloner Object or Particle Geometry. Is this a bug or is thee a way to get the full converted hierarchy ?

      thanks !
      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 14/04/2011 at 10:07, xxxxxxxx wrote:

        Can you please post an example?

        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 14/04/2011 at 10:22, xxxxxxxx wrote:

          I'm not able to go to my Pc for today, so i just wrote this code from scratch on my mobile device since I can remember that code.

          def MakeEditable(op) :   
              import c4d   
              from c4d.documents import BaseDocument   
              from c4d.utils import SendModelingCommand as SMC   
            
              op  = [op.GetClone()]   
              doc = BaseDocument()   
              doc.InsertObject(op[0])   
              op  = SMC(command = c4d.MCOMMAND_MAKEEDITABLE, list = op, doc = doc)   
              return op   
            
          def main() :   
              converted = MakeEditable(op)   
              doc.InsertObject(converted)   
            
            
          if __name__ == '__main__':   
              main()
          

          If you convert a ClonerObject, the clones are usually grouped under a null. The same for Particle Geometry.
          Executing this script does only insert the Top null, but not the children.

          I do hope the code works, I'm sure it is exactly the same I used on my Pc.

          Cheers, Niklas

          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 14/04/2011 at 10:35, xxxxxxxx wrote:

            Here's one way that works for me using current state to object:

              
            import c4d  
            from c4d import gui,utils  
              
            def main() :  
                
              bc = c4d.BaseContainer() # Create a new Base Container    
              convert = utils.SendModelingCommand(c4d.MCOMMAND_CURRENTSTATETOOBJECT, list = [op], mode = c4d.MODIFY_ALL, bc = c4d.BaseContainer(), doc = doc)  
              doc.InsertObject(convert[0]) #SMC uses a list.So we need to specify which list element to add to the OM  
              c4d.EventAdd()  
              
            if __name__=='__main__':  
              main()  
            

            -ScottA

            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 14/04/2011 at 10:52, xxxxxxxx wrote:

              Oh that could have been the problem !

              c4d.MODIFY_ALL
              

              I'll check it out tomorrow, thanks. 🙂

              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 19/04/2011 at 01:01, xxxxxxxx wrote:

                Unfortunately, it does not.
                It just inserts the top Null Object. And in your example, the command automatically inserts the object. And I'd need it just internally. And best also all polygons merged together.

                Thanks, nux

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