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. John_Do
    3. Topics
    • Profile
    • Following 0
    • Followers 0
    • Topics 9
    • Posts 33
    • Best 1
    • Controversial 0
    • Groups 0

    Topics created by John_Do

    • John_DoJ

      CopyBitmapToClipboard gamma issue

      Cinema 4D SDK
      • python 2024 windows • • John_Do
      2
      0
      Votes
      2
      Posts
      369
      Views

      i_mazlovI

      Hi @John_Do,

      Please note that this forum is for the public APIs of Maxon products related topics. We unfortunately cannot help with the end user issues. Please ask your end user questions in our Support Center. This and also other important considerations are mentioned in the Scope of Support part of our Support Procedures.

      With that's said, your question gives a fuzzy impression on what exactly you're asking about. Namely, you're talking (presumably) about the CopyToClipboard() function, but then also claim the issue is not there, rather when you paste this bitmap in the PV. Could you please share some code snippet, which highlights the issue, especially the pasting part, which seem to not work as expected.

      Please also make sure you've setup the Picture Viewer's View Transform to meet your needs.

      In our internal bug tracking system I'm also seeing 2 issues that we already keep track of:

      A-B comparison issue that was just recently fixed and is not yet released Picture Viewer issue with OCIO enabled when using EXR files

      However, none of these seem to be specifically related to your case.

      If you're still having this issue and it is not related to our SDK, I would kindly ask you to reach out to our Support Center.

      Cheers,
      Ilia

    • John_DoJ

      CommandData.Message() implementation and Message concepts

      Cinema 4D SDK
      • python 2023 • • John_Do
      4
      0
      Votes
      4
      Posts
      755
      Views

      ferdinandF

      Hey @John_Do,

      you can add as many EventAdd as you want, it does not really hurt. All that will happen is that Cinema 4D will see that there is already an event and then do nothing. Technically speaking, it can make sense to have multiple EventAdd calls in a row - when you set the flags in c4d.EventAdd(flags=EVENT_NONE) as your call might then add a flag to the next upcoming event.

      It is a bit odd that you need an EventAdd at the end of your CommandData:Execute, but your screen grab clearly shows that it is necessary, so just keep it there. Maybe I also just misremembered something there.

      But I am a bit confused to what is now concretely not working.

      Cheers,
      Ferdinand

    • John_DoJ

      Copy children to selection with GetClone()

      Cinema 4D SDK
      • python 2024 • • John_Do
      3
      0
      Votes
      3
      Posts
      606
      Views

      John_DoJ

      Hi @ferdinand, thanks for the feedback, I've got it working with your suggestion. The method B was correct but the undo part was wrong ( the undo step was applied on the original objects instead of the new ones, thus leading to a mess when performing an undo). I also added the bit part to keep new objects folded in the OM. Here is the code :

      # CopyDeformers import c4d doc = c4d.documents.GetActiveDocument() def main(): doc.StartUndo() objs = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_SELECTIONORDER) if len(objs) >= 2: # Get the last selected object active = objs.pop(-1) # Get the deformers deformers = [i for i in active.GetChildren()] # Copy deformers to selection if deformers: for o in objs: for d in deformers[::-1]: dcopy = d.GetClone(c4d.COPYFLAGS_NO_BITS) doc.InsertObject(dcopy, parent=o) doc.AddUndo(c4d.UNDOTYPE_NEW, dcopy) o.SetBit(c4d.BIT_MFOLD) doc.EndUndo() c4d.EventAdd() if __name__ == '__main__': main()
    • John_DoJ

      Undo method for LayerShaderLayer

      Bugs
      • python 2024 limitation • • John_Do
      11
      0
      Votes
      11
      Posts
      2.3k
      Views

      John_DoJ

      Oof, that's an unfortunate end for me but at least I have a clear explanation. Thanks @ferdinand

    • John_DoJ

      TypeError: GeListNode_ass_subscript when creating a new object

      Cinema 4D SDK
      • python 2024 • • John_Do
      7
      0
      Votes
      7
      Posts
      1.0k
      Views

      John_DoJ

      Hi Maxime,

      Thank you very much for looking at my issue.
      Did you try the new function ? I've added it in my code and unfortunately I get the same result as before.

      Cinema_4D_3JwcCopDUD.gif

    • John_DoJ

      Issue collecting all the shaders in a material

      Cinema 4D SDK
      • python 2024 • • John_Do
      11
      0
      Votes
      11
      Posts
      2.3k
      Views

      John_DoJ

      Hi,

      One last thing I've noticed.

      The last code shared by @HerrMay works great on all materials but the one I'm using to test my script, it's odd.
      On this particular material, the function consistently skip the shader which is in the Blend Channel of the Fusion shader. Even the Mask shader in the Mask channel is discovered and printed.
      db2bf693-59e6-4eb1-a42e-5c484b38f253-image.png

      I've ran the debugger on the function :

      when the loop state is on the Color shader, the function is going up on the parent Fusion shader as expected but then the elif node.GetNext() condition isn't verified (?!) so it skips the last branch and go back to the material

      The thing is it doesn't happen with other materials nor other shaders :

      I've made this particular material's shader tree more complex and all the shaders are seen, even when a node has several children. A brand new material with the same shader setup is not a problem.

      There are two cases where the function scan the shader correctly and output the expected result :

      When using the recursive function written by @ferdinand Disconnecting and reconnecting the Filter shader from the Fusion shader. If I run the function again after doing that, the AO and Filter shaders are discovered and printed correctly.

      Do you have any idea of what it is happening here ?
      I'm planning to use this function for several commands and I don't like the possibility that it could fail in some cases, even if it is some niche ones.

    • John_DoJ

      Select and load multiple files at once

      Cinema 4D SDK
      • python • • John_Do
      3
      0
      Votes
      3
      Posts
      538
      Views

      John_DoJ

      Hi @m_magalhaes ,

      Sorry for the improper formatting of my question, I wasn't aware of these features.

      Thank you for the suggestion, the workaround can do the trick with the right safety precautions.

    • John_DoJ

      From string to constant to check type

      Cinema 4D SDK
      • • • John_Do
      6
      0
      Votes
      6
      Posts
      893
      Views

      John_DoJ

      Thank you for the explanation @ferdinand.

      The example makes sense even for a beginner like me, that's great 🙂

    • John_DoJ

      Python, tool attributes and hotkeys

      Cinema 4D SDK
      • s22 python sdk • • John_Do
      8
      0
      Votes
      8
      Posts
      1.4k
      Views

      John_DoJ

      @m_magalhaes Yes please, and sorry for the delay :3