• 0 Votes
    2 Posts
    76 Views
    ferdinandF
    Hello @davidz, 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 Please excuse the long delay. Please also have a look at our Support Procedures: How to Ask Questions, topics should not contain multiple questions as this tends to produce chaotic topics. Thread Safety & UI Blocking: How are you structuring long-running operations (like heavy geometry processing or batch asset syncs) to ensure C4D’s UI remains fluid? Cinema 4D does not offer true parallelism in its API in the sense of Python's multiprocessing, only simple de-blocking threading. I.e., you cannot make things faster, you can only make them not block things. This can be achieved via c4d.threading, specifically C4DThread. Examples: https://developers.maxon.net/docs/py/2027_0_0/search.html?q=C4DThread https://developers.maxon.net/forum/topic/14395/c4d-threading-in-python-doesn-t-work-as-expect/5 Module Live-Reloading: When building complex multi-file plugins, what is your preferred approach for hot-reloading modified code without constantly restarting C4D? You can use mxutils.LocalImportPath, it has a builtin module reload feature within the bounds of trivial import processes, i.e., imports that do not have to happen in a certain order. When you have: with LocalImportPath(__file__, autoReload=IS_DEBUG): import a import b import c It will of course still reload first a, then b, and then c. But for the relative local imports inside a, b, and c (if there are any) it does not know in which order it has to do them, so it just imports them in discovery order. For code where the import order of relative modules matters (which is not great code but also rather common), you have to write a manual reloader which reloads things in order (or just flush all relevant sys.modules entries). External Integrations: For those connecting Cinema 4D with external dashboards, cloud assets, or custom web development systems, what protocols or lightweight local servers (e.g., WebSocket, REST endpoints) are you finding most reliable? This is an extremely broad question which cannot be answered as is. You can make anything work at the end of day, it depends on what you want to do. When you want to connect web services with an UI (i.e., you have to represent the data somehow), I would recommend having a look at py_cmd_gui_html which showcases how to establish a two-way binding to an HTML page. The example runs the html page locally, but this could of course also be some service on the web. When you need an UI-less data transfer, I would probably go with REST and ship a bit better requests library with your plugin than what Python offers out of the box. You can technically also use the networking classes in the Maxon API Core, particularly UrlInterface but this is a low level API, not a convenience interfaces such as requests or urllib3 for Python, and more a barebones system like the bultin urllib of Python. Cheers, Ferdinand
  • List of selected edges

    General Talk off-topic-question
    2
    0 Votes
    2 Posts
    339 Views
    ferdinandF
    Hey @Kantronin, you might want to look at geometry_polgyon_edges_2024.0.py, it should answer all your questions. The TLDR is: full-edge maps as you hint at in your posting do exist in Cinema via helper functions, but they are often also not very useful. Internally, Cinema is operating as any other DCC application with the concept of what is often called a "half-edge" data structure. So, when you have the two polygons A and B: a---b---e | A | B | d---c---f Which share an edge over the vertices b and c, this is actually two edges and not one, due to how normals work. For both polygons to have a normal facing in the same direction, they must have opposite winding orders, which means that the edge b-c is actually two edges: b->c and c->b. So, A could for example index the edge as bc, and B as cb. The example goes into more detail with this. Cheers, Ferdinand
  • 0 Votes
    2 Posts
    777 Views
    ferdinandF
    Hey @Anlv, Thank you for reaching out to us and reporting this. I just changed it so that the path is always a raw string. This will be shipped with an upcoming (but not the next) public release. Cheers, Ferdinand I.e., your script will then be as follows where there is an r in front of the string, which should fix the issue on Windows. plugins.ReloadPythonPlugin( path = r"C:\Users\<user>\AppData\Roaming\Maxon\Maxon Cinema 4D 2026_XXXXXXXX\plugins\PluginName\PluginName.pyp", reloadDocumentAfterReload=False, reloadOnlyActiveDocument=False )
  • 0 Votes
    8 Posts
    3k Views
    ferdinandF
    Hey @mogh, I forgot this thread a bit, sorry. That sounds all very mysterious. When I summarize your issue, I would describe it as follows. I assume that is the gist of it? I have a workstation and experience there micro- and macro-stutters in the viewport performance. This happens primarily in low performing scenes with a heavy payload. The odd thing is though, that these performance dips only happen on one machine. On other comparable machines I have an an order of magnitude better performance. This is very hard to debug, but I would say there are two main cases of what could be going wrong. Your GPU is damaged or you use corrupted drivers. Outdated drivers alone cannot explain the numbers you report. It could also be the mainboard, although somewhat unlikely. You have another VRAM intensive app running on this machine. Cinema 4D and this app then play the VRAM memory battle, causing data to be constantly cycled in and out of VRAM, causing the performance dips. But this is somewhat unlikely as you probably would be aware of this. What I would do: Update all your drivers. Go into Preferences/Viewport Hardware and start dialing knobs to see if you can make a difference. Cinema 4D has unfortunately not a software viewport renderer anymore with which you could do a baseline test. Use a GPU monitoring tool (like MSI Afterburner) to see if your GPU is running at full load, or if there are spikes in VRAM usage. There are also more fancy tools with which you can monitor memory allocations over time. Run GPU tests such as FurMark or 3DMark to see if your GPU behaves stable there. Install a different GPU (not fun to do, but the best way to rule out hardware issues). There could also be a bug in Cinema 4D but with numbers as shown below that strikes me as a very unlikely cause. This sounds more like damaged hardware or a really nasty driver issue. laptop with ~60 FPS (Quadro 2000) on my workstation with ~8 FPS (RTX 3090) Cheers, Ferdinand
  • 0 Votes
    3 Posts
    2k Views
    K
    Hi @ferdinand , Thanks for the clarification. I will contact user support and request this as a feature.