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
    1. Maxon Developers Forum
    2. Parvin
    P
    • Profile
    • Following 1
    • Followers 0
    • Topics 1
    • Posts 6
    • Best 0
    • Controversial 0
    • Groups 0

    Parvin

    @Parvin

    0
    Reputation
    44
    Profile views
    6
    Posts
    0
    Followers
    1
    Following
    Joined Last Online

    Parvin Unfollow Follow

    Latest posts made by Parvin

    • RE: retrieve data from multiple cloners in python

      Thank you @m_adam it's really helpful! I was going to a wrong direction. I chose to do a project that has every new aspect to explore :)) I will for sure disturb you in future with my questions. I appreciate your suggestions.

      Parvin

      posted in Cinema 4D SDK
      P
      Parvin
    • RE: retrieve data from multiple cloners in python

      I have 90 strut shaping a sphere in this scene. each strut is a linear cloner of cubes and they represent LED strips. I want to animate the light in realtime. So, I am trying to animate the sphere with effectors and change the color, then send the color data through Lumos Library to a Raspberry Pi to animate light. I'm awfully new to C4D and Python in C4D.
      I know I have to give address to each cube and link it with the address I have for the LED pixel. But that goes way further. what I'm struggling with now is capturing data of each cloner.

      Thanks for your patience,
      Parvin

      posted in Cinema 4D SDK
      P
      Parvin
    • RE: retrieve data from multiple cloners in python

      Oh I see. I take that note for python effector, thanks. I think I explained it in a very wrong way because as I see you have a cloner as the child of other cloner. In my example, I have 90 different cloners. I will attach my example.

      P

      90 strut_Animation.c4d

      posted in Cinema 4D SDK
      P
      Parvin
    • RE: retrieve data from multiple cloners in python

      @m_adam when I ran the code you posted, I got the error "Failed to retrieves op and its child". I am calling each function in the main to realize what each of them is doing. But I think all of them are linked to one another.
      So my main question is that when you say I need to select my objects in order, how should I exactly do this? I put the Python Effector in the effectors list for each 90 cloners that I have, and I assumed this would work.

      Thanks,
      Parvin

      posted in Cinema 4D SDK
      P
      Parvin
    • RE: retrieve data from multiple cloners in python

      Wow! thanks Adam. I have to take my time to process all the useful information you gave me. I will reply on this post if I have further questions.

      posted in Cinema 4D SDK
      P
      Parvin
    • retrieve data from multiple cloners in python

      Hi,
      I'm sorry if I'm posting a repeated topic. I am trying to get color data from multiple mo-graph in python to send out to a micro controller for realtime animation.
      I am explaining what I've done so far
      I have 90 linear cloners of cubes (there are 30 of them in each cloner). I want to get color data from each clone and send the rgb color to the controller. After a couple of hours searching I came to this conclusion to make a blank 2D list, append each cloner as an object to the list and therefore, I can have an ID to retrieve the data from. from my one week experience in C4D and python, I wrote this code. I set 2 cloners as user data. this it absolutely not working. If any one has done sth similar to what I want to do, his/her help would be much appreciated.

      import c4d
      from c4d.modules import mograph as mo
      from c4d import utils
        
      def main(): 
          n = 2
          m = 33
          Matrix = [[0] * m for i in range(n)]
         
          Obj1 = op[c4d.ID_USERDATA,2]
          Obj2 = op[c4d.ID_USERDATA,1]
          
          count = len(Obj1) 
          print count
          
          for j in range (32): 
             Matrix[j][0] = Obj1
             Matrix[j][1] = Obj2 
             
          md = mo.GeGetMoData(op)
          if md==None: return False
          
          cnt = md.GetCount()
          marr = md.GetArray(c4d.MODATA_MATRIX)
          carr = md.GetArray(c4d.MODATA_COLOR)
          
          print carr
             
          for i in reversed(xrange(0, cnt)):
             md.SetArray(c4d.MODATA_COLOR, carr, True)
             md.SetArray(c4d.MODATA_WEIGHT, warr, True)
             return True
      
      posted in Cinema 4D SDK
      P
      Parvin