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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    One polygonal object from a hierarchy.

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 386 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 15/12/2017 at 19:32, xxxxxxxx wrote:

      Hello plugincafe!
      This object plugin simply extrudes all polygons from its child but sometimes it does not work properly. 
      For example, if I attempt to use a figure object or MoText, Voronoi fracture(objects with sub-objects) as a child object, it simply ignores it.
      Is it possible to solve this problem?

      def GetVirtualObjects(self, op, hh) :
          
          #Check child Object
              child = op.GetDown()
              if not child: return None

      #Generate clone
              cloneGenerator = op.GetAndCheckHierarchyClone(hh, child, c4d.HIERARCHYCLONEFLAGS_ASPOLY, False)
              dirty = cloneGenerator["dirty"]
              clone = cloneGenerator["clone"]

      if not dirty:
                  return clone

      #Extrude all polygons
              settings = c4d.BaseContainer()
              settings[c4d.MDATA_EXTRUDE_OFFSET] = op[10000]
              res = c4d.utils.SendModelingCommand(command = c4d.ID_MODELING_EXTRUDE_TOOL,
                                                  list    = [clone],
                                                  mode    = c4d.MODELINGCOMMANDMODE_POLYGONSELECTION,
                                                  bc      = settings,
                                                  doc     = child.GetDocument())

      #Subdivide geometry
              subDivisionSurface = c4d.BaseObject(c4d.Osds)
              clone.InsertUnder(subDivisionSurface)

      return subDivisionSurface

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

        On 19/12/2017 at 08:01, xxxxxxxx wrote:

        Hi Merkvilson, thanks for writing us.

        The reason behind this lack of desired functionality is due to the fact that objects presenting a hierarchical structure (like figure, motext or voronois) can't be directly used in the send modelling command. You actually should traverse your object hierarchy and pass to the extrude command the cache representation of the model itself.

        Best, Riccardo

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