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. RTF
    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 4
    • Best 0
    • Controversial 0
    • Groups 0

    RTF

    @RTF

    0
    Reputation
    3
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    RTF Unfollow Follow

    Latest posts made by RTF

    • how to use the commands from Octane/Redshift's symbols.h

      As a beginner, how to use the commands from Octane/Redshift's symbols.h when writing C4D scripts?
      5a443c08-0d48-48f2-b848-f0f971292d2c-image.png
      5a46b6df-da5c-4a5f-a94e-b1b97d5863b7-image.png
      In the image above, those are enumerated commands from symbols.h, but I don't know how to use them in scripts.

      Are there any learning resources available about this topic?

      posted in General Talk programming
      R
      RTF
    • RE: python script change Redshift setting

      @Dunhou @i_mazlov
      Thanks a lot.😊 😊 😊

      posted in Cinema 4D SDK
      R
      RTF
    • RE: python script change Redshift setting

      @Dunhou
      Thank you for your help, but after I run the following code, the Redshift Settings have not changed
      By the way I am a python novice and the above code is written by GPT
      I just want to use the script to change the Settings of the image below
      358cb6fc-db66-4fdd-94bc-7684b2223966-image.png

      posted in Cinema 4D SDK
      R
      RTF
    • python script change Redshift setting

      I want to write a script to set the Settings of Redshift Matpreview
      But

      import c4d
      import c4d.documents
      import redshift
      import os
      
      
      def FindVideoPost(renderData, pluginId):
          vp = renderData.GetFirstVideoPost()
          while vp is not None:
              if vp.IsInstanceOf(pluginId):
                  return vp
              vp = vp.GetNext()
          return None
      
      def FindAddVideoPost(renderData, vpPluginID):
          vp = FindVideoPost(renderData, vpPluginID)
          if vp is None:
              vp = c4d.documents.BaseVideoPost(vpPluginID)
              if vp is not None:
                  renderData.InsertVideoPost(vp)
          return vp
      
      def main():
          doc = c4d.documents.GetActiveDocument()
          renderdata = doc.GetActiveRenderData()
      
          vprs = FindAddVideoPost(renderdata, redshift.VPrsrenderer)
          if vprs is None:
              return
      
          # Switch renderer
          renderdata[c4d.RDATA_RENDERENGINE] = redshift.VPrsrenderer
      
          # Set Redshift render parameters
          vprs[c4d.PREFS_REDSHIFT_MATPREVIEW_MODE] = 1
      
          # Refresh UI
          c4d.EventAdd()
          # print("Render settings updated to 4K and frame range set to All Frames.")
      
      # Execute the main function
      if __name__=='__main__':
          main()
      

      vprs[c4d.PREFS_REDSHIFT_MATPREVIEW_MODE] = 1
      This code doesn't seem to have any effect

      Then I changed the method and set the code in C4D

      import c4d
      from c4d import gui
      
      def set_amlimit_preference():
          # 获取全局设置容器
          bc = c4d.GetWorldContainerInstance()
      
          # 设置新的值为 666
          bc[c4d.PREFS_REDSHIFT_MATPREVIEW_MODE] = 1
          
          # 应用修改后的设置
          c4d.SetWorldContainer(bc)
      
          # 保存设置到磁盘
          c4d.SaveWorldPreferences()
      
          # 尝试刷新界面
          c4d.EventAdd()
      
      
      # 运行函数
      if __name__ == '__main__':
          set_amlimit_preference()
      

      Can not be modified successfully

      Can someone help me

      posted in Cinema 4D SDK python windows 2024
      R
      RTF