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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Getting Ambient Occlusion settings

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 339 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 25/08/2007 at 15:34, xxxxxxxx wrote:

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

      ---------
      Hi,

      I'm converting some code over from COFFEE into C++. A similar setup worked in COFFEE, but I'm not having luck in C++...

      I'm having trouble getting the Ambient Occlusion settings from the render dialog.

      BaseDocument *bDoc = GetActiveDocument();
      RenderData* rdata = bDoc->GetActiveRenderData();
      BaseContainer* rdbc = rdata->GetDataInstance();
      BaseContainer* rdao = rdbc->GetContainerInstance(RDATA_AMBIENTOCCLUSION);

      GeData rdAOMinLength = rdao->GetData(AMBIENTOCCLUSIONSHADER_MINLENGTH);

      I'm getting an error that AMBIENTOCCLUSIONSHADER_MINLENGTH has not been declared.

      I'm just starting out in C++, and I'm not really sure where I'm going wrong.

      Can anyone help sort me out?

      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 30/08/2007 at 01:57, xxxxxxxx wrote:

        You have to use GetReal() to get the MinLength of AO.

        Real rdAOMinLength = rdao->GetReal(AMBIENTOCCLUSIONSHADER_MINLENGTH);

        Unlike COFFEE you have to differentiate between variable types in C++. So for a length value you usally would use a Real. You can look up what kind of type you need in the xambientocclusion.res file. You also have to include the xambientocclusion.h file to your sourcecode to have access to the defines.

        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 06/09/2007 at 22:24, xxxxxxxx wrote:

          Thanks for the reply, Matthias.

          Should I include the path to the xambientocclusion.res file in Cinema 4D, or should I copy that into my plug-in's resource directory, instead?

          Right now, I'm including from the C4D directory, which works. Just not sure if that is a good programming practice.

          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 07/09/2007 at 10:17, xxxxxxxx wrote:

            It's better to just reference the include directory instead of moving all of the files to the project. Imagine working on twenty plugins and having a copy of the C4D resource folder for each one for each version of C4D! 😉

            This is the correct practice: reference third party APIs from a stock location. Now, there is no problem copying the resource folder somewhere 'closer' to your project. I keep my projects on a data drive and that is where copies of the C4D resource folders and libraries are kept as well.

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