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. ezeuz
    3. Posts
    E
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 16
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by ezeuz

    • RE: c4dpy -g_encryptPypFile fails: cannot find pyp file - plugin registration failed

      @ferdinand Wow, thanks a ton for that! Our workflow was working just fine without c4dpy, so I didn't get to check the forum again, but this is very nice.

      Happy new year!

      posted in Bugs
      E
      ezeuz
    • RE: Embed Video into GUI - Python API

      @ferdinand Oh I was just making a parallel, how Cinema 4D supports more audio nicely by default (compared to Maya), so I can generally expect Cinema 4D supports a lot more media compared to Maya (which I had experience developing a plugin on before moving to C4D).

      posted in Cinema 4D SDK
      E
      ezeuz
    • RE: Embed Video into GUI - Python API

      @ferdinand Thanks a lot on the feedbacks! Yeah I was thinking of using external library coz I was used to Maya, and the media support in that app was horrendous. I guess even Audio support-wise, Cinema 4D is miles better out-of-the-box. Hopefully c4d fits with our usecase.

      Ahhh I see, good point on the Python & GUI limitations. Thinking back, it makes sense that high-performance GUI rarely rendered/looped for each frame. Our use case was more like generating some kind of animation based on a video. The video is there for just for side-by-side preview.

      So all in all, we don't really need highly accurate playback. By using the time delta instead of raw timer and skipping frames here and there, overall I presume it'll be fine (say, even 10 FPS out of a 30 FPS video). But those are something I hadn't thought about, thanks a ton once again!

      posted in Cinema 4D SDK
      E
      ezeuz
    • Embed Video into GUI - Python API

      Hi, I was wondering if anyone ever tried embedding a video into the GUI via Python?

      One method I was thinking of was to use OpenCV for the video backend, while getting the frames one-by-one and draw it into an UserArea.

      posted in Cinema 4D SDK python windows
      E
      ezeuz
    • RE: c4dpy -g_encryptPypFile fails: cannot find pyp file - plugin registration failed

      @baca Nope, not working. It's worse now coz the error doesn't show up, but it's also not encrypted. So silent error.

      posted in Bugs
      E
      ezeuz
    • RE: c4dpy -g_encryptPypFile fails: cannot find pyp file - plugin registration failed

      @ferdinand I guess still no luck on this, and it's officially a bug? Would be interested too if you managed to find a temporary workaround.

      posted in Bugs
      E
      ezeuz
    • RE: c4dpy -g_encryptPypFile fails: cannot find pyp file - plugin registration failed

      @ferdinand Good to know it's not just myself. I tried restarting just now and the problem still persists. Looking forward for an update, thanks!

      posted in Bugs
      E
      ezeuz
    • c4dpy -g_encryptPypFile fails: cannot find pyp file - plugin registration failed

      Hi, I just found out that you can use the c4dpy -g_encryptPypFile <file.pyp> to encrypt a file without opening up the GUI. But every time I tried it, c4dpy just throws an error, even with the official plugin sample:

      > c4dpy -g_encryptPypFile py-commanddata_dialog_r13.pyp
      
      (null)Traceback (most recent call last):
      (null)  File "C:\Users\USER\AppData\Roaming\Maxon\Maxon Cinema 4D 2024_0CCAE811\plugins\py-commanddata_dialog_r13\py-commanddata_dialog_r13.pyp", line 101, in <module>
      (null)    c4d.plugins.RegisterCommandPlugin(id=PLUGIN_ID,
      (null)OSError: cannot find pyp file - plugin registration failed
      

      You can see that the it reads the file just fine, as they printed some lines from the script (for some reason).

      Also, I completely confirms that the source protector in GUI works perfectly. And calling just c4dpy works fine, spawning the c4d python interpreter. Tried using Admin, no luck.

      posted in Bugs python windows 2024
      E
      ezeuz
    • RE: Clearing the list of a ComboBox (Dropdown) - Python API

      @ferdinand Thanks a ton again! Yeah that dynamic UI is indeed something that fits perfectly with my current case, and possibly some other features I want to implement. Tho, I will revisit it later once I get to creating an MVP for my plugin. So I will use FreeChildren() for now.

      posted in Cinema 4D SDK
      E
      ezeuz
    • Clearing the list of a ComboBox (Dropdown) - Python API

      I want to use dropdown to select an object from a list of children from the targeted object. I managed to populate it just fine, but the issue is, how do you clear it so that I can repopulate the list when a different object is targeted later?

      # Initialize dropdown for each parameter
      for i, param in enumerate(self.params):
        self.AddComboBox(ID_DROPDOWN + i)
      
      # Once a target is selected
      for i in range(len(self.params)):
        for j, child in enumerate(self.children):
          self.AddChild(ID_DROPDOWN + i, j+1, child)
      

      My current idea is to remove the dropdown element entirely, but then I would have a hard time putting the dropdowns back in their respective layout positions like before.

      posted in Cinema 4D SDK python
      E
      ezeuz
    • RE: Adding image to GeDialog - Python Plugin/Script

      @ferdinand Thanks a lot for the reply (and all of your example codes throughout the years)! Yeah I managed to make one using UserArea, I def think this is a crucial feature to be added in the sample code in GitHub (tbh a ton of your codes are just too useful to be left alone in forums). Especially since it's a multi-step process unlike PySide (used by Maya plugin), for example.

      posted in Cinema 4D SDK
      E
      ezeuz
    • RE: Adding image to GeDialog - Python Plugin/Script

      @Dunhou Thanks a lot! I checked a bit more after that and I also found out that you are indeed able to put custom image, using GeUserArea:
      https://developers.maxon.net/forum/topic/7155/8153_bitmap-in-userarea/22?_=1721638654806

      Btw, checked out your plugins, and it made me realize I can do a lot more on the GUI side using C4D Python API.

      posted in Cinema 4D SDK
      E
      ezeuz
    • Adding image to GeDialog - Python Plugin/Script

      Is it possible to add image to the dialog/window from python plugin/script?
      The closest thing I find is Bitmap button, but you can only use pre-defined icons: https://developers.maxon.net/forum/topic/15365/gui-bitmap-button-properties/4

      posted in Cinema 4D SDK python
      E
      ezeuz
    • RE: Importing/loading sound file to scene via Python

      Turns out it's really simple, the documentation using ID instead of DescID creates unnecessary confusion. I thought they meant to insert c4d.CTsound directly to CTrack, but you need to follow the previous examples to use DescID.

      In any case, here you go:

      def create_audio_track(self, path):
        """Add an audio track to the selected object"""
        # Define a new audio track (following the documentation)
        descId = c4d.DescID(c4d.DescLevel(c4d.CTsound, c4d.CTsound, 0))
        track = c4d.CTrack(op, descId)
        track[c4d.CID_SOUND_NAME] = path
        
        op.InsertTrackSorted(track)
      
      posted in Cinema 4D SDK
      E
      ezeuz
    • RE: Importing/loading sound file to scene via Python

      I managed to search a bit more, so turns out everything related to keyframe is defined as CTrack. It's just a matter of determining the type/attribute.

      I will try to adapt the solution from this topic (it was about keyframing visibility): https://developers.maxon.net/forum/topic/13686/python-script-to-keyframe-visibility-of-object/3?_=1721442329144

      With the new information regarding CTsound to refer to the sound special track: https://developers.maxon.net/docs/py/2024_0_0a/modules/c4d/C4DAtom/GeListNode/BaseList2D/CTrack/index.html?highlight=ctrack#c4d.CTrack

      And maybe post the result once I figure it out.

      posted in Cinema 4D SDK
      E
      ezeuz
    • Importing/loading sound file to scene via Python

      Hi everyone, pretty new here. I got to read the documentation and honestly amazed at how well-documented everything is.

      Tho, despite of that, I'm still unable to find a way to import sound/audio file. I guess it's due to the fact that in the GUI itself, adding sound is a multi-steps process, so I'm unable to directly find the relevant method.

      82a08aa3-9e0c-4647-aaa0-7192181f8d1c-image.png

      If anyone got any tips, it'll be appreciated, thanks!

      posted in Cinema 4D SDK python 2024 windows
      E
      ezeuz