GetDocumentPath() folder or c4d file?



  • On 17/02/2016 at 13:18, xxxxxxxx wrote:

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

    ---------
    I notice that if the project was saved, then the document path is to the folder containing the document C4D file.  If the project was saved with assets, then the document path is to the folder containing the folder with the document C4D file.

    I need to get to a file (an Alembic abc file) associated with the document file for a full path when there is only a filename for the Alembic file.

    Any easy way to resolve between the two possibilities?



  • On 17/02/2016 at 13:52, xxxxxxxx wrote:

    Nothing to see here.  It appears that adding GetDocumentName() will either add the folder or add nothing if it is not in a 'project folder'.  Confusing but at least it works.



  • On 18/02/2016 at 08:41, xxxxxxxx wrote:

    Hi Robert,

    to be honest, I'm not completely sure about your problem and how it got fixed.
    I know, you already left it behind, but if you find the time to explain it to me, I'd really like to understand it. Maybe we can improve our documentation.

    Also I'd like to throw GenerateTexturePath() into the mix. Despite it's name it can help to resolve path's for all kinds of assets. But as I said, I haven't fully understood your problem, so this might be off.



  • On 19/02/2016 at 11:59, xxxxxxxx wrote:

    Here is what I think it is.  When GetDocumentPath() is used and then I use SetFile(), it doesn't append as much as it replaces the last folder with the filename.  If I do GetDocumentPath()+GetDocumentName() and then SetFile(), it is replacing the document file with the other file (correctly).  In the former case, that is how the document folder was being lost.  That is it. Resolved.


Log in to reply