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
    • Login

    Transient render errors with RenderDocument()

    Scheduled Pinned Locked Moved SDK Help
    10 Posts 0 Posters 782 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 24/11/2010 at 07:41, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11.532 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hello together,

      i'm currently working on a command line plugin which is trying to render a document at some point.  It's working fine until 32bit float images have to be created. The problem is, that the illumination channel looks brighter than it should in some cases. This happens unpredictable.

      I guess this is because of my missinterpretation of the RenderDocument() method and/or the wrong use of the MultipassBitmap Class, so maybe someone can help me to get it correct.

      Her comes some example code:

      The rendering is started during the start-up phase of C4D:

      Bool PluginMessage(LONG id, void *data)  
      {  
        // only use functionality if c4d is started without gui  
        if (GeGetSystemInfo() != SYSTEMINFO_NOGUI) return FALSE;  
        
        // run on C4D startup  
        // normally comand line args are passed, skipped for demonstration  
        if (id == C4DPL_COMMANDLINEARGS)  
        {  
            // start rendering here  
            Run();  
        
            return TRUE;  
        }  
        
        return FALSE;  
      }
      

      The implementation of the exemplary Run() method:

      void Run()  
      {  
        // load document  
        BaseDocument *doc = LoadDocument(   "myscene.c4d",   
                                            SCENEFILTER_OBJECTS|SCENEFILTER_MATERIALS,   
                                            NULL    );  
        if (!doc) return;  
        
        // retrieve RenderData information  
        RenderData *rData = doc->GetActiveRenderData();  
        if (!rData) return;  
        BaseContainer *bc = rData->GetDataInstance();  
        if (!bc) return;  
        
        // prepare dummy bitmap  
        LONG x = bc->GetLong(RDATA_XRES);  
        LONG y = bc->GetLong(RDATA_YRES);  
        LONG depth  = MODE_RGBf;           // depth is hardcoded for demonstration  
        MultipassBitmap *bmp = MultipassBitmap::Alloc(x, y, depth);  
        if (!bmp)  
        {      
            KillDocument(doc);  
            return;  
        }  
        
        // start render  
        LONG result = RenderDocument(doc, *bc, NULL, NULL, bmp, RENDERFLAG_EXTERNAL, NULL);  
        
        // cleanup  
        MultipassBitmap::Free(bmp);  
        KillDocument(doc);  
        
        return;  
      }
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 25/11/2010 at 03:59, xxxxxxxx wrote:

        I am not sure if this solves your problem but it neccessary to set the render settings to 32 bit too to render 32 floats.

        cheers,
        Matthias

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 25/11/2010 at 04:55, xxxxxxxx wrote:

          Thanks for your reply, but it doesn't help to fix my problem.

          I forgott to mention, that in the active rendersettings of the loaded document all nessesary values like bit depth, resolution, render path, ... are properly set.

          There is no problem with rendering 32bit floats, this works fine. The problem is, that those images are not looking like they they do when rendered by clicking on the render button in C4D.

          Heinrich.

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 25/11/2010 at 04:59, xxxxxxxx wrote:

            So far I can't reproduce the problem. If possible send me a scene where it is reproducable please.

            cheers,
            Matthias

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 29/11/2010 at 03:48, xxxxxxxx wrote:

              I checked with the scene you send me but I can't reproduce the problem. I tested with R11.532 and R12 on Windows 7 64 bit.

              cheers,
              Matthias

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 29/11/2010 at 04:12, xxxxxxxx wrote:

                Thanks for your help so far. I'll check if I can get more clues about the problem and tell you if I find something.

                Heinrich Löwe.

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 01/12/2010 at 08:45, xxxxxxxx wrote:

                  Hi all.

                  I did some tests today on multiple machines, with different operating systems:

                  - Three of them are workstations with win7 64bit running. They all produced correct results.
                  - The rest was taken from our render farm, running winXP 64bit.  Some of them produced wrong results, some not. After restarting them, the problems were gone and all images created by them looked fine.

                  Since you didn't mention any errors in my code, it looks to me like a memory initialisation problem. This would explain, that you couldn't reproduce the bug, because you are rebooting your system from time to time.
                  Now i could go out and restart all render machines, but i'm afraid it want help in the long term.

                  To narrow the problem i got some questions:

                  - Can you verify that my code is correct and there don't have to be more initialisations of MultipassBitmap, the call of RenderDocument() , ... ?

                  - Is it possible, that there is a bug in the internals of the RenderDocument() method, the allocation of the BaseBitmap class or somewhere else?

                  - Is there some kind of test i can perform on the (still running) error producing machines?

                  This issue has very high priority to us, cause it hits the core of a long term development project.

                  Thanks,
                  Heinrich.

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                    On 06/12/2010 at 07:08, xxxxxxxx wrote:

                    I did further tests today, and i recognized two facts:

                    - On the machines where the error occured, i removed all plugins, started C4D normally and rendered the test scene.  The results where incorrect in the first place, but after restarting the application and rendering again everything worked fine. In short words: The error also showed up without any of my plugins active.

                    - While rendering the scene via the NET render client everything worked fine.

                    I'll think about more ways to investigate further an keep you up to date,
                    regards,
                    Heinrich

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

                      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                      On 13/12/2010 at 01:24, xxxxxxxx wrote:

                      There was no response for around  two weeks, is there someone working on the problem?

                      Heinrich.

                      1 Reply Last reply Reply Quote 0
                      • H Offline
                        Helper
                        last edited by

                        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                        On 13/12/2010 at 06:32, xxxxxxxx wrote:

                        Sorry but as long as I am not able to reproduce the problem I can't be of much help. What I need is clearly reproducable example (code and scene file).

                        As for your example code it looks ok to me and I am not aware of any problems with RenderDocument.

                        I am sorry that I can't be much of assist but I really need a reproducable case.

                        cheers,
                        Matthias

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post