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
    • Login

    Edit object in BaseDocument

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 275 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 23/11/2008 at 11:45, xxxxxxxx wrote:

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

      ---------
         Hi!

      I have a beginner question. I have an object in a document and want to change its position in a ToolData::MouseInput.

      > <code>
      > Bool MyToolData::MouseInput(BaseDocument *doc, BaseContainer &data;, BaseDraw *bd, EditorWindow *win, const BaseContainer &msg;)
      > {
      >    GetActiveDocument()->GetFirstObject()->SetPos(Vector(100));
      >    return TRUE;
      > }</code>

      Currently the objects position is not updated in the editr until I clicked on the object. I guess I have to update the object or document. I tried MSG_UPDATE or MSG_CHANGE which did not work.

      Which Message needs to be sent (object? document?) ?

      Thanks a lot.

      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/11/2008 at 20:51, xxxxxxxx wrote:

        This might work (and a little more error checking) 😉

        BaseDocument* doc = GetActiveDocument();
        if (!doc) return FALSE;
        BaseObject* obj = doc->GetFirstObject();
        if (!obj) return FALSE;
        obj->SetPos(Vector(100.0f));
        obj->Message(MSG_UPDATE);
        // For asynchronous AM update while in Mouse loop
        GeSyncMessage(EVMSG_ASYNCEDITORMOVE);
        // Update display to show drag results
        DrawViews(DA_ONLY_ACTIVE_VIEW|DA_NO_THREAD|DA_NO_ANIMATION);
        return TRUE;

        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 24/11/2008 at 01:53, xxxxxxxx wrote:

          Thank you 🙂 Works perfect

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