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

    Copy color of a clone to an other clone

    Cinema 4D SDK
    python
    3
    4
    1.3k
    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.
    • L
      leo_ha
      last edited by r_gigante

      Hey, first time posting here.
      i´m trying to copy the clones color of cloner A to clones of cloner B.
      I want to colorize the clones of cloner A (giver-cloner) with some effectors and transfer the colors to the clones of cloner B (taker-cloner). So the clone with index 1 of the giver-cloner will have the same color as clone with index1 of the taker-cloner and so on for all clones.
      My little python script seems to work, but the viewport says smth different (same for the render).
      After running the script and print the MODATA_COLOR of both cloners they are the same, but Viewport still shows nothing.

      What am I missing here?

      import c4d
      from c4d.modules import mograph as mo
      
      def main():
          g = mo.GeGetMoData(doc.SearchObject('giver'))
          if g==None: return False
          t= mo.GeGetMoData(doc.SearchObject('taker'))
          if t==None: return False
      
          colorsg = g.GetArray(c4d.MODATA_COLOR)
      
          t.SetArray(c4d.MODATA_COLOR, colorsg, 0)
          colorst = t.GetArray(c4d.MODATA_COLOR)
      
          print colorsg
          print colorst
      

      0_1537295186253_Bildschirmfoto 2018-09-18 um 20.02.49.png

      1 Reply Last reply Reply Quote 0
      • B
        bencaires
        last edited by

        Hey Leo,

        I think this thread from earlier is what you need using a python effector.
        https://developers.maxon.net/forum/topic/10968/python-effectors/5

        L 1 Reply Last reply Reply Quote 1
        • L
          leo_ha @bencaires
          last edited by

          @bencaires thanks a lot, with python effector it works like a charm 🙂

          1 Reply Last reply Reply Quote 0
          • a_blockA
            a_block
            last edited by

            Hi,

            just a small request from our side: Please do not cross post to different forums (this topic on CGSociety). Chances are, you'll make people work for you redundantly.

            Cheers,
            Andreas

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