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

    debugging question

    Cinema 4D SDK
    c++ r20
    4
    15
    3.8k
    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.
    • E
      ello
      last edited by

      what does it mean when the debugger holds at a line like that,

      Vector rndoffset = bc->GetVector(RNDOFFSET);
      

      with a message "CINEMA 4D.exe hat einen Haltepunkt ausgelöst."

      1 Reply Last reply Reply Quote 0
      • r_giganteR
        r_gigante
        last edited by

        Hi ello, first of all thanks for getting back with the code fragment.

        Analyzing the fragment provided I've ended up in a list of comments:

        • why the "Dependency List" approach is used twice in your code to check children dirty status?

        • why the "Dependency List" approach is used in combination with BaseObject::GetAndCheckHierarchyClone()? In the BaseObject Manual they are properly described and making them working in-cascade can actually lead to unexpected behaviors.

        • most of your code completely lacks pointer validity check; I warmly suggest to extend such a type of check to the whole code snippet to be user that unallocated pointer's methods are not called resulting in a message like "CINEMA 4D.exe hat einen Haltepunkt ausgelöst."

        • what does it mean when the debugger holds at a line like that,
          Vector rndoffset = bc->GetVector(RNDOFFSET);
          with a message "CINEMA 4D.exe hat einen Haltepunkt ausgelöst."

          it simply means that the bc pointer is likely to be invalid.

        Last but not least, considering that in the very net days I'll be pretty busy for the DevKitchen 2018 preparation[URL-REMOVED] I can't engage longer discussion or provide thoughtful answers, but back from the event I'll be eager to assist further. One last question: what is the intended delivered functionality of your ObjectData?

        Best, Riccardo


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

        E 1 Reply Last reply Reply Quote 3
        • E
          ello
          last edited by

          thank you Riccardo, i must admit that i just followed the adjustments needed to make it compile under r20. the code worked like that in previous versions and the plugin itself is quite old so i didn't question the code itself.

          maybe it is time to do so and walk thru every line

          1 Reply Last reply Reply Quote 0
          • E
            ello @r_gigante
            last edited by ello

            @r_gigante said in debugging question:

            what does it mean when the debugger holds at a line like that,
            Vector rndoffset = bc->GetVector(RNDOFFSET);
            with a message "CINEMA 4D.exe hat einen Haltepunkt ausgelöst."

            it simply means that the bc pointer is likely to be invalid.

            according to this problem, the pointer must be valid, i am checking it like

            	if (!bc) return nullptr;
            

            and if i run the plugin without debugging that one works. additional information, the line before that one throwing the exeption is:

            	Float lightSpeedFactor = bc->GetFloat(LIGHTSPEEDFACTOR);
            

            so, if bc wasn't valid, that one should give the same exception, right?
            so far, i replaced it by

            	Vector rndoffset = Vector(0);// bc->GetVector(RNDOFFSET);
            

            and the whole plugin works. this is really strange

            1 Reply Last reply Reply Quote 0
            • a_blockA
              a_block
              last edited by

              Hi ello,

              we are back from DevKitchen, but Riccardo is still busy and I just stumbled across this thread.
              Probably he was irritated by the German error message. Actually I think, it's not an exception you are encountering, but just an internal assertion or critical stop, see for example FAQ: Introduction. This could for example happen, if you access a BaseContainer, where you have stored a value with a different type under the same ID before. Maybe RNDOFFSET was used for a different type somewhere lese in the plugin?

              Cheers,
              Andreas

              1 Reply Last reply Reply Quote 2
              • r_giganteR
                r_gigante
                last edited by

                Thanks Andreas, for jumping in and bumping this conversation up and take my apologize ello for not getting back early.

                Let me know if Andreas suggestion brought some good result or in case, please follow up.

                Riccardo

                1 Reply Last reply Reply Quote 1
                • E
                  ello
                  last edited by

                  thank you both for getting back. i'll double check again if the ID has been used before. however i am totally lost with this upgrading. since the plugin worked flawless in previous versions and after getting it to compile with r20 it crashes so often.

                  1 Reply Last reply Reply Quote 0
                  • a_blockA
                    a_block
                    last edited by

                    Hi ello,
                    I'm sure, we will finally get you there. Let's sort it one by one (and if possible one per thread).
                    First we'll need to distinguish between actual crashes and above mentioned debug stops. I'd be surprised if a plugin starts really crashing badly and often, just by being converted to and running in R20. Maybe you can take a few screenshots of the debugger's output window in different "crash" situations.
                    Bye,
                    Andreas

                    1 Reply Last reply Reply Quote 0
                    • E
                      ello
                      last edited by ello

                      finally i found it 🙂 in the init function i used SetFloat... and that caused the problem when trying GetVector

                      this part is solved, thanks for pointing me towards the right direction

                      a_blockA 1 Reply Last reply Reply Quote 0
                      • a_blockA
                        a_block @ello
                        last edited by

                        @ello said in debugging question:

                        when i hover for example RNDOFFSET in visual studio i get enum <unnamed>::RNDOFFSET = 1029

                        does this unnamed part cause something?

                        No, it doesn't cause anything. It just means the symbol is defined in an unnamed enum. We avoid such nowadays (improved error checking, easier to debug), but they don't do any harm.

                        furthermore, since this is a plugin collection the name RNDOFFSET is indeed used with another id in another plugin. does this play a role? i thought that only included files are taken into account?

                        Well, I doubt so, but it may. The point is using unique IDs per BaseContainer. And to access a certain ID always with the same type (you could change the type, but let's leave this aside for now). So for a single BaseContainer Is try to make sure and check, that one ID (I mean the symbol or name like RNDOFFSET) is always accessed with the same type, and that no two symbols have identical ID values, so you do not access the same BaseContainer entry with two different names (lets say RNDOFFSET_INT and RNDOFFSET_VEC) but maybe different types.

                        here is a screenshot for the actual issue

                        From briefly looking at the screenshot on my mobile, it does not give me an additional clue. I recommend to add the debugger console to your layout. Usually we print some extra info there, when we run into a Critical Stop.

                        Bye,
                        Andreas

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