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

    Link Field kepp object after delete objec

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 195 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 22/09/2006 at 12:35, xxxxxxxx wrote:

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

      ---------
      I have a XPresso-Tag with a Coffee-node.
      In this node i get a userdata field : Link type.
      This link I ask exist a link in this field.
      if yes, i get GlobalMatrix and copy it to another objekt.
       
      Now I test the XPresso:
      All right, if I have a link in the data field, the GlobalMatrix will get from the link object. If not, user can change it by himself.
      BUT when I delete the Objekt in the Szene, without delete it before in the userdata field, my XPresso-Tag shown the Object longer as exist and block the user changing of the object.
       
      But there is no object.
      If I make second ask:
      if (YourCam)
       {
        if (doc->FindObject(YourCam->GetName()))
         {
       
      Will be the same, he find a object !
      Why ?
      Is it a bug, or a priority problem ?

      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 22/09/2006 at 15:11, xxxxxxxx wrote:

        If the user deleted the object from the document, but you had previously stored YourCam, YourCam will still point to memory (that is, not NULL) even though the object no longer exists.

        You may need to go about this in the opposite direction. Store the name somewhere (as long as you can guarantee uniqueness) and first try to find the object. Then you are guaranteed to have a valid object pointer.

        Have you considered BaseContainer::GetObject() and SetObject()? This seems to be rudimentary Link support for COFFEE and the return of GetObject() will reflect the existence of the object in the document.

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