Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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. i_mazlov
    3. Posts
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 282
    • Best 71
    • Controversial 0
    • Groups 2

    Posts made by i_mazlov

    • RE: save/keep cache of generator plugin

      Hi Sebastian,

      Sorry for the delay.

      I'm afraid you're quite limited with the python generator, when it comes to storing your data, so the general suggestion would be switching to using the plugin. This way you could just override the NodeData.Read, NodeData.Write and NodeData.CopyTo to store and load your data using the HyperFile. For the more information on the NodeData.Read/Write function you could check the C++ manual.

      Let me know you have any other questions!
      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: save/keep cache of generator plugin

      Hi Sebastian,

      FYI I'll get to answer your posting beginning next week.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: Sweep Modifier

      Hi John,

      Having a modifier that changes the number of points (especially when you reduce them) isn't a very good idea, because in some setups you can have some dependencies that would be at least broken or even lead to the unstable execution. I think a better idea in this case would be to look in the direction of a generator object instead.

      With that's said, I've just briefly checked your code in the latest Cinema 4D version (that hasn't been release yet) and the issue is not reproducible there. This might be due to the undefined behavior of such modifier or due to some internal changes that I'm not aware of, this I can't say for sure.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      i_mazlov
    • RE: ZBP file format

      Hi @madfx,

      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: How to Ask Questions.

      About your First Question

      I'm sorry for the delayed answer.

      Unfortunately there's no existing public API that would allow you to do that.

      Cheers,
      Ilia

      posted in ZBrush SDK
      i_mazlovI
      i_mazlov
    • RE: Button scaled unexpectedly when it is in the same row with an expanded linkbox

      Hi @BruceC!

      The expandable UIs like COSTOMGUI_LINKBOX are not designed to be used with other elements on the same row, hence can lead to the undefined behavior like what you're experiencing. I suppose the workaround for you would be to put the linkbox on the row below the button.

      Cheers,
      Ilia

      posted in Cinema 4D SDK
      i_mazlovI
      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