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. mikeudin
    3. Topics
    • Profile
    • Following 0
    • Followers 2
    • Topics 47
    • Posts 132
    • Best 24
    • Controversial 0
    • Groups 0

    Topics created by mikeudin

    • mikeudinM

      2024.4 update makes CheckDirty error for ObjectData plugin Fieldlist

      Cinema 4D SDK
      • python macos 2024 • • mikeudin
      5
      0
      Votes
      5
      Posts
      962
      Views

      i_mazlovI

      Hi @mikeudin ,

      To me it sounds pretty much like this issue here: issue with inserting fieldlayers in r2024, particularly after I couldn't reproduce this issue with the internally available next version of cinema.

      Cheers,
      Ilia

    • mikeudinM

      Memory Leak? How to fix loosing memory with python generator?

      Cinema 4D SDK
      • python macos 2024 • • mikeudin
      5
      0
      Votes
      5
      Posts
      1.0k
      Views

      M

      Hi sorry for not answering this topic earlier, I finally found some time to investigate and sadly there is nothing you can do in your side, this memory leak is coming from the Illustrator Importer and can be big, since all the points and tangents of the file are leaking. A fix will be available in the next update.

      Thanks for the report !
      Cheers,
      Maxime.

    • mikeudinM

      How to use ctypes library with Object Plugin properly?

      General Talk
      • python macos windows r21 2024 • • mikeudin
      3
      0
      Votes
      3
      Posts
      900
      Views

      mikeudinM

      @ferdinand Thank very much! i'll check what can i do. 🤔

    • mikeudinM

      How to LoadDocument from string in memory? 🤔

      Cinema 4D SDK
      • python • • mikeudin
      3
      0
      Votes
      3
      Posts
      879
      Views

      mikeudinM

      Cool! Thank you!

    • mikeudinM

      How it works new CalcGradientPixel?

      Cinema 4D SDK
      • python 2024 • • mikeudin
      3
      0
      Votes
      3
      Posts
      672
      Views

      lleallooL

      I am kind of surprised there isn't an easier way to sample a Gradient by a normalized 0-1 position 🤔

      Anyway, thanks @mikeudin for the snippet and @m_adam for the fix

    • mikeudinM

      2024 NodeData Init isCloneInit argument for older version

      Cinema 4D SDK
      • 2024 python • • mikeudin
      4
      0
      Votes
      4
      Posts
      838
      Views

      mikeudinM

      @baca Thank you! Works like a charm!

    • mikeudinM

      Colorchooser in 2024

      Cinema 4D SDK
      • 2024 python • • mikeudin
      2
      0
      Votes
      2
      Posts
      405
      Views

      M

      Hi @mikeudin thanks a lot for the report, this is a regression due to a last minute optimization within the internal Python API parsing done for which bring around 20% performance boost of the Python Effector in 2024.0.

      So any other classic API (c4d module) previously accepting a maxon.Vector or maxon.Color/A as an argument will be impacted (only ColorSwatchGroup.SetColor and ColorSwatchGroup.AddColor are affected by these changes)

      With that's said I was never a big fan of mixed datatype from classic API and maxon API, so even if this is a regression I think I prefer the new behavior. I will discuss that internally and see what is the outcome. I will keep you posted.
      Cheers,
      Maxime.

    • mikeudinM

      MessageDialog in NodeData plugin

      Cinema 4D SDK
      • python r23 r20 2023 • • mikeudin
      2
      0
      Votes
      2
      Posts
      566
      Views

      ferdinandF

      Hey @mikeudin,

      Thank you for reaching out to us. In short, there is no good answer to your question.

      There is no guarantee that anything will ever run on the main thread. You must always check yourself with c4d.threading.GeIsMainThread. Scene computations, e.g., ObjectData.GetContour is run in parallel off-main-thread and is therefore subject to access restriction to avoid access violations, i.e., crashes. There is no "hack" for this. The essence is that you cannot have both the benefits of sequentialism (can use shared resources) and parallelism (is fast). There are of course data structures which allow you to handle a singular resource from multiple threads, but doing this always entails lining up multiple users in a line, each waiting for users ahead in the line to be done, i.e., hidden sequentialism. In Python this might be hard to grasp because Python itself mostly ignores the concept of parallelism and we only experience here the side effects of the parallelism of the underlying C++ Cinema 4D API.

      There is also the problem that your request does not make too much sense for me on a practical level. Imagine having a plugin MySpline which opens an error dialog once its GetContour method strays from the right path.

      A user now edits one hundred instances of MySpline at once and triggers the error. Cinema 4D sometimes executes passes two or three times in a row to resolve dependency problems. This would then mean that you would open three hundred error dialogs for one user interaction (if that would be technically possible in the first place).

      In general, no node should open any form of dialogs on its own. Opening a dialog after a button press in the description of a node via NodeData.Message is okay.

      When you are hell-bent on doing this, you could do this:

      Add a field to your plugin, e.g., self._error: str = "". When you are in your GetContour and an error happens, instead of raising it, simply write it to _error. Implement any NodeData method which often runs on the main thread. NodeData.Message is a good candidate. On each execution of it, check if _error has content and if you are on the main thread. If so, display the message and then null _error. You will still need some kind of throttling so that the user is not spammed with the same error over and over again. I.e., you need an "only-new-errors" mechanism. It is up to you to implement that.

      An alternative approach could go via core messages. But that is also non-ideal because setting off a c4d.SpecialEventAdd will work from a non main thread but will cause the global core message lock to engage, which is of course a bad thing to happen and exactly the "no-hack" problem I described under (4).

      You could also try using c4d.StatusSetText and the other status functions. While not officially supported, they will work from non-main-thread environments. But there is no guarantee and we do not officially support this.
      Cheers,
      Ferdinand

    • mikeudinM

      How to apply new fixed FieldList securely

      Cinema 4D SDK
      • r23 python 2023 • • mikeudin
      5
      0
      Votes
      5
      Posts
      1.0k
      Views

      J

      Hello @mikeudin ,

      without further questions or postings, we will consider this topic as solved by Friday, the 11th of august 2023 and flag it accordingly.

      Thank you for your understanding,
      Maxon SDK Group

    • mikeudinM

      Not working FieldLists Keyframes and Tracks

      Cinema 4D SDK
      • python r23 • • mikeudin
      3
      0
      Votes
      3
      Posts
      554
      Views

      mikeudinM

      @ferdinand Thank you! That was TranslateDescID issue!

    • mikeudinM

      TranslateDescID with FieldsList

      Bugs
      • python r23 2023 • • mikeudin
      7
      0
      Votes
      7
      Posts
      1.6k
      Views

      ferdinandF

      Hey @mikeudin,

      just as an FYI, one of our engineers pointed out that Description.CheckDescID is the likely culprit for the problem and that this method should be avoided when possible due to its resource hungry nature. Instead, you would just manually define the parameter ID you mean, e.g., c4d.DescID(c4d.ID_TAGFIELDS). The problem with this is of course that this statement has been made disjunct from the dynamic parameters example because I stripped that aspect away in my minimized code.

      The original code example says:

      # Fills DescLever type and creator completeId = desc.CheckDescID(descId, None) return True, completeId, tag

      So, they seem to be only after filling in the data type and creator ID and not resolving multi-level IDs. Which you could also do manually when you know the parameters you want to wrap, e.g.,:

      descId: c4d.DescID = c4d.DescID(c4d.DescLevel(c4d.ID_TAGFIELDS, c4d.CUSTOMDATATYPE_FIELDLIST, c4d.MAXON_CREATOR_ID)) return True, descId, tag

      Cheers,
      Ferdinand

    • mikeudinM

      Setting DESC_DEFAULT for a Parameter has no Effect

      Cinema 4D SDK
      • r23 python • • mikeudin
      3
      0
      Votes
      3
      Posts
      719
      Views

      J

      Hello @mikeudin ,

      without further questions or postings, we will consider this topic as solved by Friday, the 11th of august 2023 and flag it accordingly.

      Thank you for your understanding,
      Maxon SDK Group

    • mikeudinM

      ObjectData plugin. How to store class object data?

      Cinema 4D SDK
      • python r23 • • mikeudin
      4
      0
      Votes
      4
      Posts
      987
      Views

      ferdinandF

      Hey @mikeudin,

      that the problem appears when calling "Reset To Default" command (from context menu or by right-click on arrows)

      What does constitute as 'the problem' here for you? But:

      You should initialize the data parameter with .InitAttr. I forgot to do that in my code example myself and now have added it. But that should not be the cause of your problem, whatever it is. As shown above and in the other thread, Cinema reinitializes nodes that users would consider "the same". A hook is reinitialized for the same node when that node has been reallocated. When some data is not recomputable, or too expensive to, you must the check in Init if the data does already exist. # The actual tag in the scene is allocated and initialized. Init: mem: 0X7F95D530E3C0, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01\x19\xc1\xf7\x00\x079\x00\x00' # An Asset API temp tag is being initialized and then freed right away. Init: mem: 0X7F95D5318500, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01$\xc1\xf7\x00Q9\x00\x00' Free: mem: 0X7F95D5316640, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01$\xc1\xf7\x00Q9\x00\x00' # The actual tag in the scene is reinitialized. Init: mem: 0X7F95D5314FC0, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01\x19\xc1\xf7\x00\x079\x00\x00' # An Asset API temp tag is being initialized and then freed right away. Init: mem: 0X7F95D52E9E40, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01p\xc9\xf7\x00\xc49\x00\x00' Free: mem: 0X7F95D52E30C0, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01p\xc9\xf7\x00\xc49\x00\x00' # The actual tag in the scene is reinitialized. Init: mem: 0X7F95D52FB3C0, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01\x19\xc1\xf7\x00\x079\x00\x00' # An Asset API temp tag is being initialized and then freed right away. Init: mem: 0X7F95D53096C0, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01\xdd\xcd\xf7\x006:\x00\x00' Free: mem: 0X7F95D530A180, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01\xdd\xcd\xf7\x006:\x00\x00' # The actual tag in the scene is reinitialized. Init: mem: 0X7F95D5309F00, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01\x19\xc1\xf7\x00\x079\x00\x00' # An Asset API temp tag is being initialized and then freed right away. Init: mem: 0X7F95D52F9D00, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01\x9c\xd9\xf7\x00\xaf:\x00\x00' Free: mem: 0X7F95D52FD980, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01\x9c\xd9\xf7\x00\xaf:\x00\x00' # The actual tag in the scene is reinitialized. Init: mem: 0X7F95D52FD940, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01\x19\xc1\xf7\x00\x079\x00\x00' # An Asset API temp tag is being initialized and then freed right away. Init: mem: 0X7F95D5317A80, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01,\xdd\xf7\x00Q;\x00\x00' Free: mem: 0X7F95D5313EC0, uuid: b'\x14}\xda\xa4\xdb\xf2\x17\x01,\xdd\xf7\x00Q;\x00\x00'

      Other than that, I cannot say much, without understanding what is exactly going wrong. We will also need executable code, so that we can debug things ourselves as this is not a trivial topic.

      Cheers,
      Ferdinand

    • mikeudinM

      How to create Preference hierarchy child tree item

      Cinema 4D SDK
      • python r23 • • mikeudin
      3
      0
      Votes
      3
      Posts
      525
      Views

      mikeudinM

      @ferdinand Thank you! I'll check it!

    • mikeudinM

      Cinema 4D Connector not working on 2023.2.0 on Air M1 MacOs 12.6.3

      Cinema 4D SDK
      • c++ 2023 • • mikeudin
      3
      0
      Votes
      3
      Posts
      706
      Views

      mikeudinM

      Thank you @ferdinand !

    • mikeudinM

      Fieldlist HasContent() GetCount() bug workaround

      Cinema 4D SDK
      • python r23 • • mikeudin
      3
      0
      Votes
      3
      Posts
      618
      Views

      M

      Hello @mikeudin,

      without further questions or postings, we will consider this topic as solved by Monday 05/06/2023 and flag it accordingly.

      Thank you for your understanding,
      Maxime.

    • mikeudinM

      TreeView for ObjectData plugin

      Cinema 4D SDK
      • python r23 • • mikeudin
      2
      0
      Votes
      2
      Posts
      457
      Views

      M

      Hi Mike this is unfortunately not possible, even in C++ for more info please look at Info for ITEMTREE/customgui_itemtree.

      Cheers,
      Maxime.

    • mikeudinM

      Subprocess can't detect system installed utilities

      General Talk
      • r23 python • • mikeudin
      3
      0
      Votes
      3
      Posts
      710
      Views

      mikeudinM

      Thank you @ferdinand !

    • mikeudinM

      InExclude detect 'Remove All' context menu command

      Cinema 4D SDK
      • python • • mikeudin
      3
      0
      Votes
      3
      Posts
      518
      Views

      mikeudinM

      Thank you @ferdinand ! 👏 Will chek it!

    • mikeudinM

      IN_EXCLUDE list with virtual objects with parameters

      Bugs
      • python • • mikeudin
      3
      0
      Votes
      3
      Posts
      1.1k
      Views

      mikeudinM

      Thank you for response @ferdinand! Will try to make it with hidden tags 🤔