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
    1. Maxon Developers Forum
    2. Fabio B
    3. Topics
    F
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    Topics created by Fabio B

    • F

      Move the plane in random effect

      Cinema 4D SDK
      • windows 2025 • • Fabio B
      2
      0
      Votes
      2
      Posts
      394
      Views

      M

      Hi @Fabio-B

      Thank you for reaching out to us. Unfortunately, your question is off topic for the forum you have posted in. Please check the Forum Overview for an overview of the scope of the different forums.

      On this forum we only provide support for third party software developers about the Cinema 4D Software Development Kit. We unfortunately cannot provide end user support, as we lack the tools and the knowledge to do so.

      To receive end-user support, please visit our Support Center and create a ticket for your issue

      Cheers,
      Maxime.

    • F

      The code entered in the Python emitter has no effect.

      Cinema 4D SDK
      • r25 python windows • • Fabio B
      4
      0
      Votes
      4
      Posts
      653
      Views

      ferdinandF

      Hey @Fabio-B,

      ⚠ Please note that we cannot provide support for AI generated code. See Support Procedures: Scope of Support for details.

      When you want the clones to move, or in other words to be animated over time, you will need a noise and cannot use hashes or random values, as they are not interpolated, i.e., continous.

      """Realizes an effector that attracts MoGraph particles spherically around its origin. Add the example to a Matrix object to understand its effect. In Full Control mode we can realize a true attraction force as we have full control over the particle values. Compare this example to Parameter Control mode to understand the difference. """ import c4d import mxutils op: c4d.BaseObject # The Python Effector object containing this code. gen: c4d.BaseObject # The MoGraph Generator executing `op`. doc: c4d.documents.BaseDocument # The document `op` and `gen`are contained in. def main() -> bool: """Called by Cinema 4D to evaluate the effector. """ # Get the particle data for the effector #op. Get out when either the data cannot be retrieved. data: c4d.modules.mograph.MoData = c4d.modules.mograph.GeGetMoData(op) if data is None: return 1.0 # Get the matrices of the particles. This is the array we will modify. matrices: list[c4d.Matrix] = data.GetArray(c4d.MODATA_MATRIX) # For each particle write a new persistent random height value, hashed over the index of the # particle. This will cause the height each time to be the same, as long as the index of the # particle does not change. One could also hash the position of the original particle to get a # height value that is not dependent on the index of the particle (e.g., when the user changes # the order of the particles in the Matrix object). for i in range(data.GetCount()): pos: c4d.Vector = matrices[i].off y: float = c4d.utils.noise.Noise(matrices[i].off, doc.GetTime().Get()) * 25.0 matrices[i].off = c4d.Vector(pos.x, y, pos.z) # Hash a height value over the position of the particle. # y: float = mxutils.g_random.HashVectorToNumber(matrices[i].off) * 25.0 # Write the new data back. data.SetArray(c4d.MODATA_MATRIX, matrices, op[c4d.FIELDS].HasContent()) return True

      Cheers,
      Ferdinand