• 0 Votes
    3 Posts
    622 Views
    O
    @ferdinand Thank you for the detailed explanation and the solution! This perfectly solved my problem, and I really appreciate you clarifying how to access the DESC_CYCLE values!!
  • Link StoreColorToAOV to Existing AOV (Python)

    windows 2025
    11
    1
    0 Votes
    11 Posts
    2k Views
    I
    Thank you very much for pointing this out. I knew that Cinema 4D’s UI includes a “Linear Numeric Values” button to switch between color spaces, but I wasn’t aware of how to properly handle this conversion in code until you showed me. Your reference to the open_color_io_2025_2.py example is really helpful for better understanding how to manage color spaces in scripts. Thanks again for the great insight!
  • Spline Generator GetVirtualObjects() + GetContour()

    python 2025
    4
    0 Votes
    4 Posts
    881 Views
    ferdinandF
    We will very likely never abandon this technique. The issue is more that there are a lot of hacks in the Spline Mask code and almost none of them are shown in the public code example. And we cannot publish all of these hacks both for strategic (we do not want to show all of our internals) and practical reasons (we cannot explain all the nitty gritty details there). It was not such a good decision to publish that code example; which as far as I understood came to pass as a user asked as to how the Spline Mask object has been realized. But we probably should just have said "no" then. Just as much as I probably should not have shown you that simulation hack. Hacks lead to more hacks and more problems. Cheers, Ferdinand PS: And to be super verbose, you ONLY need this pattern when you "have to" implement a spline that has other (spline) objects as inputs. When you have implemented regular splines like this, you should probably revert that.
  • 0 Votes
    7 Posts
    1k Views
    ferdinandF
    Good to hear!
  • 0 Votes
    3 Posts
    803 Views
    B
    Thanks for the reply @i_mazlov. Yeah, I already tried the workaround, it worked.
  • Make Python Generator update on User Data change

    2024 2025 python
    3
    0 Votes
    3 Posts
    734 Views
    K
    Thansk so much for the video, that was a deep dive! For my issue, I resolved it like this: def message(id, data): if(id==c4d.MSG_DESCRIPTION_POSTSETPARAMETER): userDataID = eval(str(data['descid']))[1][0] if userDataID in [2, 4, 5]: c4d.CallButton(op, c4d.OPYTHON_MAKEDIRTY) so, if any user data touched (including fieldlist), the generator updates itself.
  • How to set up a global variable that all plugins can access

    python
    4
    0 Votes
    4 Posts
    738 Views
    1
    Thank you very much for your answer! I already know how to do it, and your answer has given me some ideas.
  • Problem building the SDK examples on macOS

    2025 macos c++
    8
    0 Votes
    8 Posts
    1k Views
    S
    I actually quite like the Apple keyboard, even if Apple’s idea of a UK keyboard is different to everyone else. For example, shift-2 should produce a “ character but on this Apple kit, it’s the @ symbol. The odd key bindings just make it worse, but it’s a nice keyboard. But I detest the Apple Magic Mouse, I can’t get used to those ‘gestures’. Give me my Logitech trackball any time. A bit of extra software does make a Mac so much more useful though. Pathfinder is way better than the horrible Finder, and BetterZip is very user-friendly.
  • This topic is deleted!

    1
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • Frozen Matrix different

    2025 python
    4
    1
    0 Votes
    4 Posts
    917 Views
    kangddanK
    @i_mazlov said in Frozen Matrix different: 象,并且没有其 I found that it's very similar to the offsetParentMatrix attribute introduced in Maya 2020.:)
  • Render Settings Videopost

    2025 c++ windows
    3
    1
    0 Votes
    3 Posts
    667 Views
    J
    @ferdinand Thanks for the response, I figured that would be the case. John Thomas
  • plugin Loupedeck CT with Redshift

    python 2025 windows
    2
    2
    0 Votes
    2 Posts
    525 Views
    M
    Hi @shafy sorry for the delay I was away for few times. Before we start please read the Support Procedure - About AI-Supported Development. Keep in mind we are not there to develop for you neither integrate or guide you with 3rd party module that you will most likely need in order to control knobs. With that's said what you are asking (at least retrieving a parameter and defining it) is possible for Redshift light intensity. It is as easy as drag and dropping the parameter you are interested by into the Cinema 4D Python Console as explained in Python Script Manager Manual - Drag And Drop. Additionally you can also use the Script Log to record a script or change and therefor re-execute it. Cheers, Maxime.
  • How to handle AddDependence hh deprecation in 2024 onwards

    python 2024 2025
    6
    0 Votes
    6 Posts
    1k Views
    ferdinandF
    Hey @kbar, Thank you for reaching out to us and the heads up, much appreciated. Looks like we forgot to update the function documentation, because the change is in the change notes. I updated the docs for the upcoming release. Cheers, Ferdinand
  • Is it really not possible to create a sound track through python?

    python
    2
    0 Votes
    2 Posts
    438 Views
    ferdinandF
    Hello @phillipg, Welcome to the Maxon developers forum and its community, it is great to have you with us! Getting Started Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules. Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment. Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support. Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads. It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: How to Ask Questions. About your First Question I am not quite sure where you came across the information that it would be impossible to do this, but you can allocate and add a sound track just as any other special track as documented. Please post your code for future support requests. Cheers, Ferdinand """Adds a sound track to the selected object, unless it already has one. """ import c4d doc: c4d.documents.BaseDocument # The currently active document. op: c4d.BaseObject | None # The primary selected object in `doc`. Can be `None`. def main() -> None: """Called by Cinema 4D when the script is being executed. """ if not op: return c4d.gui.MessageDialog("Please select an object.") # The description ID for a sound track and check if it already exists on the object. did: c4d.DescID = c4d.DescID(c4d.DescLevel(c4d.CTsound, c4d.CTsound, 0)) if op.FindCTrack(did): return c4d.gui.MessageDialog("The object already has a sound track.") # Create a new sound track and add it to the object. track: c4d.CTrack = c4d.CTrack(op, did) op.InsertTrackSorted(track) c4d.EventAdd() if __name__ == '__main__': main()
  • 0 Votes
    4 Posts
    731 Views
    ferdinandF
    Hey @lionlion44, Well, doing what you want to do is only halfway possible. An object being soloed just means setting the flag EHIDE on all othe objects. And while there is OHIDE which can be used to hide scene elements in managers, e.g., an object in the Object Manager, it is not being used by the 'Set as Root/Path Bar'-function of the Object Manager. So, you cannot hook into that. What you can do is just write a simple script which operates both flags for you. But to make this air-tight, you will have to implement a plugin (to avoid accidentally saving a scene with hidden elements). Cheers, Ferdinand Result vid.mp4 Code """Demonstrates how to set the visibility of objects in the viewport and the managers. - When CTRL is not pressed while the script is invoked, the visibility state of the selected objects is set, i.e., everything that is not selected will be hidden. - When CTRL is pressed, the visibility state of the selected objects is cleared. - When HIDE_DESCENDANTS_OF_SELECTED_OBJECTS is set to True, the descendants of selected objects will be considered selected as well. WARNING: The visibility state is written PERMANENTLY into the scene graph, i.e., when one hides objects and saves the scene, the visibility state will be saved as well. One can of course just run the script while pressing CTRL to clear the visibility state of such saved and then loaded back scene, but this could possibly brick scenes for other users. To make this air-tight, one would have to implement a plugin which handles un-hiding objects before a scene is being saved (which is not super trivial in Python atm). Use this script at your own risk. """ __author__ = "Ferdinand Hoppe" __copyright__ = "Copyright 2025, Maxon Computer GmbH" import c4d import mxutils doc: c4d.documents.BaseDocument # The currently active document. op: c4d.BaseObject | None # The primary selected object in `doc`. Can be `None`. # Wether to hide objects that are descendants of selected objects. I.e., when you have A-> B -> C, # and A is selected, B and C will be considered selected as well. HIDE_DESCENDANTS_OF_SELECTED_OBJECTS: bool = True def IsSelected(node: c4d.BaseObject) -> bool: """Returns if #node is selected or if any of its predecessors are selected (when selecting descendants implicitly is enabled). """ while node: if node.GetBit(c4d.BIT_ACTIVE): return True if not HIDE_DESCENDANTS_OF_SELECTED_OBJECTS: break node = node.GetUp() return False def SetObjectVisibility(doc: c4d.documents.BaseDocument, clearSate: bool = False) -> None: """Sets the visibility of the object in the managers and the viewport. """ for node in mxutils.IterateTree(doc.GetFirstObject(), True, True, True): isSelected: bool = clearSate or IsSelected(node) node.ChangeNBit(c4d.NBIT_OHIDE, c4d.NBITCONTROL_CLEAR if isSelected else c4d.NBITCONTROL_SET) node.ChangeNBit(c4d.NBIT_EHIDE, c4d.NBITCONTROL_CLEAR if isSelected else c4d.NBITCONTROL_SET) def main() -> None: """Called by Cinema 4D whhen the """ if not op: c4d.gui.MessageDialog("No object selected.") return state: c4d.BaseContainer = c4d.BaseContainer() if not c4d.gui.GetInputState(c4d.BFM_INPUT_MOUSE, 0, state): raise RuntimeError("Failed to get input state") ctrlIsPressed: bool = state[c4d.BFM_INPUT_QUALIFIER] & c4d.QUALIFIER_CTRL # If Ctrl is pressed, clear the visibility state, otherwise set it. SetObjectVisibility(doc, True if ctrlIsPressed else False) c4d.EventAdd() if __name__ == '__main__': main()
  • Move the plane in random effect

    windows 2025
    2
    0 Votes
    2 Posts
    435 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.
  • 0 Votes
    4 Posts
    692 Views
    uogygiuolU
    This is fantastic, thank you so much! This works beautifully. I see your confusion with the "offset". This is absolutely my fault in formulating the question. Sorry about that. I also wanted the clones to follow a spline with an individual offset, but then thought to remove this part to not overcomplicate the question and accidentally left some traces. However, in your video you gave me valuable insight in how to achieve this as well. I already have a working sketch where I'm daisy chaining your script with a Spline Effector in the right order. Giving these thoughtful answers is incredibly valuable, you can't believe how motivating this is to go further.
  • The code entered in the Python emitter has no effect.

    r25 python windows
    4
    0 Votes
    4 Posts
    949 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 Recording 2025-05-02 141611.mp4 Cheers, Ferdinand
  • C4D Python: Redshift IPR Start/Stop Control

    python windows 2025
    5
    0 Votes
    5 Posts
    865 Views
    M
    @hoganXYZ hi if it does not appear in the script log then there is no clear rules. Sometimes there is another way sometimes now it depends on how it is implemented. For the one you asked I do not think it is possible. Best bet would be to ask Redshift on their forum. Cheers, Maxime.
  • lhit from BaseVolumeData

    r21 python windows
    3
    0 Votes
    3 Posts
    578 Views
    JH23J
    Hey @m_adam, Thanks for the reply! What you’re saying makes a lot of sense C++ is clearly the better option for this kind of stuff, especially when you need more control and better performance. I haven’t had much chance to dive into C++ yet, but I’m well aware it’s way more powerful than Python when it comes to working with the engine. It’s a bit of a shame that there’s no way to directly access polygon info from Python, since that’s exactly what I needed. But still, I really appreciate you taking the time to explain it. Cheers, James H.