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
    • Recent
    • Tags
    • Users
    • Register
    • Login

    instanceof() clears BaseObject pointer

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 211 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 04/01/2005 at 10:28, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.012 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      I've received a valid bug report for one of my COFFEE plugins that only occurs in R9.012 (no problems in earlier supported versions). Here is the code:

        
           var oc, op;  
           if (!(op = GetActiveObject(doc))) return;  
        
           // Process active Object  
           // - Make editable if necessary  
           if (!instanceof(op, PointObject))  
           {  
                var bc = new(BaseContainer);  
                doc->StartUndo();  
                doc->AddUndo(UNDO_OBJECT_REC, op);  
                SendModelingCommand(MCOMMAND_MAKEEDITABLE, doc, op, bc, MODIFY_ALL);  
                doc->EndUndo();  
                op = GetActiveObject(doc);  
                undos = TRUE;  
           }  
      // This line prints!  
           if (!op) println("That ain't right!");  
      

      And, yes, there is an active object in the first call. This could be related to SendModelingCommand()?

      Any work arounds for this - like an update to COFFEE, finally? 😉

      Thanks,
      Robert

      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 04/01/2005 at 11:27, xxxxxxxx wrote:

        Worked it out. Definitely a difference in SendModelingCommand() causing the issue. The workaround is not to try to do it to a Nullobject grouped set in R9. What did you guys do in R9?! 😉

        Thanks,
        Robert

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