The examples Maxon has in GitHub include "Py-TextureBaker", which seems to use threads. I'm currently going through that code (and trying to understand it...), because I'm facing the exact same challenge as OP: how to start something in a thread, and make that thread send messages to other plugins.
It seems that module c4d.bitmaps is missing from the auto completion package initialization:
/Applications/Maxon Cinema 4D R25/resource/modules/python/libs/python39/c4d/_ _ init _ _.py :
from c4d import documents
from c4d import gui
from c4d import modules
from c4d import plugins
from c4d import storage
from c4d import threading
from c4d import utils
All the other classes/modules are imported, except bitmaps. Is this intentional or a bug?
Ok, thanks for the confirmation. Already fixed it manually myself.
A big thumbs-up for this! I've also started using Python typing in PyCharm, now that C4D API is finally based on Python 3. Having correct typing also in the dummy package would be really useful.
Ok, thanks for the clarification.
CTrack documentation talks about ”index” a lot, when referring to keys, but I haven’t yet found any definite specification for it. Are the keys indexed in what order? Time? Order of insert? Random? Does the index start from 0 or 1?
Thank you, Cairyn. When you document method "SplurgeMiddlePhalange()" with "this method splurges your middle phalange", you're not really helping anyone...
A followup question: is there a way to get the time and/or value of previous/next keyframe of a CKey (on the same track)? I was hoping these mysterious left/right methods would do that, but apparently not.
Could someone please enlighten me: what exactly do these Python CKey left/right methods do? The documentation is somewhat... vague (the text below is taken directly from Maxon's Python API documentation pages).
CKey.GetTimeLeft(self) : "Get the left time of this key"
CKey.GetTimeRight(self) : "Get the left time of this key"
CKey.GetValueLeft(self) : "Get the value of this key"
CKey.GetValueRight(self) : "Get the right of this key"
CKey.SetValueLeft(self, seq, v) : "Set the left value of this key"
CKey.SetValueRight(self, seq, v) : "Set the right value of this key"
CKey.SetTimeLeft(self, seq, t) : "Set the left time of this key"
CKey.SetTimeRight(self, seq, t) : "Set the right time of this key"
(as I've suggested before: Maxon should really REALLY put more resources in the API documentation quality)
Thanks for the drag'n'drop tip Maxime, that feature is extremely useful!
Thanks PluginStudent, that was a lot easier than I thought!
C4D's Python SDK has method c4d.documents.AddMarker(), which only allows you to enter the marker's name and time position. What about other marker attributes, such as length, color, note etc.: is it possible to modify them after the new marker has been created?
With kind regards,