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

    Prevent GvNode from being deleted

    SDK Help
    0
    2
    267
    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

      On 12/11/2016 at 19:19, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   18 
      Platform:    Mac  ;  Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Is there any way to prevent a GvNode from being deleted in the UI (i.e.: the user right clicks on the node and chooses Delete).

      One of these nodes in our graph is what we consider the "root" node, so this shouldn't be deleted. I tried calling BaseDocument::DoUndo whenever we receive a GV_MESSAGE_NODE_REMOVED message, but I'm getting a crash somewhere in c4d_gui.cpp:

      frame #8: 0x000000012b9914ca RenderMan_for_C4D.dylib`CDialogCallBack(cd=0x000000012cb5b2c0, cu=0x0000000105664340, msg=0x00007fff5fbfe810) + 138 at c4d_gui.cpp:74
         71  			GeUserArea* usr = (GeUserArea* )C4DOS.Cu->GetUserData(cu);
         72  			if (!usr)
         73  				return false;
      -> 74  			res = usr->Message(*msg, result);
         75  		}
         76  		else
         77  		{
      

      Thanks,
      Ian

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

        On 14/11/2016 at 02:32, xxxxxxxx wrote:

        Hello,

        as far as I can see there is no way to prevent that a certain XPRESSO node can be deleted.

        I guess you are catching the GV_MESSAGE_NODE_REMOVED in an XPRESSO node? You cannot call DoUndo() there because when the message is sent the node is not yet deleted and the undo-step not yet created.

        The only node that cannot be removed is the root node of a given GvNodeMaster. So if you want to define some "root" ports you can add some in-ports to the root node.

        best wishes,
        Sebastian

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