Maxon Developers
    • Downloads
      • All Downloads
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
      • Cinema 4D Python Examples
      • Cinema 4D C++ Examples
      • Project Tool
      • SDK Database
    • Documentation
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
    • Forum
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Forums
      • Overview
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • News & Information
      • Downloads
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Shall we check if passed parameters are valid?

    SDK Help
    0
    3
    61
    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 26/07/2012 at 08:49, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :

      ---------
      In the SDK Examples, the SculptingTool example (sculpting.cpp) performs some checks in ToolData::MouseInput().

      Bool SculptingTool::MouseInput(BaseDocument *pDoc, BaseContainer &data, BaseDraw *pDraw, EditorWindow *win, const BaseContainer &msg)  
      {  
        if (!pDoc)  
            return TRUE;  
        if (pDraw != pDoc->GetActiveBaseDraw())  
            return TRUE;  
        
        /* .. */  
      }
      

      Why should Cinema pass invalid arguments to our plugins, should we really perform these kind of checks?

      -Nik

      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/07/2012 at 09:00, xxxxxxxx wrote:

        Better safe than sorry 🙂 It may be a bit over defensive but you should never assume a pointer to be valid, especially in a multi-threaded application as CINEMA 4D.

        cheers,
        Matthias

        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 30/07/2012 at 11:24, xxxxxxxx wrote:

          Ok, you're right at this point. Thanks! 🙂

          -Nik

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