• TimeLine DopeSheet not update

    Cinema 4D SDK 2026 python
    2
    0 Votes
    2 Posts
    15 Views
    ferdinandF
    Hello @chuanzhen, Thank you for reporting this. At first glance this looks like a bug/regression in 2026.3.0. I'll have to check in more detail myself before I can say for sure. But your code is also incorrect, the NBIT_TLX_SELECT2 bits are internal and not for what you think they are. You must use NBIT_TLX_SELECT instead. But they are currently malfunctioning for me on Windows in 2026.3. Until I am sure, I will not yet classify this as a bug. Cheers, Ferdinand In 2026.2.0, this code randomly selects and deselects tracks in an all timelines for the active object. I.e., you can spam-click the script and see the track selections 'jump around'. In 2026.3 it does exactly nothing (at least on my Windows machine). import c4d import random def main() -> None: for track in op.GetCTracks(): bit: int = random.choice([c4d.NBITCONTROL_SET, c4d.NBITCONTROL_CLEAR]) for tl in (c4d.NBIT_TL1_SELECT, c4d.NBIT_TL2_SELECT, c4d.NBIT_TL3_SELECT, c4d.NBIT_TL4_SELECT): track.ChangeNBit(tl, bit) c4d.EventAdd() if __name__ == '__main__': main()
  • 0 Votes
    1 Posts
    17 Views
    No one has replied
  • 0 Votes
    8 Posts
    76 Views
    ThomasBT
    @ferdinand First of all, thank you very much for your efforts; where you get such perseverance from is truly remarkable. Windows 11 Pro 26200.8524 Cinema 4D 2026.2 Hardware CPU: AMD Ryzen 9 5950X 16-Core RAM: 64 GB GPU: RTX 3060 (Studio Driver) I think you misunderstood me. I’m not trying to report a bug here, since the issue isn't with Cinema 4D itself. Rather, I wanted to know if I’m handling the threading correctly here within the Main Thread, because I’ve been experiencing some freezing when I clicked the "Convert" button during playback. ️By the way in the simple plugin example, you can click the Convert Button multiple times. It just toggles back and forth between the two sounds. I experienced these freezes with the paid plugin that is already on the market. In principle, the convert function is the same, though it’s a bit more complex—calculating and loading audio. I have the bug report, too, in case that’s of interest. Though I don't think I checked for c4d.threading.GeIsMainThreadAndNoDraw in that instance. The AI ​​has already analyzed the bug report and specifically pointed out the threading issue, so I’m asking here for the best way to handle the threading or whether I’m doing something wrong. I’d rather not share the large plugin here, as it’s a commercial product. The plugin is way more complex of course. I try not to build puny plugins. Currently it consists of that tag and a GeDialog—the step sequencer—that can be launched from the tag. The step sequencer also has a "Convert" button that triggers the same function within the plugin's NodeData. It works fine. In the commercial version, I disabled both Convert Buttons the one in the StepSequencer and the one in the tag while the animation is running, just to be on the safe side. Since you don't see any major issues with the example plugin's Convert method, I don't think the problem lies with the tag's Convert button, but rather with the Step Sequencer's Convert button. Can I trigger the Convert method from within the GeDialog as well? In other words: when a click occurs in the GeDialog I send a c4d.SpecialEventAdd() catch it in the GeDialog's CoreMessage(), and trigger the tag's convert function. That should put me in the Main Thread, right? Or can I fire it directly from the GeDialog's Command() method? You can see it in the figure down below. Theoretically, could I use any of the three methods, or is one better? Or am I not allowed to do that at all? [image: sequence_flow.jpg] Anyone who works makes mistakes. Cheers T.B
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • How to export icons of asset

    Cinema 4D SDK python 2026 2024
    8
    0 Votes
    8 Posts
    139 Views
    DunhouD
    Hey @ferdinand , Sorry I forgot click Submit button well, that is the info I need, I use same tech to get icons for CMD, and now waiting for svg part in the future. Cheers~ DunHou
  • Reverse direction of multi-segment splines

    Cinema 4D SDK windows 2024 python
    6
    0 Votes
    6 Posts
    100 Views
    ferdinandF
    Okay, I think I was a bit overly cautious in my answer here. You gave my a very broad question, or to be precise, you gave me a video and a scene file, and did not really ask a precise question. I understand that asking good questions can be hard, especially with a language barrier. But when I have nothing to go by, I of course assume the worst case possible. The scene you have there is a trivial case, even the best case possible. You have there spline segments which lie in a perfect plane and which have no self intersections. You can treat them just like polygons (in the CG sense, not in the mathematical sense) and simply compute their normal over the first three vertices of each segment. Due to the fundamental property of a polygon - reversing the order of the vertices reverses the normal - you can then easily determine if two segments have opposite or equal winding. But all this starts to fall apart, as soon as you cannot make these assumptions. And I cannot help you to write the code for this, as this is then more than just a few lines. Hope this helps, and that I my answer was now less 'overly cautious'. Cheers, Ferdinand Result [image: 1780950951310-85f415e7-7f45-4c00-9651-b4091ee543e2-image.png] The code correctly identifies that in this six segment spline are four segments of one winding direction (clockwise in this case) and two of the other winding direction. winding_direction.c4d Code """Treats spline segments as polygons and compares their plane normals to find segments with reversed winding order. """ import c4d op: c4d.SplineObject # The currently active object in the scene. def main() -> None: """Called by Cinema 4D when the script is being executed. """ if not isinstance(op, c4d.SplineObject): return c4d.gui.MessageDialog("Please select a spline object.") # Get all points in the spline and organize them into their segments. points: list[c4d.Vector] = op.GetAllPoints() segments: list[list[c4d.Vector]] = [] j: int = 0 for i in [op.GetSegment(i)["cnt"] for i in range(op.GetSegmentCount())]: segments.append(points[j:j+i]) j += i if len(segments) < 2: return c4d.gui.MessageDialog("Please select a spline object with at least 2 segments.") # Now build normal data for the spline segments. This assumes: # # - A spline where all points lie in a single plane, a '2D' spline in 3D space. # - No self intersections in the spline. # - A piecewise linear spline, i.e., what Cinema 4D calls a 'Linear' spline. When we have a # 'Cubic' or 'Bezier' spline, we would have make it linear with 'Current State to Object' # first. # # We build the normal for each segment over its three first vertices. The reason why we are doing # this is because of the fundamental identity of a polygon (in a computer graphics sense), # reversing the order of the vertices of a polygon will reverse the normal. So if we have a # spline with two segments with reversed winding order, they will have antiparallel normals (normals # pointing in opposite directions). segmentNormals: list[c4d.Vector] = [] for segment in segments: if len(segment) < 3: print("Segment has less than 3 points, skipping normal calculation.") continue a, b, c = segment[0], segment[1], segment[2] edge1: c4d.Vector = b - a edge2: c4d.Vector = c - b normal: c4d.Vector = edge1.Cross(edge2).GetNormalized() segmentNormals.append(normal) # Now we just declare one segment as 'ground truth' and check if the other segments have normals # that are parallel or antiparallel to it. When we found a segment with an antiparallel normal, we # know we found a segment with reversed winding order. To check if two normals are parallel or # antiparallel, we just compute their dot product (i.e., spanned angle). When the dot product is # negative, the normals are antiparallel. print(f"Establishing the first segment normal {segmentNormals[0]} as ground truth.") baseNormal: c4d.Vector = segmentNormals[0] for i, normal in enumerate(segmentNormals[1:], start=1): isAntiparallel: bool = baseNormal.Dot(normal) < 0 print(f"Segment {i} normal: {normal} is {'antiparallel' if isAntiparallel else 'parallel'} " f"to the base normal {baseNormal}.") if __name__ == '__main__': main()
  • How to draw svg to bitmaps?

    Cinema 4D SDK windows python 2026
    4
    0 Votes
    4 Posts
    133 Views
    ferdinandF
    I started to work last Friday on a BaseBitmap.InitWithVectorImage. It will for sure not make it into the next release of Cinema 4D, as we are too close to that, and I cannot make any promises when or if it will arrive. But I see value in this especially since I realized that you cannot even really use this in C++, as VectorImageInterface requires access to some internal components to be rasterized.
  • 0 Votes
    3 Posts
    119 Views
    rndm_cgR
    @ferdinand thanks so much, problem solved!
  • Can we draw alpha image in viewport

    Cinema 4D SDK windows python 2026
    4
    0 Votes
    4 Posts
    111 Views
    ferdinandF
    I do not think that DRAW_ALPHA_FROM_IMAGE should not work. I just picked DRAW_ALPHA_NORMAL because it is the "most default one" out of the DRAW_ALPHA flags. I will have a look later. But you can for now probably just use DRAW_ALPHA_NORMAL.
  • How to add tabs to tool plugins.

    Cinema 4D SDK windows python 2026
    6
    0 Votes
    6 Posts
    160 Views
    ferdinandF
    You very likely have not unpacked your resources. The resource folder found in an installation only contains a part of the application resources (we are doing this since release 2023 if I remember correctly). A good portion of the resources sits inside resource.zip for performance reasons and is unpacked on demand. You can just unpack the resource.zip into you resource folder without an performance or stability issues. [image: 1779175199591-b8e8db94-ae20-42b4-9a5d-e92ac928e89d-image.png] You as an MRD can also look at the Bugslife client, as it is probably the better example, as it uses more features of the quick tab GUI. But my answer above was targeted at a general audience who can see the resources for Bugslife but not Bugslife itself, and it therefore is not a good example for them. Just grep the resource folder as I did in my screen for files that match the path dialogs/*.res (i.e., are res files for dialogs) and contain the word QUICKTAB. Cheers, Ferdinand
  • 0 Votes
    6 Posts
    274 Views
    AnlvA
    Another small tip: you can simply use a single <br> for line breaks — there’s no need to use <b> or </b>. Also, just like in the script example, scripts can support localized language strings as well: """ Name-US:Example Name-CN:示例 Description-US:Example line 1.<br>Example line 2.<br>Example line 3. Description-CN:示例第 1 行。<br>示例第 2 行。<br>示例第 3 行。 """
  • Executing a Redshift texture bake from Python

    Cinema 4D SDK python 2026
    2
    0 Votes
    2 Posts
    130 Views
    ferdinandF
    Hello @mplec1, 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 The bake tag and by extension cinema::BakeTexture (and its Python equivalent c4d.utils.BakeTexture) unfortunately do not support Redshift, even for the older Xpresso based materials. Redshift uses the tools found in Redshift/Tools/Texture Baking for baking. And while you can programmatically create a bake set and then programmatically click the 'Bake' button in it (which both would also work in a headless version of Cinema 4D, such as c4dpy), the following dialog which opens to set baking details and actually start the rendering is sealed, i.e., you cannot interact with it from the public API. And opening such dialog would also fail in a headless Cinema 4D instance. So, I am afraid there is currently no solution for your problem. You can technically export the whole scene to a format such FBX or USD, and use the builtin baking output (which would also work in a headless environment, as long as you do NOT pass SAVEDOCUMENTFLAGS_DIALOGSALLOWED to the save/export operation). But the output of that automated baking is often of poor quality compared to manually baking object(s) via bake sets. Cheers, Ferdinand
  • 0 Votes
    6 Posts
    226 Views
    ferdinandF
    The second ID is the sub ID. You can have a command (FOO = 100) which supports the sub-commands (BAR=1, and BAZ=2). So, you can then call CallCommand(100, 1) or CallCommand(100, 2) to invoke the two different things FOO can do. But as you said yourself, this is a rather unusual thing, and it is even more unusual that I manged to randomly click five things in a row that all have sub IDs What should also be said is that my little "extrude" log there does not really reproduce the modelling operations I carried out. It just runs the tools in the order they are invoked. And because when you run this right after your created the log, the extrude tool will for example still have set the same extrude depth from the last operation. But when you manually extrude something, and then run the script again, it will use these new current extrude tool settings, i.e., and not the ones from when your 'recorded' the log. The script log can be useful, but it is not the auto-script-recording feature users often whish it was.
  • Using the Bridge Tool

    Cinema 4D SDK python
    9
    0 Votes
    9 Posts
    539 Views
    ferdinandF
    Hello @Dimitris_Derm. No, with islands I do not mean different objects. With islands are polygon (selection) islands meant. And that is just the term that is used for these things. The "Plane" object below has two polygon islands, the left and right rectangle shown in the viewport, each composed out of 4 * 5 polygons. They are islands because they are topological disjunct from each other - you cannot 'get' from one island to another without jumping over a gap. [image: 1777019034509-a88ac530-c105-430c-bd11-f922f5688881-image.png] The same can be applied to selections, as shown below. Now the left polygon island in the mesh has two polygonal selection islands. You cannot get from one selection island to another without jumping over a gap (they are topologically disjunct). [image: 1777019065284-bf41be6a-3993-4eb1-b603-438df9aa1bb3-image.png] This is a requirement because as my code example demonstrates, when bridging in island mode, you just specify a polygon and a point (and set the flags), and the tool then 'grows out' the to be bridged patch from the given polygon, based on the active polygon selection. And this growing will stop at topological boundaries. So, when you would bridge from the selection in the lower left corner of the left rectangle (to some unspecified target in another mesh), it would only grow into these four polygons. The selection in the top right corner would never be part of the operation. Cheers, Ferdinand
  • 2 Votes
    1 Posts
    11k Views
    No one has replied
  • Effector Objects written in Python

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    211 Views
    ferdinandF
    Hey @Dimitris_Derm. , no there is currently no dedicated plugin class for MoGraph effectors and fields in Python, only the scripting objects exist at the moment. Cheers, Ferdinand
  • Reading Immutable Selection Tags

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    214 Views
    D
    Ah ! They are called Proxy Tags and I can see the actual tag with the MSG_GETREALTAGDATA ! Thank you ️
  • 0 Votes
    6 Posts
    345 Views
    ferdinandF
    Your approach is not necessarily worse, one could even argue that it is better. I personally would always avoid manually binding to an OS DLL via ctypes, but that is more a personal preference.
  • 0 Votes
    5 Posts
    325 Views
    ferdinandF
    Hey, well, "intended" would be the wrong word, but I am aware. The whole resource parsing situation is a bit of a mess at the moment, both in C++ and the Python API. Why is it like this? A description is defined by a res file (more or less its GUI declaration) and an h file which declares symbols for parameter IDs. The resource for the loop tool looks like this: CONTAINER ToolLoopSelection { NAME ToolLoopSelection; INCLUDE ToolBase; GROUP MDATA_MAINGROUP { BOOL MDATA_LOOP_SEL_STOP_AT_SELECTIONS { } BOOL MDATA_LOOP_SEL_STOP_AT_NON_QUADS { } BOOL MDATA_LOOP_SEL_STOP_AT_POLES { } } HIDE MDATA_COMMANDGROUP; } I.e., it indeed only defines three parameters. But the header file looks like this: #ifndef TOOLLOOPSELECTION_H__ #define TOOLLOOPSELECTION_H__ enum { MDATA_LOOP_SEL_STOP_AT_SELECTIONS = 1100, // BOOL MDATA_LOOP_SEL_STOP_AT_NON_QUADS = 1110, // BOOL MDATA_LOOP_SEL_STOP_AT_POLES = 1120, // BOOL MDATA_LOOP_FIRST_VERTEX = 1130, // LONG MDATA_LOOP_SECOND_VERTEX = 1131, // LONG MDATA_LOOP_POLYGON_INDEX = 1132, // LONG MDATA_LOOP_BOTH_SIDES = 1133, // BOOL MDATA_LOOP_SWAP_SIDES = 1134, // BOOL MDATA_LOOP_SELECTION_TYPE = 1140, // LONG (must be SELECTION_NEW, SELECTION_ADD or SELECTION_SUB) MDATA_LOOP_SEL_POLYGON_OBJECT = 1150, // LINK }; #endif // TOOLLOOPSELECTION_H__ I.e., it not only defines these three parameters, but also all the others. Because there are all these "hidden" parameters which are written into the data container of the tool, but never show up in the GUI. What collides here is (a) the a bit irregular (but not illegal) behavior of a resource to define more parameters in its header file than are used in the resource and (b) the questionable decision of our resource parser to ignore hidden parameters. Our resource parsing is automated, i.e., I cannot just go into a file and just add these parameters for a docs build. I could touch the resource parsers for Python and C++, but I do not have the time for that right now as they has been written in a very opaque manner. My advice is simply what the docs suggest: Search in the header files directly. Go to your Cinema folder, make sure that the resource.zip is either unpacked to the local folder (the folder existing does not mean necessarily that it has been fully unpacked) or an external folder of your choice. And then simply search in that folder with an editor of your choice. [image: 1775557617243-c122abc5-8cfc-40da-90be-534532600b4a-image-resized.png] At some point I will replace the resource and symbols parsing for Python and C++, because we made there quite a mess in the past with questionable parsers and manually curated lists. But for now this cannot be changed and using the files directly is the way to go when you want to look at descriptions. Cheers, Ferdinand PS: The C++ docs are NOT inherently better in that regard. The parser shares there the same flaws. The reason why you find some symbols there is because developers have duplicated them from the resources into the frameworks.
  • Create Motion Clip Source with Python API

    Cinema 4D SDK python windows 2026
    3
    0 Votes
    3 Posts
    263 Views
    J
    Hi @ferdinand, and thank you! Your proof-of-concept and pointing me toward mxutils.GetSceneGraphString() was exactly what I needed to solve this. By using the scene graph dumper on a native UI-generated Motion Source from a rigged character, I realized it's just a standard Ojoint hierarchy with normal CTrack objects. I used GetClone(c4d.COPYFLAGS_NO_HIERARCHY) to perfectly replicate the Ojoint skeleton and injected the time variables into the container, and it maps and plays back perfectly. Thanks again.