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

    pKrime

    @pKrime

    1
    Reputation
    97
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    pKrime Unfollow Follow

    Best posts made by pKrime

    • RE: Cinema 4D R20 and Octane 3.08.5 attribute issue

      Hi AndreAnjos,

      Octane stores the passes settings in a VideoPost, and c4d.SET_PASSES_ENABLED is the ID for the checkbox highlighted in mp5gosu's reply.

      Here's a snippet to print out the checkbox state, in the hope it helps

      def check_octane_passes():
          renderSettings = doc.GetActiveRenderData()
          
          _vp = renderSettings.GetFirstVideoPost()
          oc_vp = None  # Octane VideoPost
      
          while _vp:
              if _vp.CheckType(1029525):  # Octane ID
                  oc_vp = _vp
                  break
              _vp = _vp.GetNext()
      
          if not oc_vp:
              return
      
          print "Octane Passes Enabled", oc_vp[c4d.SET_PASSES_ENABLED]
      

      the error

      AttributeError: 'module' object has no attribute 'SET_PASSES_ENABLED'

      might imply that the Octane attributes have not been added at all to the c4d module. If that's the case you might need to make sure that your code is executed after the Octane plugin has been fully initialized

      Hope it helps,
      Paolo

      posted in Cinema 4D SDK
      pKrimeP
      pKrime

    Latest posts made by pKrime

    • RE: custom RenderDocument plugin to render with progress from python. Kind of works but...

      Hi Andreas,

      thanks for your reply, I too think that the Octane devs can definetely help with this and I'm working to set up some tests for them to run.

      I cannot be sure of which renderers are having problems with this solution, the issue with Octane + Full motion blur is hard to pinpoint itself: is it with the low VRAM? Deferred process? Something with threading that is not working as expected?

      But speaking of the Maxon side, can you confirm it is safe to use a renderprogress hook inside a function exposed via pylib? Do you know of someone that has tried it already?

      Out of curiosity, how come the python RenderDocument function doesn't do that? Are there any plans to add progress output to the python command? Not necessarily in the callback form: a renderprogress like the one of the commandline render would be useful already

      kind regards,
      Paolo

      posted in General Talk
      pKrimeP
      pKrime
    • RE: Cinema 4D R20 and Octane 3.08.5 attribute issue

      Hi AndreAnjos,

      Octane stores the passes settings in a VideoPost, and c4d.SET_PASSES_ENABLED is the ID for the checkbox highlighted in mp5gosu's reply.

      Here's a snippet to print out the checkbox state, in the hope it helps

      def check_octane_passes():
          renderSettings = doc.GetActiveRenderData()
          
          _vp = renderSettings.GetFirstVideoPost()
          oc_vp = None  # Octane VideoPost
      
          while _vp:
              if _vp.CheckType(1029525):  # Octane ID
                  oc_vp = _vp
                  break
              _vp = _vp.GetNext()
      
          if not oc_vp:
              return
      
          print "Octane Passes Enabled", oc_vp[c4d.SET_PASSES_ENABLED]
      

      the error

      AttributeError: 'module' object has no attribute 'SET_PASSES_ENABLED'

      might imply that the Octane attributes have not been added at all to the c4d module. If that's the case you might need to make sure that your code is executed after the Octane plugin has been fully initialized

      Hope it helps,
      Paolo

      posted in Cinema 4D SDK
      pKrimeP
      pKrime
    • custom RenderDocument plugin to render with progress from python. Kind of works but...

      Hello, I have built a c++ plugin in which I use the RenderDocument function with a render progress hook, pretty much like in the commandline example, and exposed the function to python via

      pylib.InitModule("module_name", moduleFunctions, "Module Description")
      

      My custom function takes the document and renderdata as arguments and works as expected: when I send my render command in the script editor or in a python plugin I can see the printout of the render progress.

      Only, in some specific cases, the render hangs. For instance, if I render subdivision surfaces in Octane, with full motion blur on:

      • "Render progress: 0%" is printed, then no further output comes from the render hook
      • Octane info about exported materials is printed out as usual, but unlike the other times no update about rendering comes out
      • The GPU is busy, as expected, but no image is written
      • I see printouts about threads shutting down normally
      • The GPU stops being used
      • The VRAM is not emptied
      • The application freezes

      In the debugger, I can see that the internal RenderDocument function doesn't return, but I cannot see what it's really doing as I have no .pdb for the inner functions. I can see that the deassembly code is running a loop of some sort, but I am not proficient in assembly so that's it. There is no GPU nor CPU load

      the RenderDocument line is quite standard:

      RenderDocument(doc, data, RenderProgressHook, nullptr, bmp, RENDERFLAGS::EXTERNAL | RENDERFLAGS::NODOCUMENTCLONE | RENDERFLAGS::SHOWERRORS, nullptr);
      

      I have tried using no RenderProgressHook, or other combinations of renderflags, tried to run on separate threads both in C++ and Python, and using clones rather than doc and renderdata directly, but the results are always the same.

      I have tried to run the very code used in the sdk commandline render, even using commandlinerender.cpp as it is, the results are always the same:

      • if the render is started inside the c++ plugin, during the C4DPL_COMMANDLINEARGS message, it succeeds
      • if an Octane render with motion blur and subdivisions is invoked from inside python, either via exposed functions or plugin messages, it freezes

      I realise this is kind contrived and I have ventured through a strange path, is there any insight from the community or devs that can help me to fix this issue? Is there any structural barrier that prevents from having a progress hook when python is involved? And in which way the RenderDocument function provided in the python SDK, though without render progress, manages to work around this apparent issue? Does its implementation differ significantly from the one in the commandline example or does it use the C++ SDK too?

      Thanks for reading,
      Paolo

      posted in General Talk c++ python
      pKrimeP
      pKrime