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

    Mograph Speed to Color

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 167 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 25/03/2014 at 15:34, xxxxxxxx wrote:

      Hi
      I'm very new to Python but would happy to make this effect

      i have tried with MODATA_LASTMAT read the previous postion to get the speed.
      But get at MODATA_LASTMAT only (0,0,0) as output.
      Any help?
      (Googel Translator)

      import c4d
      from c4d.modules import mograph as mo

      #Welcome to the world of Python
      def main() :
        md = mo.GeGetMoData(op)
        if md==None: return False
        cnt = md.GetCount()
        marr = md.GetArray(c4d.MODATA_MATRIX)
        marr_p = md.GetArray(c4d.MODATA_LASTMAT)
        col = md.GetArray(c4d.MODATA_COLOR)
       
        for i in xrange(0, cnt) :
            a = marr _.off
            b = marr_p _.off
            print b
       
           
        md.SetArray(c4d.MODATA_MATRIX, marr, True)
        md.SetArray(c4d.MODATA_COLOR, col, True)
        return True

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

        On 25/03/2014 at 17:36, xxxxxxxx wrote:

        Turtle, I'm pretty sure you already contacted me earlier today, and I already gave you all the info you need.

        MODATA_LASTMAT doesn't give you the previous matrix, you need to store the previous matrix yourself. Then you can calculate the velocity.

        speed = (marr[i].off - prevmarr[i].off).GetLength()
        You can then map that speed to whatever mograph property you want.

        I got a video coming soon that elaborates more on the concept and a couple files that come with it.

        For now, you can check out this project file from krotmonster, which uses the same concept :

        Not sure what else you expect ?
        This is all basic programming and all the info is already out there.
        Please do at least a little effort first, and do some research ! That's the only way to learn.

        A few google queries will quickly point you to a few related threads on a number of boards.
        You'll also come across Lennart from tcastudios as well. He's the guy who initially inspired me to these setups.

        Have fun exploring !!
        Cheers,
        douwe

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