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

    TraceColor keeps on crashing!!!

    SDK Help
    0
    8
    609
    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
      Helper
      last edited by

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

      On 15/04/2005 at 08:47, xxxxxxxx wrote:

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

      ---------
      Hi all

      Have been trying to write a little test with a VOLUMESHADER plugin that traces the scene and changes the current pixel colour slightly. However, the plugin seems to crash no matter how I change the code.

      My current code (in the CalcVolumetric method) centres around this snippet ...

      LONG hit;
      Vector p,n,col;

      col = sd->TraceColor(sd->ray,1000000,0,p,n,hit);

      Is this rights? Or am I missing something out?

      Cheers

      Dan

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

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

        On 15/04/2005 at 12:13, xxxxxxxx wrote:

        Have you set SHADER_VOLUMETRIC flag?

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

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

          On 15/04/2005 at 12:27, xxxxxxxx wrote:

          Yep, and the SHADER_RAYTRACING flag too.

          Could it be compiler settings? I followed the tutorial by Astrofish to set the Visual C++ project up, so that should be ok, right?

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

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

            On 17/04/2005 at 11:58, xxxxxxxx wrote:

            Hi

            Just out of interest, if no one knows what the problem is or if I'm being too vague, then could someone post some code that uses 'TraceColor' that definately works, please?

            Cheers

            Dan

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

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

              On 21/04/2005 at 13:30, xxxxxxxx wrote:

              Have you tried TraceColorDirect()? There's a sample call in Radiosity.cpp in the 7.303 SDK.

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

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

                On 26/04/2005 at 12:02, xxxxxxxx wrote:

                Hi Mikael

                Have tried what you suggested, but have had no luck unfortunately. I even got the Radiosity example from the 8.1 SDK and copied the main function into my code (almost word for word) and it still doesn't work! Here's my function below ...

                void VolumeTest::CalcVolumetric(PluginMaterial *mat, VolumeData *vd)
                {
                     Vector col;
                     LVector p, n;
                     LONG hit;

                VolumeData *cpy = VolumeData::Alloc();
                     //if (!cpy) return 0.0;
                     vd->CopyTo(cpy); // copy vd settings into cpy

                col = cpy->TraceColorDirect(vd->ray,MAXREAL,vd->raydepth+1,vd->raybits,0,&p;,&n;,&hit;);

                vd->col = col*0.5; // return 50% of color (as an example)
                     vd->trans = 1.0;

                VolumeData::Free(cpy); // free copied data
                }

                It all seems to compile fine on VC6, but when I tried to create a new shader of it in C4D8.1 the program just crashes with a stack error. HELP!!

                Cheers

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

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

                  On 26/04/2005 at 16:06, xxxxxxxx wrote:

                  check to see if vd exists.
                  if (!vd) return

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

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

                    On 26/04/2005 at 16:32, xxxxxxxx wrote:

                    Ok. Will give that a go. Why would it not exist though?

                    Isn't vd the current volumedata context?

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