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

    Remove Object element from OM

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 496 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/01/2012 at 14:03, xxxxxxxx wrote:

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

      ---------
      hi,
      I'm wondering if it's possible to remove objects from the OM. What I'm trying is as soon as the user hits the button create Cinema 4D removes my plugin from the OM
      I tried something like this.
       this.b.RemoveIndex(1000023);
      -------------
      this.b.Remove(1000023);
      and some other remove's

      this.b is the reference to the GetDataInstance(node) and the number is the Plugin ID

      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/01/2012 at 18:58, xxxxxxxx wrote:

        this->Remove();

        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 23/01/2012 at 06:05, xxxxxxxx wrote:

          at the moment it's not working becuase i think i've forgot to wrap a class into c#
          I asuming that this->Remove() calls the Remove function from GeListNode.
          So I was wondering why something like this wouldn't work

          BaseObject remveObj = this.b.GetObjectLink(1000023,doc);
          removeObj.Remove();
          

          this.b is a BaseContainer  getting the Data from GetDataInstance(node);

          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 23/01/2012 at 06:11, xxxxxxxx wrote:

            Have you checked that the result of GetObjectLink() returns a valid object?  The object must be in the document referenced by 'doc'.  GetObjectLink() is a link in the BaseContainer.  Try this instead (not sure if C# has pointer references) :

            BaseObject* removeObj = this.b.GetObjectLink(1000023,doc);
            removeObj->Remove();

            If C# doesn't then you will have to find a relevant way since the link isn't an object but a (memory) reference to it.

            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 23/01/2012 at 06:57, xxxxxxxx wrote:

              The weird thing is that i can delete meshs but not the plugin itself from the OM. I start to think that it's not possible within a plugin to delete or remove itself.

              Did you tested if it works to remove a plugin through his own script?
              Ok I tested it in the SDK with the Double circle it's not working C4D Crashes like it does when i try it with my c# script of my plugin

              BaseContainer *bc = ((BaseObject* )node)->GetDataInstance();
                
              			BaseObject *removeObj = bc->GetObjectLink(1001154,doc);
              			removeObj->Remove();
              
              1 Reply Last reply Reply Quote 0
              • First post
                Last post