Updating external path when calling Save Project



  • 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



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



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



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


Log in to reply