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

    Python: Make Object Editable

    PYTHON Development
    0
    8
    2.1k
    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 06/10/2010 at 16:24, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   12.021 
      Platform:      
      Language(s) :       PYTHON  ;

      ---------
      Background:
      I'm trying to create a Python Generator object that will take a parametric spline object as an input and then spit out a standard spline with a B-Spline interpolation (specifically so I can round some of the harsh corners from a Turtle Mode MoSpline).

      My question:
      What is the equivalent of the "Make Object Editable" command in Python?

        
      import c4d   
      #B-Spliner: Converts all child spline objects into a single spline of type B   
        
      def makeEditable(obj) :   
          return obj.GetVirtualObjects() #This command doesn't exist, what should I use instead?   
        
      def splineToBSpline(spline_obj) :   
          return spline_obj   
        
      def main() :   
          return splineToBSpline(makeEditable(op.GetDown()))   
      
      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 28/09/2011 at 13:16, xxxxxxxx wrote:

        This seems to work:

          
        def MakeEditable(op) :   
            if debug: print "MakeEditable()"   
            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]   
        
        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 29/09/2011 at 09:54, xxxxxxxx wrote:

          You could also use BaseObject.GetCache().

          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 30/09/2011 at 06:56, xxxxxxxx wrote:

            c4d.CallCommand(12236) makes the currently selected object editable as well.

            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 01/10/2011 at 11:39, xxxxxxxx wrote:

              Originally posted by xxxxxxxx

              You could also use BaseObject.GetCache().

              THIS!!! so helpful, returns a polygon representation of almost any object... including cloners!

              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 02/10/2011 at 08:19, xxxxxxxx wrote:

                Originally posted by xxxxxxxx

                Originally posted by xxxxxxxx

                You could also use BaseObject.GetCache().

                THIS!!! so helpful, returns a polygon representation of almost any object... including cloners!

                Please be very careful using this function. It's not always guaranteed that the caches are build. The only time this is guaranteed is during rendering. Always check if the returned cache is valid. Please check the docs of the other cache functions as well (GetDeformCache, CheckCache).

                cheers,
                Matthias

                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 02/10/2011 at 08:32, xxxxxxxx wrote:

                  @Matthias: GetCache() returns 'None' while rendering, here. Is this what it's supposed to be ?
                  (Btw, is it an error that this topic appears in Python AND SDK Help forum ?)

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

                    Originally posted by xxxxxxxx

                    Originally posted by xxxxxxxx

                    Originally posted by xxxxxxxx

                    You could also use BaseObject.GetCache().

                    THIS!!! so helpful, returns a polygon representation of almost any object... including cloners!

                    Please be very careful using this function. It's not always guaranteed that the caches are build. The only time this is guaranteed is during rendering. Always check if the returned cache is valid. Please check the docs of the other cache functions as well (GetDeformCache, CheckCache).

                    cheers,
                    Matthias

                    [/QUOTE]

                    i tend to find that simply checking what your object is before your get the cache can be useful too. if its not he specific object you are looking for... than no cache is built. generally speaking GetRad() can be useful as well, when you don't need all the polygons and just need to approximate the object's size.

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