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. shivamist
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 5
    • Best 0
    • Controversial 0
    • Groups 0

    shivamist

    @shivamist

    0
    Reputation
    1
    Profile views
    5
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    shivamist Unfollow Follow

    Latest posts made by shivamist

    • RE: Add Expression Value in Render Settings Save Path

      If i'm not mistaken, "_1" is generated by Redshift if the "Regular Image" filename and the "Multi-Pass Image" filename are the same

      Same filename :
      image.png
      image.png

      Changing "-" to "_" at the end of the file :
      image.png
      eb647411-aa3c-4870-9f36-245afe77310f-image.png

      posted in General Talk
      S
      shivamist
    • RE: Refresh viewport after updating RenderData width and height

      Hello @ferdinand ! Thanks for answer it is very clear, i will use virtual resolution from now on 🙂

      posted in Cinema 4D SDK
      S
      shivamist
    • RE: Refresh viewport after updating RenderData width and height

      @ferdinand
      What's incorrect is the aspect ratio of the Background object or anything material that is in a Frontal projection

      In the following screenshot you can see that on the border of the Safe Frames (turned them red for easier readability), the Background object stops at the border of the image
      364ab08d-9427-49c4-891f-d572f485c04b-image.png
      646d3eb2-32c6-4436-9ba2-8edb497220c8-image.png

      Here is the result after using the script with SetParameter() :
      ac63e480-bd3f-40fd-92aa-c18883c6c6cf-image.png
      e60af422-4c4f-4323-964d-e2a217a29125-image.png

      I hope the issue is clear now, the expected behavior would be that if the resolution changes, the background object should follow

      posted in Cinema 4D SDK
      S
      shivamist
    • RE: Refresh viewport after updating RenderData width and height

      @ferdinand
      Here is the User action that fixes the viewport aspect ratio :

      The process is :

      • Launch script
      • Open "Render Settings" windows
      • Either click or drag the width/height box in the Output videopost

      Let me know if it's still unclear!

      posted in Cinema 4D SDK
      S
      shivamist
    • Refresh viewport after updating RenderData width and height

      Hello,
      I have a script that is used to update the resolution of the active document. Recently we implemented a way to get overscan size data (VFX work) and i'm having trouble with refreshing the viewport.
      The issue resides in the fact that if you don't interact with the resolution slider or input something manually, the viewport show effectively the change with the Safe Frames but if there is an existing Background object/ Material with Frontal projection it will not update. Only an user interaction can help.

      Here are some code snippets that i used to showcase the issue and what i tried in terms of flags/update/dirty states :

      import c4d
      import random
      
      def main():
          doc = c4d.documents.GetActiveDocument()
          rd = doc.GetActiveRenderData()
          bd = doc.GetActiveBaseDraw()
          print(f"Render Data X_Res before : {rd[c4d.RDATA_XRES]}")
          print(f"Render Data Y_Res before : {rd[c4d.RDATA_YRES]}")
          print("-------------------------------------------------")
          xres = random.randint(0, 1920)
          yres = random.randint(0, 1080)
          rd[c4d.RDATA_XRES] = xres
          print(f"Render Data X_Res after : {rd[c4d.RDATA_XRES]}")
          rd[c4d.RDATA_YRES] = yres
          print(f"Render Data Y_Res after : {rd[c4d.RDATA_YRES]}")
          print("-------------------------------------------------")
      
          rd.Message(c4d.MSG_UPDATE)
          rd.SetDirty(c4d.DIRTYFLAGS_ALL)
          rd.SetDirty(c4d.DIRTYFLAGS_DATA)
          c4d.GeSyncMessage(c4d.EVMSG_UPDATEBASEDRAW)
      
          c4d.EventAdd()
      
      if __name__=='__main__':
          main()
      
      import c4d
      import random
      
      def main():
          doc = c4d.documents.GetActiveDocument()
          rd = doc.GetActiveRenderData()
          bd = doc.GetActiveBaseDraw()
      
          print(f"Render Data X_Res before: {rd[c4d.RDATA_XRES]}")
          print(f"Render Data Y_Res before: {rd[c4d.RDATA_YRES]}")
          print("-------------------------------------------------")
      
          xres = random.randint(1000, 1920)
          print(f"Random X_Res: {xres}")
          yres = random.randint(500, 1080)
          print(f"Random Y_Res: {yres}")
      
          # Set the new X and Y resolution using SetParameter
          rd.SetParameter(c4d.RDATA_XRES, xres, c4d.DESCFLAGS_SET_USERINTERACTION | c4d.DESCFLAGS_SET_FORCESET | c4d.DESCFLAGS_SET_INDRAG)
          rd.SetParameter(c4d.RDATA_YRES, yres, c4d.DESCFLAGS_SET_USERINTERACTION | c4d.DESCFLAGS_SET_FORCESET | c4d.DESCFLAGS_SET_INDRAG)
      
          print(f"Render Data X_Res after: {rd[c4d.RDATA_XRES]}")
          print(f"Render Data Y_Res after: {rd[c4d.RDATA_YRES]}")
          print("-------------------------------------------------")
          print("-------------------------------------------------")
      
          rd.Message(c4d.MSG_UPDATE)
          rd.SetDirty(c4d.DIRTYFLAGS_ALL)
          rd.SetDirty(c4d.DIRTYFLAGS_DATA)
          c4d.GeSyncMessage(c4d.EVMSG_UPDATEBASEDRAW)
          c4d.DrawViews(c4d.DRAWFLAGS_FORCEFULLREDRAW)
          c4d.EventAdd()
      
      if __name__=='__main__':
          main()
      
      

      Video showcasing the issue :

      Thanks for your help in advance 🙂
      C4D R2025.0.2

      posted in Cinema 4D SDK windows python
      S
      shivamist