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

    Poor mans tracer/linker - help pls

    Scheduled Pinned Locked Moved PYTHON Development
    1 Posts 0 Posters 215 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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 03/12/2011 at 02:43, xxxxxxxx wrote:

      OK

      I've set myself a task
      this isn't supposed to be anything special

      Ubertracer is far more advanced than anything I can dream of
      but I'd like to understand some of the processes (and syntax)  in creating splines between clones

      Problems to date
      Best way to generate the splines Once!
      Best 'Holder' to use for the code - generator - effector etc

      Can I use the 'holder' object to Insert the splines 'Under'
      Then check to see if they exist?

      Forgive the stumblings (again)

      Got this far in modifying a Python Effector
      It will generate a set of splines between 
      the original clones position
      and the effectors offset

      Yes you have to switch it off once the splines are generated (problem 1 above)

      any suggestion
      snippets of code

      greatly recieved

      import c4d
      from c4d.modules import mograph as mo

      def main() :
          md = mo.GeGetMoData(op)
          if md==None: return
          cnt = md.GetCount()
          
          #matrix list of clones
          marr = md.GetArray(c4d.MODATA_MATRIX)
          
          #flag list of clones
          farr = md.GetArray(c4d.MODATA_FLAGS)
          
          offset = op[c4d.ID_USERDATA, 1]

      for i in xrange(0, cnt) : #iterate over clones
              marr .off = marr .off +(marr .v3*offset)
      _ _ _        spl = c4d.SplineObject(2,c4d.SPLINETYPE_LINEAR)  #Create a 2pt. Bezier spline in memory only___
      _ _ _        spl.SetPoint(0,c4d.Vector(marr .v3)) #Place the first point here___
      _ _ _ _        spl.SetPoint(1,c4d.Vector(marr .off))  #Place the second point here____
      _ _ _ _ _ _____
      _ _ _ _ _        spl.Message(c4d.MSG_POINTS_CHANGED) # tell the spline it's points did change_____


      _ _ _ _ _        doc.InsertObject(spl)_____
      _ _ _ _ _                            _____
      _ _ _ _ _    #handle the modified flag list back to mograph_____
      _ _ _ _ _    md.SetArray(c4d.MODATA_FLAGS, farr, True)_____
      _ _ _ _ _    _____
      _ _ _ _ _    #handle the modified matrix list back to mograph_____
      _ _ _ _ _    md.SetArray(c4d.MODATA_MATRIX, marr, True)_____



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