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
    • Recent
    • Tags
    • Users
    • Register
    • Login
    1. Maxon Developers Forum
    2. Dunhou
    3. Posts
    Offline
    • Profile
    • Following 2
    • Followers 4
    • Topics 62
    • Posts 287
    • Groups 0

    Posts

    Recent Best Controversial
    • How to draw svg to bitmaps?

      Hey community,

      I want to display capsule assets with icon with maxon.AssetUtilitiesInterface.GetAssetIcon , but some of the icon is in svg format, can we draw this into a bitmap like command palate did?

      import c4d
      import maxon
      
      doc: c4d.documents.BaseDocument  # The currently active document.
      op: c4d.BaseObject | None  # The primary selected object in `doc`. Can be `None`.
      
      def main() -> None:
          """Called by Cinema 4D when the script is being executed.
          """
          repo = maxon.AssetInterface.GetUserPrefsRepository()
          uid = maxon.Id("file_bc73b379cb5e509e")
          # this is the ivy capsule id, it has a svg icon
          # uid = maxon.Id("com.rocketlasso.neutron.asset.generator.ivy")
      
          asset_description = repo.FindLatestAsset(
              maxon.AssetTypes.File(), uid, maxon.Id(), maxon.ASSET_FIND_MODE.LATEST)
          preview_url = maxon.AssetUtilitiesInterface.GetAssetIcon(asset_description)
          bmp = c4d.bitmaps.BaseBitmap()
          result, _ = bmp.InitWith(preview_url)
          if result != c4d.IMAGERESULT_OK:
              return None
          c4d.bitmaps.ShowBitmap(bmp)
      
      if __name__ == '__main__':
          main()
      

      Cheers~
      DunHou

      posted in Cinema 4D SDK windows python 2026
      DunhouD
      Dunhou
    • RE: Can we draw alpha image in viewport

      Sorry for my stupid question @ferdinand , I should use c4d.DRAW_ALPHA_NORMAL but not c4d.DRAW_ALPHA_FROM_IMAGE.

      Shame on me 😂

      Cheers~
      DunHou

      posted in Cinema 4D SDK
      DunhouD
      Dunhou
    • RE: How to add tabs to tool plugins.

      It works! Thanks!

      @ferdinand said in How to add tabs to tool plugins.:

      Unlike for node description resources, custom GUIs are not indicated as SOME_DATA_TYPE { CUSTOMGUI SOME_CUSTOM_GUI; ... } in dialog resources but always as their own data type (don't ask me why).

      Hahaha, this is really strange. The first thing I tried was CUTOMGUI SOME_CUSTOM_GUI. This is what I got with Agent Ransack...

      One more thing, I couldn't find the idd_uv_map.res file in the image in the local resources. Is it already embedded without displaying the source code.

      Cheers~
      DunHou

      posted in Cinema 4D SDK
      DunhouD
      Dunhou
    • Can we draw alpha image in viewport

      Hey,

      I want to draw images with alpha in viewport, but what I got is a image with black bg, I already test DrawTexture flag DRAW_ALPHA_NORMAL_FROM_IMAGE and DRAW_ALPHA_FROM_IMAGE, they will not work.

      Can I draw bitmaps with alpha in viewport, like the little icon under the mouse?

      Cheers~
      DunHou

      posted in Cinema 4D SDK windows python 2026
      DunhouD
      Dunhou
    • RE: How to add tabs to tool plugins.

      Thanks for your detailed answer @ferdinand
      I do know quicktab, but I didn't find its symbol in res file, seems I can only make it works in python codes.

      I also agree it is bit strange to use sculpt plugins.

      Cheers~
      DunHou

      posted in Cinema 4D SDK
      DunhouD
      Dunhou
    • How to add tabs to tool plugins.

      I want to use groups UI in ToolData plugins is resource file( or in codes maybe ), but I didn't figure out witch us the right flag.

      Still, I can not upload images, but please see selection tool, it has option / axis / soft selection groups.

      How can I do this?

      Cheers~
      DunHou

      posted in Cinema 4D SDK windows python 2026
      DunhouD
      Dunhou
    • RE: How to start a new line in plugin help with localization?

      Thanks for your detailed answers @ferdinand !
      At night, I suddenly had a flash of inspiration and found a simpler solution, use html tags:

      IDS_PLUGIN_HELP "description about......<br><b>Ctrl: </b> do something...<br><b>Alt: </b> do something...
      

      Cheers~
      DunHou

      posted in Cinema 4D SDK
      DunhouD
      Dunhou
    • RE: How to start a new line in plugin help with localization?

      Thanks for your tips!

      @ferdinand said in How to start a new line in plugin help with localization?:

      I am personally also not sure it is a good idea to allow users putting control characters into strings, primarily due to whitespace

      I want to add some shortcut description to plugin like:

      Plugin Name
      description about.....
      Alt : do something...
      Shift : do something...

      do you have suggestions about this case?

      Cheers~
      DunHou

      posted in Cinema 4D SDK
      DunhouD
      Dunhou
    • How to start a new line in plugin help with localization?

      Hey community,

      I want to add plugin help (or tooltips), I can use embed string for \n, it works fine. but when I use c4d resource files (c4d_strings.str), it not worked, how can I fix this?

      I can not paste imgs, (Something went wrong while parsing server response)
      See Move Tool in c4d, it has 3 lines.

      Cheers~
      DunHou

      posted in Cinema 4D SDK windows python 2026
      DunhouD
      Dunhou
    • We can update the Python API to align with the C++API

      Hi SDK team,

      I notice that webview in python only have few api but without functions such as ExecuteJavascript or SetWebMessageCallback and the SetURLCallback is diffrent form C++, at least that's what the document says.

      Do we have plans to add corresponding functions in Python APIs?
      Or, on the existing basis, how do you suggest implementing data processing from C4D ->web ->C4D?e.g. Read the selected object, click the button in the webview, and rename the selected object.

      Cheers~
      DunHou

      posted in Cinema 4D SDK windows python
      DunhouD
      Dunhou
    • RE: Getting some weird console output from GeDialog.Timer()

      Timer should return None:

          def Timer(self, msg: BaseContainer) -> None:
              """
              If you subscribe to timer events using :meth:`SetTimer` (x), this function is called every x'th millisecond.
          
              :type msg: BaseContainer
              :param msg: The raw timer message.
              """
              pass
      
      posted in Cinema 4D SDK
      DunhouD
      Dunhou
    • RE: Educational Licenses

      @ferdinand Thanks for your great examples! Very helpful!

      posted in Cinema 4D SDK
      DunhouD
      Dunhou
    • RE: set GvNode value via python

      Thanks for @ferdinand awesome answer!
      I found DescLevel and DescId always confused to me, but them do can access more than simple set item, time to dive deeper to the DescLevel part 😦

      Cheers~
      DunHou

      posted in Cinema 4D SDK
      DunhouD
      Dunhou
    • set GvNode value via python

      Hey community,

      This my first dive into graphview node, sorry if this is a stupid basic question.

      I want to set condition node input port (GvPort) value, but it seems I can not do this via __settitem__ / SetParameter, is this is a limit or I do it in wrong way?

      Cheers~
      DunHou
      b8c3289c-5cf6-4c7b-b30d-278e78852e8a-image.png

      import c4d
      
      def iterateNodes(node):
          while node:
              description = node.GetDescription(c4d.DESCFLAGS_DESC_0)
              data: c4d.BaseContainer
              pid: c4d.DescID
              for data, pid, _ in description:
                  value: any | None = None
                  try:
                      value = node[pid]
                  except:
                      value = "Inaccessible in Python"
                  
                  if str(data[c4d.DESC_NAME]).startswith("Input"):
                      print(f"\tInput '{data[c4d.DESC_NAME]}'(c4d.{data[c4d.DESC_IDENT]}) = {value} type: {type(value)}")
                      
              
              node[2000, 1001] = 2 # TypeError: __setitem__ got unexpected type 'int'.
              node.SetParameter([2000, 1002],2,0) # no error but not worrk.
              print(node[2000, 1001].GetDataInstance()) # AttributeError: parameter access failed
              
              if node.IsGroupNode():
                  iterateNodes(node.GetDown())
      
              node = node.GetNext()
      
      def main():
          # Checks if selected object is valid
          if op is None:
              raise ValueError("op is none, please select one object.")
      
          # Retrieves the xpresso Tag
          xpressoTag = op.GetTag(c4d.Texpresso)
          if xpressoTag is None:
              raise ValueError("Make sure the selected object get an Xpresso Tag.")
      
          # Retrieves the node master
          gvNodeMaster = xpressoTag.GetNodeMaster()
          if gvNodeMaster is None:
              raise RuntimeError("Failed to retrieve the Node Master.")
      
          # Retrieves the Root node (the Main XGroup) that holds all others nodes
          gvRoot = gvNodeMaster.GetRoot()
          if gvRoot is None:
              raise RuntimeError("Failed to retrieve the Root Node.")
      
          # Iterates overs all nodes of this root node.
          iterateNodes(gvRoot)
      
      
      if __name__ == '__main__':
          main()
      
      posted in Cinema 4D SDK windows python 2026
      DunhouD
      Dunhou
    • RE: Hide RenderPost settings

      I think you need to override RenderEngineCheck to false, the document said:

      Bool MyRenderer::RenderEngineCheck(const BaseVideoPost* node, Int32 id) const
      {
        switch (id)
        {
          case RENDERSETTING_STATICTAB_MULTIPASS:
          case RENDERSETTING_STATICTAB_ANTIALIASING:
          case RENDERSETTING_STATICTAB_OPTIONS:
          case RENDERSETTING_STATICTAB_STEREO:
            return false;
        }
       
        return true;
      }
      

      Cheers~
      DunHou

      posted in Cinema 4D SDK
      DunhouD
      Dunhou
    • RE: Maxon One Fall 2026.0 SDK Release

      @ferdinand love the new mxutils functions, Great work!

      btw, python SDK change notes seems link to C++ docs.

      Cheers~
      DunHou

      posted in News & Information
      DunhouD
      Dunhou
    • RE: Can I get keyboard input mode?

      Hey @ferdinand , thanks for your information, Iterate graph is one of the solutions to listen to name change, but what I want is the "state" of any text input.

      As I had posted on the beta forums (Typing software issue with Cinema 4D.), if someone used non-Latin languages, like Chinese for example, If you use a typing software like IME( Mircosoft Pinyin ), it should ship an English input. When we want to change something like an object name, it will set the typing to English mode. It is very annoying when you have tons of objects to rename one by one.

      So I wonder if I can get the "typing mode" so I can set the IME always in Chinese mode when I input a text, and keep in English when not typing text to use shortcuts.

      I am a very stupid beginner in C++, but you know what I mean. I try to use GetGUIThreadInfo and GUI_CARETBLINKING to get the text cursor, but it seems not work.

      Hope it is clear.

      Cheers~
      DunHou

      posted in Cinema 4D SDK
      DunhouD
      Dunhou
    • Can I get keyboard input mode?

      Hey community.

      I wonder if we can get the text input event in Cinema like this. That is to say, when pressing the keyboard, it is the action of inputting text.
      11578dde-1633-49f8-a0ff-ae3d09f50e24-image.png

      Another corresponding state is the shortcut key state, such as pressing C to collapse a certain object.

      How can I get this state via Python or in C++?

      Cheers~
      DunHou

      posted in Cinema 4D SDK windows python c++ 2025
      DunhouD
      Dunhou
    • RE: How to get explicit import node space?

      Thanks @ferdinand for your great solution!

      Cheers~
      DunHou

      posted in Cinema 4D SDK
      DunhouD
      Dunhou
    • RE: Graph Description Explicit Connections can not work in 3rd-renderer (Arnold).

      Hey @ferdinand ,

      thanks for details.

      Cheers~
      DunHou


      About forum, I can get notification about my own topic, And I clear all the cache, but nothing changed.

      After I tried to reset my account settings manually, then it worked as expected.

      posted in Cinema 4D SDK
      DunhouD
      Dunhou