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

    Updating external path when calling Save Project

    SDK Help
    0
    4
    363
    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 30/04/2013 at 05:00, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R12-R14 
      Platform:   Windows  ; Mac  ;  
      Language(s) :     C++  ;

      ---------
      Hi,

      if I have an ObjectData plugin referencing to an external file, how can I update the path of the referenced file to make it relative to the scene file when using "Save Project".
      I already handle the MSG_GETALLASSETS message so that my external file (which is not a texture) does get copied over. I had assumed that MSG_RENAMETEXTURES is what I look for, but it's not sent when I call "Save Project" (couldn't get it sent at all).
      How is it done in the XRef object?
      Hoping for your answers!

      Thank and best regards,
      Satara

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

        On 30/04/2013 at 16:44, xxxxxxxx wrote:

        BaseDocument -> GetDocumentPath() will return the path where the scene was saved to file.  Then you just need to move/copy the referenced file to there and change the reference in your plugin if needed.

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

          On 02/05/2013 at 05:34, xxxxxxxx wrote:

          But how should I trigger the change of the path? I mean if I call "Save Project" from the menu I will only get a message after the files have been saved, but I need to redirect the path before they get saved..

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

            On 02/05/2013 at 05:49, xxxxxxxx wrote:

            As far as I know, there are no messages sent when saving a document (only when loading).  It may be that when your plugin calls your overridden Write() method (called during writing of the document to disk) that you need to resolve the copying/moving of referenced files.  I'm unsure as I usually let the user make explicit reference changes so that might not be the best approach.

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