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

    CURRENTSTATETOOBJECT of a Null

    SDK Help
    0
    2
    294
    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 02/06/2017 at 03:22, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R16 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      I am still struggling with the SendModelingCommand()+MCOMMAND_CURRENTSTATETOOBJECT.

      A standard Sphere is ok, but wat to do with a Null.
      Are there issues or things to check when CST a Null?

      Here my code.

      ModelingCommandData cd;
      cd.doc = GetActiveDocument();
      //cd.op = (BaseObject* )obj->GetClone(COPYFLAGS_NO_BITS, nullptr);
      cd.op = obj;								//Do not Clone!!!
      if (!SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT, cd)) return false;
      cstObject = (BaseObject* )cd.result->GetIndex(0);
      if (!cstObject) return nullptr;
      

      -Pim

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

        On 02/06/2017 at 03:40, xxxxxxxx wrote:

        Found it.
        I did not take the correct document (virtual / cache object);

        //cd.doc = GetActiveDocument();
        cd.doc = obj->GetDocument();
        

        -Pim

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