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. GillesKontrol
    3. Posts
    G
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 11
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by GillesKontrol

    • Merging all polygon selectiontags per material on an object

      Hello,

      I can loop over all the materials on an object and store their respective objecttags, but I can't find any example or information on how to merge a list of selectiontags together via python and then assign those to their respective materials again. It doesn't seem super hard to do but I just can't find an example of someone doing something similar.

      My endgoal would be to basically simplify this so it merges all the selectiontags per material for each object so I don't have to do this all by hand for thousands of objects:
      34704837-0f5d-4b64-b629-125355c73970-image.png

      Any help would be greatly appreciated.

      Thanks!

      posted in Cinema 4D SDK python 2024 windows
      G
      GillesKontrol
    • RE: How to use external libraries inside of a plugin

      Thankyou! Noted!

      posted in Cinema 4D SDK
      G
      GillesKontrol
    • RE: How to use external libraries inside of a plugin

      Nevermind, i'm an idiot. All I had to do was place the lib in a folder in the plugin. Solved! 😄

      posted in Cinema 4D SDK
      G
      GillesKontrol
    • How to use external libraries inside of a plugin

      Hello!

      I've been writing a plugin that takes some information in the form of API requests (with the third party library "Requests") but I was doing my testing inside of the Python Script Manager. It works fine this way - but when I try and do the same inside a CommandData plugin it says it can't find the "Requests" library when C4D gets loaded.

      I've tried looking for this topic but I can't seem to find an anwser to it - apologies if this is a stupid question or if I just didn't look in the right place for it, as it seems something pretty basic but I can't get it to work 😄

      Any help would be much appreciated!

      Thanks

      posted in Cinema 4D SDK python
      G
      GillesKontrol
    • RE: Listening to the status of the Pictureviewer (like when Rendering Multiple Takes to Pictureviewer)

      Thankyou Ferdinand!

      It is a script for now but I will integrate it in a commandplugin so haha, bad luck on both those counts!
      Could you point me to a function or example of how I can detect a finished rendering? I might be able to check X number of times for a finished rendering and then execute the function. It's not perfect but it might do the trick for now.

      Thanks for the response, very helpful insights!

      Best regards,

      posted in Cinema 4D SDK
      G
      GillesKontrol
    • Listening to the status of the Pictureviewer (like when Rendering Multiple Takes to Pictureviewer)

      Hello,

      Is it possible to listen to when a render has been completed in the Pictureviewer? I'm using the "render takes to pictureviewer" command to export a series of ORBX files. Once they're done exporting I would like run a function.

      I can't use the batchrenderer because I'm exporting multiple ORBX files by "rendering" multiple takes to the PictureViewer. This is the only way currently to automate this process - in the batchrender it keeps getting stopped by a dialogbox that "saving the file" needs to be enabled (but it actually needs to be oiff, because I do not want to render anything, just export) and then the "render" aborts.

      Thanks in any case!

      posted in Cinema 4D SDK python project tool
      G
      GillesKontrol
    • RE: Loading in a framesequence to the pictureviewer (EXRs)

      Loud and clear! Thankyou!

      posted in Cinema 4D SDK
      G
      GillesKontrol
    • RE: Loading in a framesequence to the pictureviewer (EXRs)

      Oh? I was talking about when going to the PV and opening an EXR file as part of a sequence (via File > Open Image) you get this dialog:

      https://i.imgur.com/RWWOsSJ.jpg

      That's what I'm trying to replicate.

      posted in Cinema 4D SDK
      G
      GillesKontrol
    • Loading in a framesequence to the pictureviewer (EXRs)

      Hello,

      I've managed to get a framesequence loaded into the pictureviewer via python but they're all loaded in as individual frames and not as an actual sequence so the timeline controls are not visible and you can't play the sequence. I can't seem to find any options of this in the documentation, but perhaps I'm just don't know the term of the function to do it. Could anyone point me in the right direction?

      Thanks

      posted in Cinema 4D SDK python
      G
      GillesKontrol
    • RE: Websockets / Threading

      Ended up solving it by doing it with regular sockets and a timer. Also figured out why and how to make a standalone plugin panel - though it took me a lot of time and effort. Your documentation could really benefit from some step by step examples as searching for things you don't know the names of or why you even need them is next to impossible.

      posted in Cinema 4D SDK
      G
      GillesKontrol
    • Websockets / Threading

      Hello!

      I am trying to set up a websocket client inside C4D that can listen on localhost to messages from a websocket server.

      I've got the actual websocket client to work, but when I test it currently it freezes up the entire UI (currently using the Script Manager - have not gotten to making it an actual "plugin" yet - that's another rabithole to go down next + including the websocket python library in said plugin).

      I'm assuming I need threading or another way of asynconiously listening to the server's messages or otherwise C4D will continue being stuck?

      I've tried what was suggested in this thread by ferdinand: https://developers.maxon.net/forum/topic/14395/c4d-threading-in-python-doesn-t-work-as-expect - but I'm getting stuck on the Plugin ID part. I've made an ID and replaced it, but I keep getting these errors:

      Traceback (most recent call last):
        File "scriptmanager", line 3, in <module>
      ModuleNotFoundError:No module named 'urllib2'
      Traceback (most recent call last):
      TypeError: thread object is dead
        File "C:\Users\Gilles\AppData\Roaming\Maxon\C4D_CE91A9A0\library\scripts\Threader.py", line 138, in <module>
      AttributeError: 'traceback' object has no attribute 'Main'    RegisterPlugins()
        File "C:\Users\Gilles\AppData\Roaming\Maxon\C4D_CE91A9A0\library\scripts\Threader.py", line 132, in RegisterPlugins
      
      "OSError: cannot find pyp file - plugin registration failed"
      

      Sorry for the fairly vague post, but i'm running into different problems at the same time. In short:

      • Websocket client in C4D - best practice for this?
      • Plugin_ID - why do I need to do this, how do I properly do this?
      • If it won't work in the scriptmanager, (because scriptmanager will freeze up even with threading) how do I do it without the scriptmanager?

      Thanks,

      posted in Cinema 4D SDK python
      G
      GillesKontrol