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

    Cloned Surface Deformer data

    Cinema 4D SDK
    c++ r19 r20
    2
    3
    984
    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.
    • rsodreR
      rsodre
      last edited by rsodre

      Hi!

      If I clone an object containing a Surface Deformer of type Projection as a child, seems like it's the initialized data is lost. When I send a JOIN or CURRENTSTATETOOBJECT modeling command, the deformer has no effect on the object.

      I tried sending a ID_CA_SURFACE_DEFORMER_OBJECT_INITIAL description command to the cloned deformer, but it don't seems to initialize the data either.

      Any tips or clues on how to preserve or initialize the deformer?

      Roger

      1 Reply Last reply Reply Quote 0
      • S
        s_bach
        last edited by

        Hello,

        could you please tell us what programming language and version of Cinema 4D your are using? You could share that information by adding tags to your message. See Read Before Posting.

        It seems that when you press "Initialize" the deformed object must exist. In the case of a generator this means that the cache of the generator must be build.

        You can build the caches by calling ExecutePasses() after you have inserted the object into the BaseDocument. Something like this (tested in R20):

        # clone
        clone = op.GetClone(c4d.COPYFLAGS_0, None)
        clone.SetName("clone")
        doc.InsertObject(clone)
        
        # build caches
        doc.ExecutePasses(None, True, True, True, c4d.BUILDFLAGS_INTERNALRENDERER)
        
        # get child deformer
        deformer = clone.GetDown()
        
        # call "Initialize""
        message = {}
        message['id'] = c4d.ID_CA_SURFACE_DEFORMER_OBJECT_INITIAL
        
        deformer.Message(c4d.MSG_DESCRIPTION_COMMAND, message)
        
        c4d.EventAdd()
        

        best wishes,
        Sebastian

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        rsodreR 1 Reply Last reply Reply Quote 0
        • rsodreR
          rsodre @s_bach
          last edited by

          @s_bach sorry, forgot about the tags. I'm using C++ SDK on R19/R20.

          I try calling ExecutePasses(), thanks.

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