Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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
    • Recent
    • Tags
    • Users
    • Login

    GetAndCheckHierarchyClone & subdivision surfaces ?

    Scheduled Pinned Locked Moved PYTHON Development
    11 Posts 0 Posters 1.0k Views
    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 Offline
      Helper
      last edited by

      On 24/07/2015 at 13:48, xxxxxxxx wrote:

      I have this code snippet in my def main(), that I use to get the child (parametric) object and convert it to a polygonal object to make further modifications. This way I can make nondestructive generator/editor that works fluently with parametric objects as well.

      However, when I place a subdivision surface as a child object, this bit does not work. The result is never a polygonal object but always a BaseObject.

      What can I do in this case?

      child = op.GetDown()
      polyobj = op.GetAndCheckHierarchyClone(hh,child,c4d.HIERARCHYCLONEFLAGS_ASPOLY, False)

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

        On 25/07/2015 at 04:45, xxxxxxxx wrote:

        Tried many things, I can't get the poly representation of a subdiv. surface 😞

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

          On 27/07/2015 at 06:05, xxxxxxxx wrote:

          Hello,

          Are you using this code in a Python Generator? Please always include the context of your code and your question.

          As described in your other tread ("Custom Subdivide Generator"), GetAndCheckHierarchyClone() does not return an object but a dictionary. Using the "clone" index I have no problems to access the polygon version of a child subdivision surface.

          Best wishes,
          Sebastian

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

            On 27/07/2015 at 13:55, xxxxxxxx wrote:

            Yes this is a python generator,
            can you post a code that "works" ? When I try to get the poly representation of the child subdivision surface all I get is:
            <c4d.BaseObject object called 'Subdivision Surface/Null' with ID 5140 at 0x000000E56BA8D150>

            which is a base object

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

              On 28/07/2015 at 02:47, xxxxxxxx wrote:

              Hello,

              this code works perfectly fine for me:

                
              result = op.GetAndCheckHierarchyClone(hh,child,c4d.HIERARCHYCLONEFLAGS_ASPOLY,False)  
                
              if result is None:  
                   return None  
                
              polyobj = result["clone"]  
              

              best wishes,
              Sebastian

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

                On 28/07/2015 at 03:36, xxxxxxxx wrote:

                Here is an example file
                https://www.dropbox.com/s/ci8x5bsi46vqfcl/subdiv_example.c4d?dl=1

                As you can see the left python generator contains a subdivision object, and it's not converted to polygons.
                However I've converted the right example's content to polygonal object and it works perfectly with a polygonal operation.

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

                  On 28/07/2015 at 09:26, xxxxxxxx wrote:

                  Hello,

                  I can confirm some problem in your scene with the very Subdivision Surface object you use. But I cannot reproduce the behavior with a new Subdivision Surface object and a cube. Does this problem only occur with that scene or also with a new scene and new elements?

                  Best wishes,
                  Sebastian

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

                    On 28/07/2015 at 11:14, xxxxxxxx wrote:

                    Yes, this happens with every scene and every new element.
                    Can you post the same scene made on your end, so I can test it?

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

                      On 29/07/2015 at 10:21, xxxxxxxx wrote:

                      Hello,

                      the Python Generator in this file works perfectly fine for me:

                      [URL-REMOVED]

                      best wishes,
                      Sebastian


                      [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

                        On 29/07/2015 at 14:49, xxxxxxxx wrote:

                        I've bean experimenting with this since we've discussed, looks like sometimes it works and sometimes it does not. Sometimes when you play around a lot with the same generator, it suddenly stops working (I have no idea why)

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

                          On 30/07/2015 at 09:16, xxxxxxxx wrote:

                          Hello,

                          if you can find a way to reproduce the issue we could file a bug report.

                          Best wishes,
                          Sebastian

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