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
    • Register
    • Login
    1. Home
    2. i_mazlov
    3. Posts
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 277
    • Best 70
    • Controversial 0
    • Groups 2

    Posts made by i_mazlov

    • RE: DrawHudText interferes with Polygon Pen Tool etc

      Hi @FlavioDiniz,

      thanks for providing more information on the issue.

      Regarding your "Issue 2". I see no reason for the background color (and other properties) to not work in your setup, hence I've created a bug report for that (ITEM#587756). Thanks for reporting the issues you face during your development.

      We are happy to handle your "Issue 1" about "constantly unsaved document" in a separate thread, once you create it yourself.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: DrawHudText interferes with Polygon Pen Tool etc

      Hi Flavio,

      Thanks for getting back to us! There's no reason to be sorry, it's the opposite, you're very welcome to share your ideas and post questions!

      I've forked your question to a separate thread. Even though this sounds like a similar issue, under the hood it can be a completely different story 😉

      Please attach a sample project file (or at least the python code you're using), which would help us reproducing the behavior from the video. This makes things happenning easier and faster.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: Frozen Matrix different

      Hi @chuanzhen,

      Glad to hear the issue went away.

      Just to note, the frozen matrices are designed in a way that simulate behavior of an intermediate parent null object, i.e. just as if you had an invisible parent null object with matrix being equal to the frozen one. Sometimes it can get confusing, because the way the global matrix of the object is calculated is effectively:

      [Local Matrix] = [Frozen Translation] * [Frozen Rotation] * [Relative Translation] * [Relative Rotation] * [Frozen Scale] * [Relative Scale]

      If the relative transform (the main one) and the frozen transform are the same for two objects, given they are children of the same parent and there're no other 3rd parties involved (e.g. plugins, python tags etc), the global transform matrices of these two objects are the same.

      Please find more useful insights in our great Matrix Manual.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: Set RenderData framerate causing C4D to crash

      Hi @chuanzhen,

      The issue is not reproducible on my machine with C4D: 2025.2.1 (Build 2025_2_1_10be3ac9d371_1759753353) Win

      Cheers,
      Ilia

      posted in Bugs
      i_mazlovI
      i_mazlov
    • RE: Adding an Object to a New Cinema 4D Asset Database

      Hi @d_keith,

      I would kindly ask you to check our Support Procedures, namely the "How To Ask Questions" paragraph:

      Singular Question: The initial posting of a support topic must contain a singular question. Do not ask ten things at once, that makes it extremely hard to answer topics. Break up your questions into multiple topics.

      Here you effectively have 4 different questions about Asset Browser, and these are candidates for 4 different threads on the forum. In your further postings please try to follow the aforementioned rules.

      Regarding your questions:

      1. Should I be able to mount a directory and have it auto-create a DB?

      Mounting database is effectively executing the AssetDataBasesInterface.SetDatabases. It has nothing to do with creating database neither semantically, nor is this mentioned in the docu. If you need to create repository, please use maxon.AssetInterface.CreateRepositoryFromUrl(), it will scan the directory for being already a database and create proper dir structure if it's not.

      1. Any idea why I need to re-try creating the Repo for it to work?

      If you face any errors in the script, please always attach at least the error message! In this case I assume you receive the following error, when executing the maxon.AssetRepositoryTypes.AssetDatabase() for the first time after Cinema 4D started. Looks like a bug to me, I've created a bug report for that (ITEM#585831).

      The error message:

      Traceback (most recent call last):
        File "console", line 1, in <module>
        File "C:\Program Files\Maxon Cinema 4D 2025\resource\modules\python\libs\python311\maxon\interface.py", line 5049, in __call__
          self._cachedObj.R = _maxon_mapping.GetAssociatedDataType(dt)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      Exception: unable to find datatype
      

      As a workaround you can just execute the following line first in your main():

      maxon.AssetRepositoryTypes.AssetDatabase()
      
      1. ... about multiple DBs ...

      You're giving your databases unique IDs with the line repo_id = maxon.AssetInterface.MakeUuid(str(url), True). If you need them to be the same, just pick one instead, e.g. repo_id = maxon.Id('net.maxon.sdk.cool.things.repo')

      1. ... revealing assets doesn't work...

      I've created a bug report for that, as it looks like a bug with refreshing in the Asset Browser. As a workaround you can reload databases and reopen the AB before reveling your assets, e.g.:

      def RepenAssetBrowser():
          CID_ASSET_BROWSER = 1054225
      
          # Close the Asset Browser if it's alredy opened
          if c4d.IsCommandChecked(CID_ASSET_BROWSER):
              c4d.CallCommand(CID_ASSET_BROWSER)
          
          # Open again
          c4d.CallCommand(CID_ASSET_BROWSER)
      
      def main():
      	# ...
      	# assets = []
      	# ...
      	# assets.append(asset)
      	# ...
      	
          maxon.AssetDataBasesInterface.ReloadAssetRepositories(True)
          RepenAssetBrowser()
          maxon.AssetManagerInterface.RevealAsset(assets)
      

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: Access the Output Folder path from a RS BakeSet

      Hi @itstanthony,

      Similar topic has already been discussed in the adjacent thread: Texture Baking in Redshift using Python.

      The TL;DR version is: the baking tool itself is sealed from being accessed from our API, hence the furthermost point you can reach is simulating the click on [Bake] button. Since the path you'd like to have is contained inside the Bakeset dialog, you unfortunately cannot retrieve it. This information is best to be double checked with redshift team on Redshift Forum.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: How to Execute a Modifier plugin in Expression priority

      Hi @chuanzhen,

      The issue you're seeing is because I misused the list.Add() function in my previous example, sorry for that. Namely, the arguments are different, from how I used them. If you like to have priority "Expression 10", you'd need to use the following line:

      list.Add(op, c4d.EXECUTIONPRIORITY_EXPRESSION + 10, c4d.EXECUTIONFLAGS_NONE)
      

      I've updated the script in my previous posting with the proper usage of the list.Add() function.

      Please refer to an adjacent thread regarding execution flags: Priority: PriorityData and PriorityList

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: Problem encountered when check double click in Message() Use MSG_EDIT

      Hi @chuanzhen,

      the TagData plugins don't receive MSG_EDIT message on single click (when user selects the tag in the Object Manager). If you receive the MSG_EDIT, it means the tag is being edited, i.e. the user has double clicked on it. Technically, it can be caused by any event that ends up in editing the tag (i.e. not only by double clicking on it in OB). This is basically why you receive this message on creation. On practice, I haven't seen in the code places, other than double clicking, that send MSG_EDIT to our tagdata objects, so it's kind of safe to assume that receiving this message is equal to having a double click.

      If you like to distinguish the MSG_EDIT that's sent on creation from the double click case, you'd need to handle this bookkeeping yourself, e.g. having some system that tracks the existence of tags in the scene and filters out the on-creation MSG_EDIT misfire.

      By the way, there's no need to check for c4d.BFM_INPUT_DOUBLECLICK, as at the time tagdata plugin receives the message the input event is already consumed, hence you won't get this information at that point.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: BaseDraw.DrawTexture Issue

      Hi Flavio Diniz,

      Thank you for providing an extensive description of your issue.

      I've updated the original thread about the DrawHUDText issue. I don't see the orbiting center issue anymore after applying the change to the python tag code, namely adding the following early exit condition to the draw function:

          if bd.GetDrawPass() != c4d.DRAWPASS_OBJECT or bd.GetDrawParam(c4d.BASEDRAW_IS_PICK_OBJECT):
              return True
      

      The same thing stands for the lag issue - I cannot reproduce it with the patched python tag code.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: DrawHUDText issue with viewport camera navigation

      Hi Flavio Diniz,

      The ticket has been fixed and closed. The C4D side fix is present at least in Cinema 4D 2025.2.0.

      Let me also share the developer's comment from the ticket:

      2 things are broken: C4D and the python tag. Once C4D is fixed, try again after changing the code in the python tag:

      import c4d
      def main() -> None:
          pass
      def draw(bd: c4d.BaseDraw) -> bool:
          if bd.GetDrawPass() != c4d.DRAWPASS_OBJECT or bd.GetDrawParam(c4d.BASEDRAW_IS_PICK_OBJECT):
              return True
      
          frame = bd.GetFrame()
          right = frame["cr"]
          bottom = frame["cb"]
          bd.DrawHUDText(int(right / 2) - 100, int(bottom) - 20, "Hello World!")
          return True
      

      The important thing is to draw only in the drawpasses in which it makes sense to draw.

      Cheers,
      Ilia

      posted in Bugs
      i_mazlovI
      i_mazlov
    • RE: How to Execute a Modifier plugin in Expression priority

      Hi @chuanzhen,

      With the code snippet below and Cinema 4D 2025.2.0 I cannot reproduce your issue. Namely the python tag with Expression-0 and the object modifier with Expression-10 work as expected:
      d6bc0ded-7a01-4ac0-8557-ac7b30b0600b-image.png
      c2f05105-1d54-4dbb-9b0d-885d0d7997b9-image.png

      Cheers,
      Ilia

      Python tag code:

      import c4d
      def main() -> None:
          print('tag')
      

      stemp.pyp code:
      Upd 14/04/25: fixed the list.Add() function

      import c4d
      PLUGIN_ID = 1051592
      class S_Temp(c4d.plugins.ObjectData):
          def Init(self, node, isCloneInit: bool) -> bool:
              print('stemp-Init')
              return True
          
          def AddToExecution(self, op, list) -> bool:
              print("stemp-AddToExecution")
              list.Add(op, c4d.EXECUTIONPRIORITY_EXPRESSION + 10, c4d.EXECUTIONFLAGS_NONE)
              return True
          
          def Execute(self, op, doc, bt, priority, flags) -> int:
              print(f"stemp-Execute: {priority}")
              return c4d.EXECUTIONRESULT_OK
      
          def ModifyObject(self, mod, doc, op, op_mg, mod_mg, lod, flags, thread):
              print(f"stemp-ModifyObject: {op.GetName()}")
              allp = [pos + c4d.Vector(0, 100, 0) for pos in op.GetAllPoints()]
              op.SetAllPoints(allp)
              op.Message(c4d.MSG_UPDATE)
              return True
      
      if __name__ == '__main__':
          c4d.plugins.RegisterObjectPlugin(
              id=PLUGIN_ID,
              str="S_Temp",
              g=S_Temp,
              description="stemp",
              info=c4d.OBJECT_MODIFIER | c4d.OBJECT_CALL_ADDEXECUTION,
              icon=None
          )
      
      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: How to Execute a Modifier plugin in Expression priority

      Hi @chuanzhen,

      Sorry for the late answer and thanks for providing a great explanation of your question with the code snippet and a sample plugin, highly appreciated!

      I suspect, the missing bit in your case is the c4d.OBJECT_CALL_ADDEXECUTION flag that you need to add for your object plugin registration function call.

      However, this will allow you to structure the sequence of calling the Execute() function. You cannot queue the execution of the ModifyObject() function.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: Docked Dialog Problem with width of CUSTOMGUI_FILENAME

      Hi Sebastian,

      correct, it hasn't been included into 2025.2.0. The next minor release will likely have it fixed though.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: Docked Dialog Problem with width of CUSTOMGUI_FILENAME

      Hi Sebastian,

      Thanks for your patience. TLDR; it's a bug but you still need to set minimal width.

      The issue is twofold:

      1. For this UI element to work as intended you need to specify the minimal width argument minw, for example using the c4d.gui.SizeChr() function:
        self.AddCustomGui(self.ID_TEXT_1, c4d.CUSTOMGUI_FILENAME, '', c4d.BFH_SCALEFIT, c4d.gui.SizeChr(80), 0, bc)
      2. There's currently a bug, which prevents this from working properly. The fix is going to be included in one of further Cinema 4D releases.

      After the fix is released, given you're using the minw argument, the issue wouldn't be there anymore. Thanks for drawing our attention to this issue!

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: Docked Dialog Problem with width of CUSTOMGUI_FILENAME

      Hi @datamilch,

      Although I highly suspect this to be a bug, I'll need more time to double check it. I'll update you further, once have a more clear vision on this.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: Change Icon Color parameter

      Hi @chuanzhen,

      The "Display Color" value of the "Icon Color" attribute is a dynamic value (comparing to "None" and "Custom" being static values), this was explained in the related thread: Python Documentation - Icon Color. This is the reason why it requires special handling, namely (as Manuel explained in the related thread: Simple Organisational Structure Generation Script), one needs to send a c4d.MSG_GETCUSTOMICON_SETTINGS message to the object to properly set this attribute. Please check the example code snippet that shows its usage.

      Cheers,
      Ilia

      Example code, showing the usage of the c4d.MSG_GETCUSTOMICON_SETTINGS message:

      import c4d
      
      doc: c4d.documents.BaseDocument  # The currently active document.
      op: c4d.BaseObject | None  # The primary selected object in `doc`. Can be `None`.
      
      def main() -> None:
          obj = c4d.BaseObject(c4d.Ojoint)
          
          # Configure object display color attribute
          obj[c4d.ID_BASEOBJECT_USECOLOR] = c4d.ID_BASEOBJECT_USECOLOR_ALWAYS
          obj[c4d.ID_BASEOBJECT_COLOR] = c4d.Vector(1, 0, 1)
      
          # Configure object icon color attribute
          settings = c4d.CustomIconSettings()
          settings._colorMode = 2
          obj.Message(c4d.MSG_GETCUSTOMICON_SETTINGS, {'setting': settings})
          obj[c4d.ID_BASELIST_ICON_COLORIZE_MODE] = c4d.ID_BASELIST_ICON_COLORIZE_MODE_CUSTOM + 1
      
          obj.SetName("Magenta Joint")
          doc.InsertObject(obj)
      
      
      if __name__ == '__main__':
          main()
          c4d.EventAdd()
      
      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: Managing render settings and getting list of expected output files.

      Hi @BigRoy,

      Please check our Support Procedures in regards of the question structure, namely:

      Singular Question: The initial posting of a support topic must contain a singular question. Do not ask ten things at once, that makes it extremely hard to answer topics. Break up your questions into multiple topics. Asking follow-up questions is allowed but they must be bound to the initial subject.

      Singular Subject: From all this follows that a topic must have a singular and sparse subject tied to a specific problem. 'My Nodes API Questions' is not a valid topic as it splits up into too many subtopics. A valid subject could be 'accessing node attributes' or 'traversing a node graph'. One could for example first ask 'how to get the name attribute of a node?' and then ask a follow up question about 'how to get the icon attribute too?'. This specifically applies to plugins, just because you have two problems with one plugin does not mean that they should be asked in the same topic.

      Regarding you question, there's no high level API that allows you to get a list of all files you've mentioned at once. This effectively means that not only do you need to access this yourself, but you also need to do so for the render engines you'd like to support, as these are likely going to differ among them.

      Specifically for the Redshift AOVs and output files question, please check related threads:

      • get the names of redshift multi passes AOV names from the render settings
      • Add Expression Value in Render Settings Save Path

      As for the takes, the only application where they make any sense is the Render Queue. If you're not using it, it's only the active take that's being rendered. Of course you can deal with it by using SetCurrentTake function.

      I suggest you keeping this thread for the "render output files" part of your initial question and encourage you to make separate postings for your other questions that diverse from this topic here.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: Retrieve. c4d from folders and subfolders and update tree list

      Hi @Neekoe,

      That's great to hear you've managed to solve the issue!

      For your future postings please note that according to our Support Procedures:

      We cannot debug your code for you and instead provide answers to specific problems.

      This effectively means that you're welcome to ask your questions and attach the code snippet that demonstrates your question or issue you're struggling with. However, we cannot debug your entire codebase, so you have to isolate your specific question and the corresponding part of code yourself before asking the question.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: Image Viewer API

      Hi @kmhfygg,

      There's no such thing as "Image Viewer".

      If you mean rendered images that are available in the history list of the "Picture Viewer", @Dunhou
      is correct - there's no public API that allows you to access them.

      If instead you'd like to access the output frame settings in the "Render settings" (i.e. "Frame Range", "From", "To", "Frame Step", etc..), please have a look at related thread: Access renderer specific settings with python.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: can I move objects with an external script?

      Hi @ArjenA ,

      Welcome to the Maxon developers forum and its community, it is great to have you with us!

      Getting Started

      Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.

      • Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.
      • Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.
      • Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.

      It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions.

      About your First Question

      Unfortunately we're not able to provide you with support on designing an architecture of your application, hence my answer here is very limited. Though, you're very welcome to ask more specific questions 😉

      Let's call your setup with physical board game, hardware and corresponding software as "backend" and the C4D part as "frontend". Generally speaking, there's nothing preventing you from making these parts communicating with each other and it all highly depends on your project setup: programming languages, physical interfaces, frameworks, etc that you're going to use.

      You can start with saving your live data in a file on your disk filesystem and read it using Python API in cinema. Once you have a proof of concept you can start optimizing, for example, by implement a proper communication interface, for example, REST API or Websocket sound like good (but not the only!) candidates for this purpose.

      With that's said, I wish you luck with your project. Feel free to make new postings with singular and more specific questions.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov