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. mikegold10
    3. Topics
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 8
    • Posts 21
    • Best 1
    • Controversial 0
    • Groups 0

    Topics created by mikegold10

    • M

      A few items that should get fixed on the Python side

      Cinema 4D SDK
      • 2023 python • • mikegold10
      6
      0
      Votes
      6
      Posts
      1.0k
      Views

      M

      @ferdinand said in A few items that should get fixed on the Python side:

      Hey @mikegold10,

      ..., the word "of" does not in any way indicate ownership, [...]

      It does, of is a possessive preposition, in is a relative preposition, specifically one that denotes a place. See here for an overview of the subject. I would not even challenge the fact that for you and your peers of might sound more natural (or maybe even all native speakers as you claim).

      But language in general, and especially things like prepositions, pronouns, and flexions, is subject to language change which is often highly regional, so what people consider correct can vary regionally. As indicated in my first answer, prepositions are quite interchangeable, and if the text would have said of instead of in, I would not waste any time on changing that. But in the same notion, I cannot change the preposition on what you subjectively consider better. The grammatical situation from a Standard English point of view seems obvious here and personal preference cannot be grounds for a change. I am more than happy to change the preposition when you can demonstrate with a respectable English style guide like Oxford English that it would be more common to use here of. But that seems unlikely to me.

      Cheers,
      Ferdinand

      As additional supportive evidence for my proposed change, I am providing a link to a respected source for the definitions of American English words, including many sample phrases that provide context for the often huge set of alternative definitions that are provided for commonly used words like "of" (and "in"):

      Meriam-Webster Dictionary: of - Definition / preposition

      Specifically, under the definitions of the word "of," when used as a preposition (i.e., Section 1 of 3 on the page, as linked above), please examine the following alternative definitions and examples of proper English usage that I believe are of relevance to my proposed change to the original Python comment:

      a, c, and e a and b b

      Here is a copy of the original comment to provide context:

      The index of the first and last selected elements in the given segment.

      ..., and the revised version that replaces the preposition in with of::

      The index of the first and last selected elements of the given segment.

      Of course the decision is yours to make. I am simply trying to "open your mind" to, as well as provide objective evidence for, an alternative phrasing which I perceive to be a better fit for the technical subject matter that is being documented, within the framework of modern American English usage patterns. I have to concede on the fact that this is ultimately subjective and may (or may not - not sure) be specific to the en_US locale.

      Michael

    • M

      A bug that should be fixed in your Python API code generation (Applies to all recent versions)

      Cinema 4D SDK
      • • • mikegold10
      3
      0
      Votes
      3
      Posts
      664
      Views

      M

      Hi, Maxime, great!

      if I come across any additional issues of a similar nature, I'll update this post.

    • M

      Keyboard button down issue in S24

      General Talk
      • • • mikegold10
      2
      0
      Votes
      2
      Posts
      648
      Views

      ManuelM

      Hi,

      Thanks for contacting us.
      While i understand your issue, this forum's scope is bound to Cinema4D's API use only. (c++ and Python)
      For your issue, you need to contact our regular support and create a ticket there.
      They have more information/knowledge with what could cause this issue. (hardware/software)

      Cheers,
      Manuel

    • M

      S22: Question about going from a custom shader's ShaderData::Output() function back to the texture tag of an object

      Cineware SDK
      • • • mikegold10
      9
      0
      Votes
      9
      Posts
      2.8k
      Views

      M

      Hi Maxime,

      Thanks for confirming that I was not missing something in the docs and this is just not possible.

    • M

      From Line Object to Spline

      Cinema 4D SDK
      • python s22 • • mikegold10
      5
      0
      Votes
      5
      Posts
      945
      Views

      ManuelM

      hi,
      I'll consider this thread as solved without further feedback

      Cheers,
      Manuel

    • M

      Should the call to c4d.EventAdd() come before or after the call to doc.EndUndo() ?

      Cinema 4D SDK
      • • • mikegold10
      4
      0
      Votes
      4
      Posts
      735
      Views

      M

      @m_adam Hi Maxime, thanks for your detailed reply. I had a feeling that EventAdd() performed an asynchronous operation (i.e., placed an event on the event queue) and therefore it didn't matter, since control of the main thread would not be relinquished until both EndUndo() were called (regardless of sequence). However, as C4DS and you yourself pointed out, it makes more sense to call EndUndo() prior to EventAdd().

      This is not only true from a safety perspective, but the calls to StartUndo() and EndUndo() can be wrapped in a Python Context Manager, along exception handling and cleanup to be done automatically and correctly when a scope is exited. If one is going to undo whatever operation in case of an error, anyways (e.g., as part of said exception handling), it makes sense to call c4d.EventAdd() after we know that the entire action was successfully performed.

      I am going on the assumption that if my code performs some action inside of a StartUndo() / EndUndo() sequence, possibly consisting of multiple sub-actions and changes resulting in multiple AddUndo() calls, then sees mid-action that there is an and it cannot continue, and assuming the Start/End undo sequence is wrapped in a Python context manager class. Python will call EndUndo() on my behalf, as part of exiting the block governed by the context manager and then in the exception handler, I can perform an undo of the last action, undoing whatever sub-action did perform successfully (and added their AddUndo() pieces). Since this will hopefully leave everything in the same state that it was before the action was started, I am going to assume that there is no point in calling c4d.EventAdd() after the undo of the action is performed in my exception handler.

      To summarize, here is an example scenario:

      try: with MyUndoContextManager(doc) as undo_manager: # Calls StartUndo() as part of its Context Manager __enter__() method # undo_manager will make the calls to AddUndo() based on our actions DoSomethingAndCallAddUndoOnTheDoc(undo_manager); DoSomethingElseAndCallAddUndoOnTheDoc(undo_manager); DoOneLastThingAndCallAddUndoOnTheDoc(undo_manager); # Oh, oh, fails and throws exception # Note: EndUndo() will get called as part of the implicit call to MyUndoContextManager's __exit__() method # which will automatically get called when we exit this block due to the exception being thrown c4d.EventAdd(); # This code will not get reached due to exception being thrown above except: # An error occurred, get back to the initial state prior to the action # Undo whichever action sub-steps were performed successfully and AddUndo()s got called for, if any # Since the undo_manager object no longer exists, call DoUndo() on the doc object, directly doc.DoUndo() # Since, we reverted to the initial state before the action, there is no need to call c4d.EventAdd(), right?
    • M

      There is a bug and some issues in the inner extrude tool res/.h files (S22 and R21)

      Cinema 4D SDK
      • • • mikegold10
      10
      0
      Votes
      10
      Posts
      1.8k
      Views

      ManuelM

      hi,

      this will be fixed on the next update.

      Cheers,
      Manuel

    • M

      PolygonObject.SetSelectEdges() and the Neighbor() class, a giant dilemma

      Cinema 4D SDK
      • • • mikegold10
      6
      0
      Votes
      6
      Posts
      1.2k
      Views

      M

      @m_adam said in PolygonObject.SetSelectEdges() and the Neighbor() class, a giant dilemma:
      ...

      Hope it answers your questions,
      Cheers,
      Maxime

      Thank you Maxime, this is a lot of useful info. Let me think through all of this and reply here if I have any further issues.